Author Topic: build of static lib and 3rd party sources binaries path  (Read 12119 times)

ope

  • Guest
build of static lib and 3rd party sources binaries path
« on: August 30, 2007, 08:17:39 am »
Hi,

what are the switches (does exists some?) to prevent from the following problem:

This is the Project File, which builds a static lib from 3rd party sources:

Code
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
...
<Target title="Release">
<Option output="librtw.a" prefix_auto="0" extension_auto="0" />
<Option object_output="build\release" />
<Option type="2" />
...
<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>
...

On build I get the error request dialog:
Can't build object output directory \\build\debug\C\Programme\MATLAB\R2007a\rtw\c\libsrc

The object should go into build\debug directory and not on the full path of the source!

Thanks,
Olaf



Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: build of static lib and 3rd party sources binaries path
« Reply #1 on: August 30, 2007, 02:09:41 pm »
See the Project -> Properties menu
Tab "Build Targets"
Select correct target
See what in box "output file name"

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

ope

  • Guest
Re: build of static lib and 3rd party sources binaries path
« Reply #2 on: August 30, 2007, 02:15:10 pm »
you mean this?



Thanks,
Olaf

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: build of static lib and 3rd party sources binaries path
« Reply #3 on: August 30, 2007, 02:26:47 pm »
Yes that is the correct place.

Note, I have .objs for "Objects output dir" this is for temp file, not the file output.

Try "output file name" with "build\debug\librtw.a"

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

ope

  • Guest
Re: build of static lib and 3rd party sources binaries path
« Reply #4 on: August 31, 2007, 07:20:33 am »
Thanks, it seems to be a bug in C::B!

Here the error again:


Interesting gcc's Messages about output path , source and objects are on different (window) drives:


On the same driver I get this


Interesting it does compile, well, but the object path is stripped correctly. Isn't this a bug?

Thanks,
Olaf

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: build of static lib and 3rd party sources binaries path
« Reply #5 on: August 31, 2007, 08:06:55 am »
Thanks, it seems to be a bug in C::B!
No, it seems to be a bug in your project setup, honestly. I tried to reproduce what you have said - it works perfectly. If you want further assistence please post a minimal project as an example. You can strip down the code but leave the project file etc. as it is.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

ope

  • Guest
Re: build of static lib and 3rd party sources binaries path
« Reply #6 on: August 31, 2007, 09:42:40 am »
Thanks for your answer. The build dir (where the project file is) is on d:\

Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="Test" />
<Option pch_mode="2" />
<Option compiler="tricoregcc" />
<Build>
<Target title="default">
<Option output="default\libTest.a" prefix_auto="0" extension_auto="0" />
<Option working_dir="" />
<Option object_output="default" />
<Option type="2" />
<Option compiler="tricoregcc" />
<Option createDefFile="1" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="-g" />
<Add option="-O2" />
<Add option="-fno-common" />
<Add option="-fno-short-enums" />
<Add option="-mcpu=tc1766" />
<Add directory="src" />
<Add directory="h" />
</Compiler>
<Linker>
<Add option="-Wl,--Map,map.txt" />
<Add option="-mcpu=tc1766" />
</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 />
</Extensions>
</Project>
</CodeBlocks_project_file>

The begin of the build log:
Code
-------------- Build: default in Test ---------------
tricore-gcc.exe -Wall -g -O2 -fno-common -fno-short-enums -mcpu=tc1766 -g  -Isrc -Ih  -c C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.c -o default\C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.o

Thanks,
Olaf

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: build of static lib and 3rd party sources binaries path
« Reply #7 on: August 31, 2007, 09:45:22 am »
Olaf: There has been people who stated they had issues using MinGW GCC with code on a different drive.
I assume that this would be an MinGW issue and not an C::B issue.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

ope

  • Guest
Re: build of static lib and 3rd party sources binaries path
« Reply #8 on: August 31, 2007, 10:09:54 am »
Quote
Olaf: There has been people who stated they had issues using MinGW GCC with code on a different drive.
I assume that this would be an MinGW issue and not an C::B issue.

