Define all the required symbols in the generated project files

pull/24/merge
Emilio Monti 2013-08-08 16:58:37 +01:00
parent 239a2f9adf
commit 27d07f4a1d
12 changed files with 25 additions and 16 deletions

View File

@ -35,6 +35,7 @@ class CodeRed(Exporter):
'linker_script': self.resources.linker_script,
'object_files': self.resources.objects,
'libraries': libraries,
'symbols': self.toolchain.get_symbols()
}
self.gen_file('codered_%s_project.tmpl' % self.target.lower(), ctx, '.project')
self.gen_file('codered_%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject')

View File

@ -28,10 +28,11 @@
<option id="com.crt.advproject.cpp.thumb.509442564" name="Thumb mode" superClass="com.crt.advproject.cpp.thumb" value="true" valueType="boolean"/>
<option id="gnu.cpp.compiler.option.preprocessor.def.347637870" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__NEWLIB__"/>
<listOptionValue builtIn="false" value="TOOLCHAIN_GCC_CR"/>
<listOptionValue builtIn="false" value="TARGET_LPC1768"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
<listOptionValue builtIn="false" value="CPP_USE_HEAP"/>
{% for s in symbols %}
<listOptionValue builtIn="false" value="{{s}}"/>
{% endfor %}
</option>
<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"/>
@ -49,10 +50,11 @@
<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"/>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.1824535269" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__NEWLIB__"/>
<listOptionValue builtIn="false" value="TOOLCHAIN_GCC_CR"/>
<listOptionValue builtIn="false" value="TARGET_LPC1768"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
<listOptionValue builtIn="false" value="CPP_USE_HEAP"/>
{% for s in symbols %}
<listOptionValue builtIn="false" value="{{s}}"/>
{% endfor %}
</option>
<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"/>
@ -941,10 +943,11 @@
<option id="com.crt.advproject.cpp.thumb.189747400" name="Thumb mode" superClass="com.crt.advproject.cpp.thumb" value="true" valueType="boolean"/>
<option id="gnu.cpp.compiler.option.preprocessor.def.874410253" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__NEWLIB__"/>
<listOptionValue builtIn="false" value="TOOLCHAIN_GCC_CR"/>
<listOptionValue builtIn="false" value="TARGET_LPC1768"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
<listOptionValue builtIn="false" value="CPP_USE_HEAP"/>
{% for s in symbols %}
<listOptionValue builtIn="false" value="{{s}}"/>
{% endfor %}
</option>
<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"/>
<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 @@
<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"/>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.740543529" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__NEWLIB__"/>
<listOptionValue builtIn="false" value="TOOLCHAIN_GCC_CR"/>
<listOptionValue builtIn="false" value="TARGET_LPC1768"/>
<listOptionValue builtIn="false" value="__CODE_RED"/>
<listOptionValue builtIn="false" value="CPP_USE_HEAP"/>
{% for s in symbols %}
<listOptionValue builtIn="false" value="{{s}}"/>
{% endfor %}
</option>
<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"/>
<option id="gnu.c.compiler.option.optimization.flags.675461365" name="Other optimization flags" superClass="gnu.c.compiler.option.optimization.flags" value="-Os" valueType="string"/>

View File

@ -49,5 +49,6 @@ class CodeSourcery(Exporter):
'library_paths': self.resources.lib_dirs,
'linker_script': self.resources.linker_script,
'libraries': libraries,
'symbols': self.toolchain.get_symbols()
}
self.gen_file('codesourcery_%s.tmpl' % self.target.lower(), ctx, 'Makefile')

View File

@ -16,7 +16,7 @@ CPP = $(GCC_BIN)arm-none-eabi-g++
CC_FLAGS = -c -Os -fno-common -fmessage-length=0 -Wall -fno-exceptions -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections
ONLY_C_FLAGS = -std=gnu99
ONLY_CPP_FLAGS = -std=gnu++98
CC_SYMBOLS = -DTARGET_LPC1768 -DTOOLCHAIN_GCC_CS -DNDEBUG
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
AS = $(GCC_BIN)arm-none-eabi-as

