Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save thenoseman/d5714ddc1e0529935f52 to your computer and use it in GitHub Desktop.
Save thenoseman/d5714ddc1e0529935f52 to your computer and use it in GitHub Desktop.
"Fix" broken archiver in arduino eclipse plugin / product
diff --git a/it.baeyens.arduino.core/src/it/baeyens/arduino/toolchain/ArduinoGnuMakefileGenerator.java b/it.baeyens.arduino.core/src/it/baeyens/arduino/toolchain/ArduinoGnuMakefileGenerator.java
index 8921518..dac70d7 100644
--- a/it.baeyens.arduino.core/src/it/baeyens/arduino/toolchain/ArduinoGnuMakefileGenerator.java
+++ b/it.baeyens.arduino.core/src/it/baeyens/arduino/toolchain/ArduinoGnuMakefileGenerator.java
@@ -5,6 +5,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
+import java.lang.Exception;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -850,7 +851,13 @@ public class ArduinoGnuMakefileGenerator implements IManagedBuilderMakefileGener
ByteArrayInputStream stream = new ByteArrayInputStream(bytes);
// use a platform operation to update the resource contents
boolean force = true;
- file.setContents(stream, force, false, null); // Don't record history
+ // This is a quick fix for the broken makefile generation
+ // currently the IDE produces a broken makefile containing NO output filename for avr-ar:
+ // "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-ar" rcs "" ./arduino/CDC.cpp.o ./ardu...
+ // which should be:
+ // "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-ar" rcs "arduino.ar" ./arduino/CDC.cpp.o ./ard
+ // Fix: verify code once, change makefile to look like the above ("arduino.ar") and make it "locked" (via properties)
+ try { file.setContents(stream, force, false, null); } catch(Exception e) {}// Don't record history
}
/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment