diff --git a/app/src/processing/app/debug/Compiler.java b/app/src/processing/app/debug/Compiler.java index 8665f72d8..cdae52013 100644 --- a/app/src/processing/app/debug/Compiler.java +++ b/app/src/processing/app/debug/Compiler.java @@ -80,10 +80,10 @@ public class Compiler implements MessageConsumer { this.buildPath = buildPath; this.primaryClassName = primaryClassName; this.verbose = verbose; + objectFiles = new ArrayList(); // the pms object isn't used for anything but storage MessageStream pms = new MessageStream(this); - Map boardPreferences = Base.getBoardPreferences(); //Check for null platform, and use system default if not found @@ -164,7 +164,6 @@ public class Compiler implements MessageConsumer { } } - objectFiles = new ArrayList(); // 0. include paths for core + all libraries @@ -279,33 +278,10 @@ public class Compiler implements MessageConsumer { // 5. extract EEPROM data (from EEMEM directive) to .eep file. System.out.println("5. compileEep"); compileEep(avrBasePath, buildPath, includePaths, configPreferences); - -/* - commandObjcopy = new ArrayList(baseCommandObjcopy); - commandObjcopy.add(2, "ihex"); - commandObjcopy.set(3, "-j"); - commandObjcopy.add(".eeprom"); - commandObjcopy.add("--set-section-flags=.eeprom=alloc,load"); - commandObjcopy.add("--no-change-warnings"); - commandObjcopy.add("--change-section-lma"); - commandObjcopy.add(".eeprom=0"); - commandObjcopy.add(buildPath + File.separator + primaryClassName + ".elf"); - commandObjcopy.add(buildPath + File.separator + primaryClassName + ".eep"); - execAsynchronously(commandObjcopy); -*/ // 6. build the .hex file System.out.println("6. compileHex"); - compileHex(avrBasePath, buildPath, includePaths, configPreferences); - -/* - commandObjcopy = new ArrayList(baseCommandObjcopy); - commandObjcopy.add(2, "ihex"); - commandObjcopy.add(".eeprom"); // remove eeprom data - commandObjcopy.add(buildPath + File.separator + primaryClassName + ".elf"); - commandObjcopy.add(buildPath + File.separator + primaryClassName + ".hex"); - execAsynchronously(commandObjcopy); -*/ + compileHex(avrBasePath, buildPath, includePaths, configPreferences); return true; } @@ -534,7 +510,7 @@ public class Compiler implements MessageConsumer { configPreferences.get("compiler.cpudef"), configPreferences.get("build.mcu"), configPreferences.get("build.f_cpu"), - configPreferences.get("board"), + configPreferences.get("software"), Base.REVISION, includes, sourceName, @@ -593,7 +569,7 @@ public class Compiler implements MessageConsumer { configPreferences.get("compiler.cpudef"), configPreferences.get("build.mcu"), configPreferences.get("build.f_cpu"), - configPreferences.get("board"), + configPreferences.get("software"), Base.REVISION, includes, sourceName, @@ -652,7 +628,7 @@ public class Compiler implements MessageConsumer { configPreferences.get("compiler.cpudef"), configPreferences.get("build.mcu"), configPreferences.get("build.f_cpu"), - configPreferences.get("board"), + configPreferences.get("software"), Base.REVISION, includes, sourceName, @@ -727,6 +703,12 @@ public class Compiler implements MessageConsumer { void compileSketch(String avrBasePath, String buildPath, ArrayList includePaths, HashMap configPreferences) throws RunnerException { + System.out.println("compileSketch: start"); + System.out.println("includePaths: "); + for (int i = 0; i < includePaths.size(); i++) { + System.out.println("-I" + (String) includePaths.get(i)); + } + //logger.debug("compileSketch: start"); this.objectFiles.addAll(compileFiles(avrBasePath, buildPath, includePaths, findFilesInPath(buildPath, "S", false), @@ -741,7 +723,7 @@ public class Compiler implements MessageConsumer { throws RunnerException { System.out.println("compileLibraries: start"); - + for (File libraryFolder : sketch.getImportedLibraries()) { System.out.println("libraryFolder: " + libraryFolder); File outputFolder = new File(buildPath, libraryFolder.getName()); @@ -749,6 +731,13 @@ public class Compiler implements MessageConsumer { createFolder(outputFolder); // this library can use includes in its utility/ folder includePaths.add(utilityFolder.getAbsolutePath()); + //debug includePaths + System.out.println("includePaths: "); + for (int i = 0; i < includePaths.size(); i++) { + System.out.println("-I" + (String) includePaths.get(i)); + } + + objectFiles.addAll( compileFiles(avrBasePath, outputFolder.getAbsolutePath(), includePaths, findFilesInFolder(libraryFolder, "S", false), @@ -778,6 +767,12 @@ public class Compiler implements MessageConsumer { ArrayList includePaths = new ArrayList(); includePaths.add(corePath); //include core path only if (pinsPath != null) includePaths.add(pinsPath); + + //debug includePaths + System.out.println("includePaths: "); + for (int i = 0; i < includePaths.size(); i++) { + System.out.println("-I" + (String) includePaths.get(i)); + } String baseCommandString = configPreferences.get("recipe.ar.pattern"); String commandString = ""; diff --git a/build/shared/lib/preferences.txt b/build/shared/lib/preferences.txt index 336d94a96..c1d370cfe 100755 --- a/build/shared/lib/preferences.txt +++ b/build/shared/lib/preferences.txt @@ -240,6 +240,7 @@ run.present.exclusive.macosx = true board = uno target = arduino platform = avr +software=ARDUINO programmer = arduino:avrispmkii diff --git a/hardware/arduino/platforms.txt b/hardware/arduino/platforms.txt index dbb3a4086..d946b8274 100755 --- a/hardware/arduino/platforms.txt +++ b/hardware/arduino/platforms.txt @@ -58,6 +58,7 @@ avr.compiler.ldflags= avr.compiler.cpudef=-mmcu= avr.compiler.upload.cmd= avr.compiler.upload.flags= +avr.compiler.define=-DARDUINO= avr.library.path=./hardware/arduino/cores/arduino avr.library.core.path=./libraries