The workspace:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_workspace_file>
<Workspace title="phycore1775_led">
<Project filename="phycore1775_led.cbp" active="1" >
<Depends filename="RTW_lib.cbp" />
</Project>
<Project filename="RTW_lib.cbp" />
</Workspace>
</CodeBlocks_workspace_file>
The project self:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="phycore1775_led" />
<Option pch_mode="2" />
<Option compiler="tricoregcc" />
<Option virtualFolders="RTW\;" />
<Build>
<Target title="Debug">
<Option output="binaries\phycore1775_led_dbg.elf" prefix_auto="0" extension_auto="0" />
<Option object_output="build\debug" />
<Option type="1" />
<Option compiler="tricoregcc" />
<Compiler>
<Add option="-g" />
</Compiler>
<Linker>
<Add library="build\debug\librtw.a" />
</Linker>
</Target>
<Target title="Release">
<Option output="binaries\phycore1775_led.elf" prefix_auto="0" extension_auto="0" />
<Option object_output="build\release" />
<Option type="1" />
<Option compiler="tricoregcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
<Add library="build\release\librtw.a" />
</Linker>
</Target>
</Build>
<VirtualTargets>
<Add alias="All" targets="Debug;Release;" />
</VirtualTargets>
<Compiler>
<Add option="-mcpu=tc1775" />
<Add option="-O2" />
<Add option="-fno-short-enums" />
<Add option="-fno-common" />
<Add option="-W" />
<Add option="-Wall" />
<Add option="-g" />
<!--
XXX This is the same as defines.txt; move to function
-->
<Add option="-DERT=1" />
<Add option="-DMODEL=phycore1775_led" />
<Add option="-DNUMST=1" />
<Add option="-DNCSTATES=0" />
<Add option="-DHAVESTDIO" />
<Add option="-DADD_MDL_NAME_TO_GLOBALS=1" />
<Add option="-DONESTEPFCN=1" />
<Add option="-DTERMFCN=1" />
<Add option="-DMAT_FILE=0" />
<Add option="-DMULTI_INSTANCE_CODE=0" />
<Add option="-DINTEGER_CODE=0" />
<Add option="-DMT=0" />
<Add option="-DMULTITASKING=0" />
<Add option="-DTID01EQ=0" />
<!--
where to find RTW's libsrc and rtwtypes.h
-->
<Add directory="." />
</Compiler>
<Linker>
<Add option="-Wl,--Map,map.txt" />
<Add option="-mcpu=tc1775" />
</Linker>
<!-- Sources -->
<Unit filename="tcboard_main.c"><Option compilerVar="CC" /></Unit>
<Unit filename="rtwtypes.h" />
<Unit filename="phycore1775_led.c"><Option compilerVar="CC" /></Unit>
<Unit filename="phycore1775_led.h" />
<Unit filename="phycore1775_led_data.c"><Option compilerVar="CC" /></Unit>
<Unit filename="phycore1775_led_private.h" />
<Unit filename="phycore1775_led_types.h" />
<!-- RTW specific stuff -->
<Unit filename="phycore1775_led.rtw"><Option virtualFolder="RTW\" /></Unit>
<Unit filename="rtw_proj.tmw"><Option virtualFolder="RTW\" /></Unit>
<!-- Other generated stuff -->
<Unit filename="defines.txt" />
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
The library depend on:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="rtwlib" />
<Option pch_mode="2" />
<Option compiler="tricoregcc" />
<Build>
<Target title="Debug">
<Option output="build\debug\librtw.a" prefix_auto="0" extension_auto="0" />
<Option object_output="build\debug" />
<Option type="2" />
<Option compiler="tricoregcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="build\release\librtw.a" prefix_auto="0" extension_auto="0" />
<Option object_output="build\release" />
<Option type="2" />
<Option compiler="tricoregcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<VirtualTargets>
<Add alias="All" targets="Debug;Release;" />
</VirtualTargets>
<Compiler>
<Add option="-mcpu=tc1775" />
<Add option="-O2" />
<Add option="-fno-short-enums" />
<Add option="-fno-common" />
<Add option="-W" />
<Add option="-Wall" />
<Add option="-g" />
<!--
XXX This is the same as defines.txt; move to function
-->
<Add option="-DERT=1" />
<Add option="-DMODEL=phycore1775_led" />
<Add option="-DNUMST=1" />
<Add option="-DNCSTATES=0" />
<Add option="-DHAVESTDIO" />
<Add option="-DADD_MDL_NAME_TO_GLOBALS=1" />
<Add option="-DONESTEPFCN=1" />
<Add option="-DTERMFCN=1" />
<Add option="-DMAT_FILE=0" />
<Add option="-DMULTI_INSTANCE_CODE=0" />
<Add option="-DINTEGER_CODE=0" />
<Add option="-DMT=0" />
<Add option="-DMULTITASKING=0" />
<Add option="-DTID01EQ=0" />
<!--
where to find RTW's libsrc and rtwtypes.h
-->
<Add directory="." />
<Add directory="C:\Programme\MATLAB\R2007a\rtw\c\libsrc" />
</Compiler>
<Linker>
<Add option="-Wl,--Map,map.txt" />
<Add option="-mcpu=tc1775" />
</Linker>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_dbl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_dbl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_sgl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_dbl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_sgl.c"><Option compilerVar="CC" /></Unit>
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
The build log:
-------------- Build: Debug in rtwlib ---------------
tricore-gcc.exe -mcpu=tc1775 -O2 -fno-short-enums -fno-common -W -Wall -g -DERT=1 -DMODEL=phycore1775_led -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DADD_MDL_NAME_TO_GLOBALS=1 -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DMULTITASKING=0 -DTID01EQ=0 -g -I. -IC:\Programme\MATLAB\R2007a\rtw\c\libsrc -c C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.c -o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.o
...
tricore-ar.exe -rs build\debug\librtw.a C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_dbl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_dbl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_dbl.o
-------------- Build: Release in rtwlib ---------------
tricore-ar.exe -rs build\release\librtw.a C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_dbl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_dbl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_dbl.o
-------------- Build: Debug in phycore1775_led ---------------
tricore-gcc.exe -mcpu=tc1775 -O2 -fno-short-enums -fno-common -W -Wall -g -DERT=1 -DMODEL=phycore1775_led -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DADD_MDL_NAME_TO_GLOBALS=1 -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DMULTITASKING=0 -DTID01EQ=0 -g -I. -c phycore1775_led_data.c -o build\debug\phycore1775_led_data.o
tricore-gcc.exe -mcpu=tc1775 -O2 -fno-short-enums -fno-common -W -Wall -g -DERT=1 -DMODEL=phycore1775_led -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DADD_MDL_NAME_TO_GLOBALS=1 -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DMULTITASKING=0 -DTID01EQ=0 -g -I. -c tcboard_main.c -o build\debug\tcboard_main.o
tricore-gcc.exe -mcpu=tc1775 -O2 -fno-short-enums -fno-common -W -Wall -g -DERT=1 -DMODEL=phycore1775_led -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DADD_MDL_NAME_TO_GLOBALS=1 -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DMULTITASKING=0 -DTID01EQ=0 -g -I. -c phycore1775_led.c -o build\debug\phycore1775_led.o
tricore-g++.exe -o binaries\phycore1775_led_dbg.elf build\debug\phycore1775_led_data.o build\debug\tcboard_main.o build\debug\phycore1775_led.o -Wl,--Map,map.txt -mcpu=tc1775 build\debug\librtw.a
...
a) The objects of the library are not inside the given object_output object dir (target depend)
b) Therefore the release target lib is build on debug build objects
The Problem is related to gcc's outfile option -o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.o which should be
-o build\debug\rt_backsubcc_sgl.o as the binary output object directory tag promised - regardless if the source point to windows drive c:\ and/or the build is on drive d:\
The same with the ar command line.
It seems the path from source files are not stripped correctly for object files.
Regards,
Olaf