@@ -1011,7 +1011,12 @@ void compileLibraries(List<File> includeFolders) throws RunnerException, Prefere
1011
1011
private void compileLibrary (UserLibrary lib , List <File > includeFolders )
1012
1012
throws RunnerException , PreferencesMapException {
1013
1013
File libFolder = lib .getSrcFolder ();
1014
- File libBuildFolder = prefs .getFile (("build.path" ), lib .getName ());
1014
+ File librariesFolder = new File (prefs .getFile ("build.path" ), "libraries" );
1015
+ if (!librariesFolder .exists () && !librariesFolder .mkdirs ()) {
1016
+ throw new RunnerException ("Unable to create folder " + librariesFolder );
1017
+ }
1018
+
1019
+ File libBuildFolder = new File (librariesFolder , lib .getName ());
1015
1020
1016
1021
if (lib .useRecursion ()) {
1017
1022
// libBuildFolder == {build.path}/LibName
@@ -1058,7 +1063,10 @@ void compileCore()
1058
1063
1059
1064
File coreFolder = prefs .getFile ("build.core.path" );
1060
1065
File variantFolder = prefs .getFile ("build.variant.path" );
1061
- File buildFolder = prefs .getFile ("build.path" );
1066
+ File buildFolder = new File (prefs .getFile ("build.path" ), "core" );
1067
+ if (!buildFolder .exists () && !buildFolder .mkdirs ()) {
1068
+ throw new RunnerException ("Unable to create folder " + buildFolder );
1069
+ }
1062
1070
1063
1071
List <File > includeFolders = new ArrayList <File >();
1064
1072
includeFolders .add (coreFolder ); // include core path only
@@ -1108,6 +1116,7 @@ void compileCore()
1108
1116
dict .put ("ide_version" , "" + BaseNoGui .REVISION );
1109
1117
dict .put ("archive_file" , afile .getName ());
1110
1118
dict .put ("object_file" , file .getAbsolutePath ());
1119
+ dict .put ("build.path" , buildFolder .getAbsolutePath ());
1111
1120
1112
1121
String [] cmdArray ;
1113
1122
String cmd = prefs .getOrExcept ("recipe.ar.pattern" );
@@ -1144,7 +1153,7 @@ void compileLink()
1144
1153
PreferencesMap dict = new PreferencesMap (prefs );
1145
1154
String flags = dict .get ("compiler.c.elf.flags" ) + optRelax ;
1146
1155
dict .put ("compiler.c.elf.flags" , flags );
1147
- dict .put ("archive_file" , "core.a" );
1156
+ dict .put ("archive_file" , new File ( "core" , "core .a"). getPath () );
1148
1157
dict .put ("object_files" , objectFileList );
1149
1158
dict .put ("ide_version" , "" + BaseNoGui .REVISION );
1150
1159
0 commit comments