C dependency file overwritten at the end of build process

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User22281
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hello All,

I am building an application project for an Aurix TC36x microcontroller using Aurix Studio v1.5.0 (I have also tried latest v1.5.4). I noticed that when I modify a C header file, the source files where the header is included are not rebuilt. After some analysis, I have checked that the original dependency file created by the Tasking compiler with option --dep-file=<filename>.d is overwritten by a "fake" file at the end of the build process, resulting in something like:

################################################################################
# Automatically-generated file. Do not edit!
################################################################################

Com.o :	../Source/Com.c
../Source/Com.c :
Com.o :	../Source/Com.h
../Source/Com.h :

This is NOT the original dependency file created by the Tasking compiler, which contains a full list of headers that are needed by Com.c. The one shown here is missing a lot of headers (all of them, basically).

My question is: what is replacing this file, why and how can I avoid it so my project incrementally without missing any changes?

Thank you very much.

0 Likes
10 Replies
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Dear Customer,

I have tested the procedure on AURIX™ Development Studio Version: 1.5.4 Build id: 20211221-1518 and no found the problem. I added 4 header files into project, and in cou0_main.c I include those header files. First I build the project and rebuild, make sure no extra files compiled. Then, I changed any header file from those I have added, and Rebuild, the compiler properly recognize the change, and re-compile the cpu0_main.c. If you check cpu0_main.d, you will see all the .h file dependence in it.

So, could you please try it? I used the demo project SPI_CPU_1_KIT_TC375_LK which you can import from Infineon Code Examples Repository which is installed automatically when install ADS 1.5.4.

Attached screenshots for your reference.

 

dw

SharedScreenshot.jpgSharedScreenshot2.jpg

0 Likes
User22281
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

The problem is that this dependency file only considers headers located under the same directory than the sources. However, if headers are located in a different directory, those are missed in this dependency file. As I mentioned, the original dependency file generated by Tasking considers all header files (not only local), but it gets overwritten by this file at the end of the build process.

If you move the headers to a different directory (and update the include search path accordingly in the compiler command line), you will hit the issue.

0 Likes
ICY18
Level 2
Level 2
10 replies posted 5 replies posted First reply posted

**

0 Likes
User22281
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hello,

Thanks for the support. I cannot import  Infineon Code Examples because I get PKIX error. There is an unresolved thread opened for this issue:

https://community.infineon.com/t5/Other-Technologies-General/Getting-error-pkix-path-building-failed...

I am using ADS v1.5.0.

0 Likes
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Dear customer,

Actually Cpu0_Main.d will only include the same level header files, if I remove the my1.h to Libraries\myLib\, the .d file will not include my1.h as well.
However, after I add the PATH, my1.h will be included automatically. If I changed my1.h for 1 line, Cpu0_Main.c will be compiled incrementally, even though Cpu0_Main.d not include my1.h.
I used ADS1.5.4 to try, and the way to add PATH is below:

1, Properties of SPI_CPU_1_KIT_T375_LK
2, C/C++ build -> Settings -> TASKING C/C++ Compiler -> Include Paths
3, Add one line : "${ProjDirPath}/Libraries/myLib"

attached is screenshot for your reference.

dw_0-1643697275990.png

dw

0 Likes
User22281
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

If the header file is located in a different project (for example, in an Aurix Library Project), incremental build does not work (application sources are not rebuilt).

0 Likes
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Hi Customer,

If you have your own code or functions, you could copy them to your project/Libraries/yourLib/ and the header file inside will be included automatically if PATH is correctly set.

And this way is tested by last reply. 

"${ProjDirPath}/Libraries/myLib" 

0 Likes
User22281
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hello,

That is not a proper solution. The library project is precisely to avoid code duplication, and ADS should be able to handle the dependencies with library headers. If it does not, I would suggest to open a bug in ADS and provide a fix for next releases.

0 Likes
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Hi customer, 

The .d file will not include absolute path so far, if your header file is outside current project, the dependence will not included.  However, I will report to corresponding team for investigate. Before that, please workaround that, i.e. use a same project for main code and imported library.  Or, add a blank in the C file to trigger compilation.

Sorry for the inconvenience.

 

dw

0 Likes
User22281
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Thanks, I appreciate that. I will wait for future releases of ADS with (hopefully) the bug fixed.

0 Likes