View File

@ -41,7 +41,8 @@ class DS5_5(Exporter):
'include_paths': self.resources.inc_dirs,
'scatter_file': self.resources.linker_script,
'object_files': self.resources.objects + self.resources.libraries,
'source_files': source_files
'source_files': source_files,
'symbols': self.toolchain.get_symbols()
}
target = self.target.lower()

View File

@ -29,6 +29,7 @@ class IAREmbeddedWorkbench(Exporter):
'linker_script': self.resources.linker_script,
'object_files': self.resources.objects,
'libraries': self.resources.libraries,
'symbols': self.toolchain.get_symbols()
}
self.gen_file('iar.ewp.tmpl', ctx, '%s.ewp' % self.program_name)
self.gen_file('iar.eww.tmpl', ctx, '%s.eww' % self.program_name)

View File

@ -42,7 +42,8 @@ class Uvision4(Exporter):
'include_paths': self.resources.inc_dirs,
'scatter_file': self.resources.linker_script,
'object_files': self.resources.objects + self.resources.libraries,
'source_files': source_files
'source_files': source_files,
'symbols': self.toolchain.get_symbols()
}
target = self.target.lower()

View File

@ -347,7 +347,7 @@
<uSurpInc>0</uSurpInc>
<VariousControls>
<MiscControls>--gnu</MiscControls>
<Define>TARGET_KL25Z, NDEBUG, TOOLCHAIN_ARM, __CMSIS_RTOS, __CORTEX_M0PLUS</Define>
<Define>{% for s in symbols %} {{s}}, {% endfor %}</Define>
<Undefine></Undefine>
<IncludePath> {% for path in include_paths %} {{path}}; {% endfor %} </IncludePath>
</VariousControls>

View File

@ -349,7 +349,7 @@
<uSurpInc>0</uSurpInc>
<VariousControls>
<MiscControls></MiscControls>
<Define>TARGET_LPC1114, NDEBUG, TOOLCHAIN_ARM, __CMSIS_RTOS, __CORTEX_M0</Define>
<Define>{% for s in symbols %} {{s}}, {% endfor %}</Define>
<Undefine></Undefine>
<IncludePath> {% for path in include_paths %} {{path}}; {% endfor %} </IncludePath>
</VariousControls>

View File

@ -344,7 +344,7 @@
<uThumb>0</uThumb>
<VariousControls>
<MiscControls>--gnu</MiscControls>
<Define>TARGET_LPC11U24, NDEBUG, TOOLCHAIN_ARM, __CMSIS_RTOS, __CORTEX_M0</Define>
<Define>{% for s in symbols %} {{s}}, {% endfor %}</Define>
<Undefine></Undefine>
<IncludePath> {% for path in include_paths %} {{path}}; {% endfor %} </IncludePath>
</VariousControls>

View File

@ -345,7 +345,7 @@
<uThumb>0</uThumb>
<VariousControls>
<MiscControls>--gnu</MiscControls>
<Define>TARGET_LPC1347, NDEBUG, TOOLCHAIN_ARM, __CMSIS_RTOS, __CORTEX_M3</Define>
<Define>{% for s in symbols %} {{s}}, {% endfor %}</Define>
<Undefine></Undefine>
<IncludePath> {% for path in include_paths %} {{path}}; {% endfor %} </IncludePath>
</VariousControls>

View File

@ -346,7 +346,7 @@
<uSurpInc>0</uSurpInc>
<VariousControls>
<MiscControls>--gnu</MiscControls>
<Define>TARGET_LPC1768, NDEBUG, TOOLCHAIN_ARM, __CMSIS_RTOS, __CORTEX_M3</Define>
<Define>{% for s in symbols %} {{s}}, {% endfor %}</Define>
<Undefine></Undefine>
<IncludePath> {% for path in include_paths %} {{path}}; {% endfor %} </IncludePath>
</VariousControls>