mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-19 13:54:23 +01:00
Compiler: cores files get compiled under "core", libraries under "libraries". Fixes #2997
This commit is contained in:
parent
46058a5bf6
commit
5a35be06da
@ -1011,7 +1011,12 @@ public class Compiler implements MessageConsumer {
|
|||||||
private void compileLibrary(UserLibrary lib, List<File> includeFolders)
|
private void compileLibrary(UserLibrary lib, List<File> includeFolders)
|
||||||
throws RunnerException, PreferencesMapException {
|
throws RunnerException, PreferencesMapException {
|
||||||
File libFolder = lib.getSrcFolder();
|
File libFolder = lib.getSrcFolder();
|
||||||
File libBuildFolder = prefs.getFile(("build.path"), lib.getName());
|
File librariesFolder = new File(prefs.getFile("build.path"), "libraries");
|
||||||
|
if (!librariesFolder.exists() && !librariesFolder.mkdirs()) {
|
||||||
|
throw new RunnerException("Unable to create folder " + librariesFolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
File libBuildFolder = new File(librariesFolder, lib.getName());
|
||||||
|
|
||||||
if (lib.useRecursion()) {
|
if (lib.useRecursion()) {
|
||||||
// libBuildFolder == {build.path}/LibName
|
// libBuildFolder == {build.path}/LibName
|
||||||
@ -1058,7 +1063,10 @@ public class Compiler implements MessageConsumer {
|
|||||||
|
|
||||||
File coreFolder = prefs.getFile("build.core.path");
|
File coreFolder = prefs.getFile("build.core.path");
|
||||||
File variantFolder = prefs.getFile("build.variant.path");
|
File variantFolder = prefs.getFile("build.variant.path");
|
||||||
File buildFolder = prefs.getFile("build.path");
|
File buildFolder = new File(prefs.getFile("build.path"), "core");
|
||||||
|
if (!buildFolder.exists() && !buildFolder.mkdirs()) {
|
||||||
|
throw new RunnerException("Unable to create folder " + buildFolder);
|
||||||
|
}
|
||||||
|
|
||||||
List<File> includeFolders = new ArrayList<File>();
|
List<File> includeFolders = new ArrayList<File>();
|
||||||
includeFolders.add(coreFolder); // include core path only
|
includeFolders.add(coreFolder); // include core path only
|
||||||
@ -1108,6 +1116,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
dict.put("ide_version", "" + BaseNoGui.REVISION);
|
dict.put("ide_version", "" + BaseNoGui.REVISION);
|
||||||
dict.put("archive_file", afile.getName());
|
dict.put("archive_file", afile.getName());
|
||||||
dict.put("object_file", file.getAbsolutePath());
|
dict.put("object_file", file.getAbsolutePath());
|
||||||
|
dict.put("build.path", buildFolder.getAbsolutePath());
|
||||||
|
|
||||||
String[] cmdArray;
|
String[] cmdArray;
|
||||||
String cmd = prefs.getOrExcept("recipe.ar.pattern");
|
String cmd = prefs.getOrExcept("recipe.ar.pattern");
|
||||||
@ -1144,7 +1153,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
PreferencesMap dict = new PreferencesMap(prefs);
|
PreferencesMap dict = new PreferencesMap(prefs);
|
||||||
String flags = dict.get("compiler.c.elf.flags") + optRelax;
|
String flags = dict.get("compiler.c.elf.flags") + optRelax;
|
||||||
dict.put("compiler.c.elf.flags", flags);
|
dict.put("compiler.c.elf.flags", flags);
|
||||||
dict.put("archive_file", "core.a");
|
dict.put("archive_file", new File("core", "core.a").getPath());
|
||||||
dict.put("object_files", objectFileList);
|
dict.put("object_files", objectFileList);
|
||||||
dict.put("ide_version", "" + BaseNoGui.REVISION);
|
dict.put("ide_version", "" + BaseNoGui.REVISION);
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -mcpu={b
|
|||||||
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}"
|
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}"
|
||||||
|
|
||||||
## Combine gc-sections, archives, and objects
|
## Combine gc-sections, archives, and objects
|
||||||
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "{build.path}/syscalls_sam3.c.o" {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group -lm -gcc
|
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "{build.path}/core/syscalls_sam3.c.o" {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group -lm -gcc
|
||||||
|
|
||||||
## Create output (.bin file)
|
## Create output (.bin file)
|
||||||
recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"
|
recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"
|
||||||
|
@ -15,3 +15,6 @@ new.3.compiler.path={runtime.tools.arm-none-eabi-gcc.path}/bin/
|
|||||||
old.4.tools.bossac.path={runtime.ide.path}/hardware/tools
|
old.4.tools.bossac.path={runtime.ide.path}/hardware/tools
|
||||||
new.4.tools.bossac.path={runtime.tools.bossac.path}
|
new.4.tools.bossac.path={runtime.tools.bossac.path}
|
||||||
|
|
||||||
|
old.5.recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "{build.path}/syscalls_sam3.c.o" {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group -lm -gcc
|
||||||
|
new.5.recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "{build.path}/core/syscalls_sam3.c.o" {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group -lm -gcc
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user