@@ -80,10 +80,10 @@ public boolean compile(Sketch sketch,
80
80
this .buildPath = buildPath ;
81
81
this .primaryClassName = primaryClassName ;
82
82
this .verbose = verbose ;
83
+ objectFiles = new ArrayList <File >();
83
84
84
85
// the pms object isn't used for anything but storage
85
86
MessageStream pms = new MessageStream (this );
86
-
87
87
Map <String , String > boardPreferences = Base .getBoardPreferences ();
88
88
89
89
//Check for null platform, and use system default if not found
@@ -164,7 +164,6 @@ public boolean compile(Sketch sketch,
164
164
}
165
165
}
166
166
167
- objectFiles = new ArrayList <File >();
168
167
169
168
// 0. include paths for core + all libraries
170
169
@@ -279,33 +278,10 @@ public boolean compile(Sketch sketch,
279
278
// 5. extract EEPROM data (from EEMEM directive) to .eep file.
280
279
System .out .println ("5. compileEep" );
281
280
compileEep (avrBasePath , buildPath , includePaths , configPreferences );
282
-
283
- /*
284
- commandObjcopy = new ArrayList(baseCommandObjcopy);
285
- commandObjcopy.add(2, "ihex");
286
- commandObjcopy.set(3, "-j");
287
- commandObjcopy.add(".eeprom");
288
- commandObjcopy.add("--set-section-flags=.eeprom=alloc,load");
289
- commandObjcopy.add("--no-change-warnings");
290
- commandObjcopy.add("--change-section-lma");
291
- commandObjcopy.add(".eeprom=0");
292
- commandObjcopy.add(buildPath + File.separator + primaryClassName + ".elf");
293
- commandObjcopy.add(buildPath + File.separator + primaryClassName + ".eep");
294
- execAsynchronously(commandObjcopy);
295
- */
296
281
297
282
// 6. build the .hex file
298
283
System .out .println ("6. compileHex" );
299
- compileHex (avrBasePath , buildPath , includePaths , configPreferences );
300
-
301
- /*
302
- commandObjcopy = new ArrayList(baseCommandObjcopy);
303
- commandObjcopy.add(2, "ihex");
304
- commandObjcopy.add(".eeprom"); // remove eeprom data
305
- commandObjcopy.add(buildPath + File.separator + primaryClassName + ".elf");
306
- commandObjcopy.add(buildPath + File.separator + primaryClassName + ".hex");
307
- execAsynchronously(commandObjcopy);
308
- */
284
+ compileHex (avrBasePath , buildPath , includePaths , configPreferences );
309
285
310
286
return true ;
311
287
}
@@ -534,7 +510,7 @@ static private String[] getCommandCompilerS(String avrBasePath,
534
510
configPreferences .get ("compiler.cpudef" ),
535
511
configPreferences .get ("build.mcu" ),
536
512
configPreferences .get ("build.f_cpu" ),
537
- configPreferences .get ("board " ),
513
+ configPreferences .get ("software " ),
538
514
Base .REVISION ,
539
515
includes ,
540
516
sourceName ,
@@ -593,7 +569,7 @@ private String[] getCommandCompilerC(String avrBasePath,
593
569
configPreferences .get ("compiler.cpudef" ),
594
570
configPreferences .get ("build.mcu" ),
595
571
configPreferences .get ("build.f_cpu" ),
596
- configPreferences .get ("board " ),
572
+ configPreferences .get ("software " ),
597
573
Base .REVISION ,
598
574
includes ,
599
575
sourceName ,
@@ -652,7 +628,7 @@ static private String[] getCommandCompilerCPP(String avrBasePath,
652
628
configPreferences .get ("compiler.cpudef" ),
653
629
configPreferences .get ("build.mcu" ),
654
630
configPreferences .get ("build.f_cpu" ),
655
- configPreferences .get ("board " ),
631
+ configPreferences .get ("software " ),
656
632
Base .REVISION ,
657
633
includes ,
658
634
sourceName ,
@@ -727,6 +703,12 @@ static public ArrayList<File> findFilesInFolder(File folder, String extension,
727
703
void compileSketch (String avrBasePath , String buildPath , ArrayList <String > includePaths , HashMap <String , String > configPreferences )
728
704
throws RunnerException
729
705
{
706
+ System .out .println ("compileSketch: start" );
707
+ System .out .println ("includePaths: " );
708
+ for (int i = 0 ; i < includePaths .size (); i ++) {
709
+ System .out .println ("-I" + (String ) includePaths .get (i ));
710
+ }
711
+
730
712
//logger.debug("compileSketch: start");
731
713
this .objectFiles .addAll (compileFiles (avrBasePath , buildPath , includePaths ,
732
714
findFilesInPath (buildPath , "S" , false ),
@@ -741,14 +723,21 @@ void compileLibraries (String avrBasePath, String buildPath, ArrayList<String> i
741
723
throws RunnerException
742
724
{
743
725
System .out .println ("compileLibraries: start" );
744
-
726
+
745
727
for (File libraryFolder : sketch .getImportedLibraries ()) {
746
728
System .out .println ("libraryFolder: " + libraryFolder );
747
729
File outputFolder = new File (buildPath , libraryFolder .getName ());
748
730
File utilityFolder = new File (libraryFolder , "utility" );
749
731
createFolder (outputFolder );
750
732
// this library can use includes in its utility/ folder
751
733
includePaths .add (utilityFolder .getAbsolutePath ());
734
+ //debug includePaths
735
+ System .out .println ("includePaths: " );
736
+ for (int i = 0 ; i < includePaths .size (); i ++) {
737
+ System .out .println ("-I" + (String ) includePaths .get (i ));
738
+ }
739
+
740
+
752
741
objectFiles .addAll (
753
742
compileFiles (avrBasePath , outputFolder .getAbsolutePath (), includePaths ,
754
743
findFilesInFolder (libraryFolder , "S" , false ),
@@ -778,6 +767,12 @@ void compileCore (String avrBasePath, String buildPath, String corePath, String
778
767
ArrayList <String > includePaths = new ArrayList ();
779
768
includePaths .add (corePath ); //include core path only
780
769
if (pinsPath != null ) includePaths .add (pinsPath );
770
+
771
+ //debug includePaths
772
+ System .out .println ("includePaths: " );
773
+ for (int i = 0 ; i < includePaths .size (); i ++) {
774
+ System .out .println ("-I" + (String ) includePaths .get (i ));
775
+ }
781
776
782
777
String baseCommandString = configPreferences .get ("recipe.ar.pattern" );
783
778
String commandString = "" ;
0 commit comments