Skip to content

Commit 27d07f4

Browse files
committed
Define all the required symbols in the generated project files
1 parent 239a2f9 commit 27d07f4

12 files changed

+25
-16
lines changed

workspace_tools/export/codered.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def generate(self):
3535
'linker_script': self.resources.linker_script,
3636
'object_files': self.resources.objects,
3737
'libraries': libraries,
38+
'symbols': self.toolchain.get_symbols()
3839
}
3940
self.gen_file('codered_%s_project.tmpl' % self.target.lower(), ctx, '.project')
4041
self.gen_file('codered_%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject')

workspace_tools/export/codered_lpc1768_cproject.tmpl

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@
2828
<option id="com.crt.advproject.cpp.thumb.509442564" name="Thumb mode" superClass="com.crt.advproject.cpp.thumb" value="true" valueType="boolean"/>
2929
<option id="gnu.cpp.compiler.option.preprocessor.def.347637870" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
3030
<listOptionValue builtIn="false" value="__NEWLIB__"/>
31-
<listOptionValue builtIn="false" value="TOOLCHAIN_GCC_CR"/>
32-
<listOptionValue builtIn="false" value="TARGET_LPC1768"/>
3331
<listOptionValue builtIn="false" value="__CODE_RED"/>
3432
<listOptionValue builtIn="false" value="CPP_USE_HEAP"/>
33+
{% for s in symbols %}
34+
<listOptionValue builtIn="false" value="{{s}}"/>
35+
{% endfor %}
3536
</option>
3637
<option id="gnu.cpp.compiler.option.other.other.1100343989" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-exceptions" valueType="string"/>
3738

@@ -49,10 +50,11 @@
4950
<option id="com.crt.advproject.gcc.hdrlib.784082637" name="Use headers for C library" superClass="com.crt.advproject.gcc.hdrlib" value="com.crt.advproject.gcc.hdrlib.newlib" valueType="enumerated"/>
5051
<option id="gnu.c.compiler.option.preprocessor.def.symbols.1824535269" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
5152
<listOptionValue builtIn="false" value="__NEWLIB__"/>
52-
<listOptionValue builtIn="false" value="TOOLCHAIN_GCC_CR"/>
53-
<listOptionValue builtIn="false" value="TARGET_LPC1768"/>
5453
<listOptionValue builtIn="false" value="__CODE_RED"/>
5554
<listOptionValue builtIn="false" value="CPP_USE_HEAP"/>
55+
{% for s in symbols %}
56+
<listOptionValue builtIn="false" value="{{s}}"/>
57+
{% endfor %}
5658
</option>
5759
<option id="gnu.c.compiler.option.misc.other.1521041525" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-exceptions" valueType="string"/>
5860

@@ -941,10 +943,11 @@
941943
<option id="com.crt.advproject.cpp.thumb.189747400" name="Thumb mode" superClass="com.crt.advproject.cpp.thumb" value="true" valueType="boolean"/>
942944
<option id="gnu.cpp.compiler.option.preprocessor.def.874410253" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
943945
<listOptionValue builtIn="false" value="__NEWLIB__"/>
944-
<listOptionValue builtIn="false" value="TOOLCHAIN_GCC_CR"/>
945-
<listOptionValue builtIn="false" value="TARGET_LPC1768"/>
946946
<listOptionValue builtIn="false" value="__CODE_RED"/>
947947
<listOptionValue builtIn="false" value="CPP_USE_HEAP"/>
948+
{% for s in symbols %}
949+
<listOptionValue builtIn="false" value="{{s}}"/>
950+
{% endfor %}
948951
</option>
949952
<option id="gnu.cpp.compiler.option.other.other.1338090461" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-exceptions" valueType="string"/>
950953
<option id="gnu.cpp.compiler.option.optimization.flags.475225500" name="Other optimization flags" superClass="gnu.cpp.compiler.option.optimization.flags" value="-Os" valueType="string"/>
@@ -963,10 +966,11 @@
963966
<option id="com.crt.advproject.gcc.hdrlib.966879133" name="Use headers for C library" superClass="com.crt.advproject.gcc.hdrlib" value="com.crt.advproject.gcc.hdrlib.newlib" valueType="enumerated"/>
964967
<option id="gnu.c.compiler.option.preprocessor.def.symbols.740543529" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
965968
<listOptionValue builtIn="false" value="__NEWLIB__"/>
966-
<listOptionValue builtIn="false" value="TOOLCHAIN_GCC_CR"/>
967-
<listOptionValue builtIn="false" value="TARGET_LPC1768"/>
968969
<listOptionValue builtIn="false" value="__CODE_RED"/>
969970
<listOptionValue builtIn="false" value="CPP_USE_HEAP"/>
971+
{% for s in symbols %}
972+
<listOptionValue builtIn="false" value="{{s}}"/>
973+
{% endfor %}
970974
</option>
971975
<option id="gnu.c.compiler.option.misc.other.2015545820" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-exceptions" valueType="string"/>
972976
<option id="gnu.c.compiler.option.optimization.flags.675461365" name="Other optimization flags" superClass="gnu.c.compiler.option.optimization.flags" value="-Os" valueType="string"/>