For this I added C::B's generated command line. The object path isn't correct for some reasons. Also of interest:


Anyway, this is the build from http://www.hightec-rt.com using with the TriCORE gcc.

Thanks,
Olaf

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: build of static lib and 3rd party sources binaries path
« Reply #9 on: August 31, 2007, 10:36:46 am »
This bug has been fixed in revision 4036. Please download a latest nightly build. This is the reason we are unable to reproduce this.

Please Note: This bug has been fixed by specifying the full path of the source file in case the relative path creation fails. So in your case the objective files will be created inside C:\Programme\MATLAB\R2007a\rtw\c\libsrc\ folder.

If you don't like that then you'll need to copy the source files to the drive where your project file exists.
Be a part of the solution, not a part of the problem.

ope

  • Guest
Re: build of static lib and 3rd party sources binaries path
« Reply #10 on: September 03, 2007, 10:01:01 am »
Hi,

I'm using svn release 4417 for now. Anyway, it builds the object files inside the source directory!

Code
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  -IC:\Programme\MATLAB\R2007a\rtw\c\libsrc -I"D:\Dokumente und Einstellungen\olpetzol\Eigene Dateien\MATLAB\phycore1775_led_tricore_ert"  -c C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.c -o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.o
...

I would expect the object files located relative to the project directory as the project settings  suggest:


And now: the real confusing:

Code
...
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 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

The lib builds/created twice, in the project's defined directory and the current (c::b project's) directory!

Did I missunderstand something or is the bug not fixed correctly (maybe another one)?

Thanks
Olaf

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: build of static lib and 3rd party sources binaries path
« Reply #11 on: September 03, 2007, 03:28:33 pm »
I'm using svn release 4417 for now. Anyway, it builds the object files inside the source directory!

I wrote it earlier that in case the source file is in different drive, the object file would be build at the source location.

I would expect the object files located relative to the project directory as the project settings  suggest:

If the source directory is in different drive, the relative path creation fails and it uses the full path instead. This is currently hard-coded. But this can be changed.


And now: the real confusing:

Code
...
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 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

The lib builds/created twice, in the project's defined directory and the current (c::b project's) directory!

Did I missunderstand something or is the bug not fixed correctly (maybe another one)?

It's not created twice. Rather both of your targets are being built at the same time.
Be a part of the solution, not a part of the problem.

ope

  • Guest
Re: build of static lib and 3rd party sources binaries path
« Reply #12 on: September 04, 2007, 07:26:44 am »
Quote
If the source directory is in different drive, the relative path creation fails and it uses the full path instead. This is currently hard-coded. But this can be changed.

I would expect make/Makefile behavior!

Quote
It's not created twice. Rather both of your targets are being built at the same time.

The effect is, that two libs are created! One in build\debug\librtw.a and one inside the work directory; since the depency is related to librtw.a in the work/project directory, the release target (from virtual "all") will not be created!

Code
<?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\release\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" />
<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" />
<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 />
</Extensions>
</Project>
</CodeBlocks_project_file>

Regards,
Olaf


Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: build of static lib and 3rd party sources binaries path
« Reply #13 on: September 04, 2007, 08:43:10 am »
Quote
If the source directory is in different drive, the relative path creation fails and it uses the full path instead. This is currently hard-coded. But this can be changed.

I would expect make/Makefile behavior!

Please post one such working example.


The effect is, that two libs are created! One in build\debug\librtw.a and one inside the work directory; since the depency is related to librtw.a in the work/project directory, the release target (from virtual "all") will not be created!

Code
<?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\release\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" />
<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" />
<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 />
</Extensions>
</Project>
</CodeBlocks_project_file>

Sorry I couldn't understand your point. Which is dependent and on whom??
Be a part of the solution, not a part of the problem.

ope

  • Guest
Re: build of static lib and 3rd party sources binaries path
« Reply #14 on: September 04, 2007, 01:37:33 pm »
The workspace:

Code
<?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:
Code
<?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:
Code
<?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:
Code
-------------- 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