@@ -12,7 +12,7 @@ version=1.5.6
1212# ---------------------
1313
1414# Default "compiler.path" is correct, change only if you want to overidde the initial value
15- # compiler.path={ide.path}/tools/avr/bin/..
15+ compiler.path={runtime. ide.path}/hardware/ tools/avr/bin/
1616compiler.c.cmd=avr-gcc
1717compiler.c.flags=-c -g -Os -w -ffunction-sections -fdata-sections -MMD
1818compiler.c.elf.flags=-Os -Wl,--gc-sections
@@ -28,32 +28,42 @@ compiler.elf2hex.flags=-O ihex -R .eeprom
2828compiler.elf2hex.cmd=avr-objcopy
2929compiler.ldflags=
3030compiler.size.cmd=avr-size
31- # this can be overriden in boards.txt
31+
32+ # This can be overriden in boards.txt
3233build.extra_flags=
3334
35+ # These can be overridden in platform.local.txt
36+ compiler.c.extra_flags=
37+ compiler.c.elf.extra_flags=
38+ compiler.S.extra_flags=
39+ compiler.cpp.extra_flags=
40+ compiler.ar.extra_flags=
41+ compiler.objcopy.eep.extra_flags=
42+ compiler.elf2hex.extra_flags=
43+
3444# AVR compile patterns
3545# --------------------
3646
3747## Compile c files
38- recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
48+ recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} { build.extra_flags} {includes} "{source_file}" -o "{object_file}"
3949
4050## Compile c++ files
41- recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
51+ recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} { build.extra_flags} {includes} "{source_file}" -o "{object_file}"
4252
4353## Compile S files
44- recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
54+ recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} { build.extra_flags} {includes} "{source_file}" -o "{object_file}"
4555
4656## Create archives
47- recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} "{build.path}/{archive_file}" "{object_file}"
57+ recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}"
4858
4959## Combine gc-sections, archives, and objects
50- recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm
60+ recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm
5161
5262## Create eeprom
53- recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep"
63+ recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep"
5464
5565## Create hex
56- recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
66+ recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
5767
5868## Compute size
5969recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
0 commit comments