workspace_tools/export/codesourcery.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,6 @@ def generate(self):
4949
'library_paths': self.resources.lib_dirs,
5050
'linker_script': self.resources.linker_script,
5151
'libraries': libraries,
52+
'symbols': self.toolchain.get_symbols()
5253
}
5354
self.gen_file('codesourcery_%s.tmpl' % self.target.lower(), ctx, 'Makefile')

workspace_tools/export/codesourcery_lpc1768.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ CPP = $(GCC_BIN)arm-none-eabi-g++
1616
CC_FLAGS = -c -Os -fno-common -fmessage-length=0 -Wall -fno-exceptions -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections
1717
ONLY_C_FLAGS = -std=gnu99
1818
ONLY_CPP_FLAGS = -std=gnu++98
19-
CC_SYMBOLS = -DTARGET_LPC1768 -DTOOLCHAIN_GCC_CS -DNDEBUG
19+
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
2020

2121

2222
AS = $(GCC_BIN)arm-none-eabi-as

workspace_tools/export/ds5_5.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def generate(self):
4141
'include_paths': self.resources.inc_dirs,
4242
'scatter_file': self.resources.linker_script,
4343
'object_files': self.resources.objects + self.resources.libraries,
44-
'source_files': source_files
44+
'source_files': source_files,
45+
'symbols': self.toolchain.get_symbols()
4546
}
4647
target = self.target.lower()
4748

workspace_tools/export/iar.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def generate(self):
2929
'linker_script': self.resources.linker_script,
3030
'object_files': self.resources.objects,
3131
'libraries': self.resources.libraries,
32+
'symbols': self.toolchain.get_symbols()
3233
}
3334
self.gen_file('iar.ewp.tmpl', ctx, '%s.ewp' % self.program_name)
3435
self.gen_file('iar.eww.tmpl', ctx, '%s.eww' % self.program_name)

workspace_tools/export/uvision4.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ def generate(self):
4242
'include_paths': self.resources.inc_dirs,
4343
'scatter_file': self.resources.linker_script,
4444
'object_files': self.resources.objects + self.resources.libraries,
45-
'source_files': source_files
45+
'source_files': source_files,
46+
'symbols': self.toolchain.get_symbols()
4647
}
4748
target = self.target.lower()
4849

workspace_tools/export/uvision4_kl25z.uvproj.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@
347347
<uSurpInc>0</uSurpInc>
348348
<VariousControls>
349349
<MiscControls>--gnu</MiscControls>
350-
<Define>TARGET_KL25Z, NDEBUG, TOOLCHAIN_ARM, __CMSIS_RTOS, __CORTEX_M0PLUS</Define>
350+
<Define>{% for s in symbols %} {{s}}, {% endfor %}</Define>
351351
<Undefine></Undefine>
352352
<IncludePath> {% for path in include_paths %} {{path}}; {% endfor %} </IncludePath>
353353
</VariousControls>

workspace_tools/export/uvision4_lpc1114.uvproj.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@
349349
<uSurpInc>0</uSurpInc>
350350
<VariousControls>
351351
<MiscControls></MiscControls>
352-
<Define>TARGET_LPC1114, NDEBUG, TOOLCHAIN_ARM, __CMSIS_RTOS, __CORTEX_M0</Define>
352+
<Define>{% for s in symbols %} {{s}}, {% endfor %}</Define>
353353
<Undefine></Undefine>
354354
<IncludePath> {% for path in include_paths %} {{path}}; {% endfor %} </IncludePath>
355355
</VariousControls>

workspace_tools/export/uvision4_lpc11u24.uvproj.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@
344344
<uThumb>0</uThumb>
345345
<VariousControls>
346346
<MiscControls>--gnu</MiscControls>
347-
<Define>TARGET_LPC11U24, NDEBUG, TOOLCHAIN_ARM, __CMSIS_RTOS, __CORTEX_M0</Define>
347+
<Define>{% for s in symbols %} {{s}}, {% endfor %}</Define>
348348
<Undefine></Undefine>
349349
<IncludePath> {% for path in include_paths %} {{path}}; {% endfor %} </IncludePath>
350350
</VariousControls>

workspace_tools/export/uvision4_lpc1347.uvproj.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@
345345
<uThumb>0</uThumb>
346346
<VariousControls>
347347
<MiscControls>--gnu</MiscControls>
348-
<Define>TARGET_LPC1347, NDEBUG, TOOLCHAIN_ARM, __CMSIS_RTOS, __CORTEX_M3</Define>
348+
<Define>{% for s in symbols %} {{s}}, {% endfor %}</Define>
349349
<Undefine></Undefine>
350350
<IncludePath> {% for path in include_paths %} {{path}}; {% endfor %} </IncludePath>
351351
</VariousControls>

workspace_tools/export/uvision4_lpc1768.uvproj.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@
346346
<uSurpInc>0</uSurpInc>
347347
<VariousControls>
348348
<MiscControls>--gnu</MiscControls>
349-
<Define>TARGET_LPC1768, NDEBUG, TOOLCHAIN_ARM, __CMSIS_RTOS, __CORTEX_M3</Define>
349+
<Define>{% for s in symbols %} {{s}}, {% endfor %}</Define>
350350
<Undefine></Undefine>
351351
<IncludePath> {% for path in include_paths %} {{path}}; {% endfor %} </IncludePath>
352352
</VariousControls>

0 commit comments

Comments
 (0)