1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Remove core.a before rebuilding it

Before, the ar command was just ran for all .o files that should end up
in core.a, which should replace any old code in core.a. However, it
seems that in the unlikely event that functions or entire source files
are deleted, they might linger in the core.a file.
This commit is contained in:
Matthijs Kooijman 2014-04-10 14:47:36 +02:00
parent b032f748f1
commit 57bdacc93c

View File

@ -703,13 +703,19 @@ public class Compiler implements MessageConsumer {
if (variantFolder != null)
includeFolders.add(variantFolder);
File afile = new File(buildFolder, "core.a");
List<File> coreObjectFiles = compileFiles(buildFolder, coreFolder, true,
includeFolders);
// Delete the .a file, to prevent any previous code from lingering
afile.delete();
for (File file : coreObjectFiles) {
PreferencesMap dict = new PreferencesMap(prefs);
dict.put("ide_version", "" + Base.REVISION);
dict.put("archive_file", "core.a");
dict.put("archive_file", afile.getName());
dict.put("object_file", file.getAbsolutePath());
String[] cmdArray;