@@ -41,35 +41,45 @@ build.extra_flags=
41
41
# These can be overridden in platform.local.txt
42
42
compiler.c.extra_flags=
43
43
compiler.c.elf.extra_flags=
44
- compiler.S.extra_flags=
45
44
compiler.cpp.extra_flags=
45
+ compiler.S.extra_flags=
46
46
compiler.ar.extra_flags=
47
47
compiler.objcopy.eep.extra_flags=
48
48
compiler.elf2hex.extra_flags=
49
49
50
+ # These can be overridden in platform.sketch.txt
51
+ build.sketch_flags=
52
+ compiler.c.sketch_flags=
53
+ compiler.c.elf.sketch_flags=
54
+ compiler.cpp.sketch_flags=
55
+ compiler.S.sketch_flags=
56
+ compiler.ar.sketch_flags=
57
+ compiler.objcopy.eep.sketch_flags=
58
+ compiler.elf2hex.sketch_flags=
59
+
50
60
# AVR compile patterns
51
61
# --------------------
52
62
53
63
## Compile c files
54
- 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}"
64
+ 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} {compiler.c.sketch_flags} {build.sketch_flags} { includes} "{source_file}" -o "{object_file}"
55
65
56
66
## Compile c++ files
57
- 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}"
67
+ 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} {compiler.cpp.sketch_flags} {build.sketch_flags} { includes} "{source_file}" -o "{object_file}"
58
68
59
69
## Compile S files
60
- 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}"
70
+ 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} {compiler.S.sketch_flags} {build.sketch_flags} { includes} "{source_file}" -o "{object_file}"
61
71
62
72
## Create archives
63
73
# archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value
64
74
archive_file_path={build.path}/{archive_file}
65
- recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
75
+ recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} {compiler.ar.sketch_flags} "{archive_file_path}" "{object_file}"
66
76
67
77
## Combine gc-sections, archives, and objects
68
- 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
78
+ recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} {compiler.c.elf.sketch_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm
69
79
70
80
## Create output files (.eep and .hex)
71
- 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"
72
- 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"
81
+ recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} {compiler.objcopy.eep.sketch_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep"
82
+ recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} {compiler.elf2hex.sketch_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
73
83
74
84
## Save hex
75
85
recipe.output.tmp_file={build.project_name}.hex
@@ -83,10 +93,10 @@ recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
83
93
84
94
## Preprocessor
85
95
preproc.includes.flags=-w -x c++ -M -MG -MP
86
- recipe.preproc.includes="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.includes.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}"
96
+ recipe.preproc.includes="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.includes.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} {compiler.cpp.sketch_flags} {build.sketch_flags} { includes} "{source_file}"
87
97
88
98
preproc.macros.flags=-w -x c++ -E -CC
89
- recipe.preproc.macros="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.macros.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 "{preprocessed_file_path}"
99
+ recipe.preproc.macros="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.macros.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} {compiler.cpp.sketch_flags} {build.sketch_flags} { includes} "{source_file}" -o "{preprocessed_file_path}"
90
100
91
101
# AVR Uploader/Programmers tools
92
102
# ------------------------------
0 commit comments