This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMS320F28388D: Out of date dependency file causing build failure when the compilation and build is done outside CCS

Part Number: TMS320F28388D

Tool/software: TI C/C++ Compiler

Hi,

I am building the executable outside Code Composer Studio. I am trying to use the dependency option (preproc_dependency) of compiler to build the executable. 

The dependency file generated is of the format as below

file_name.obj: file_name.c

file_name: obj: file_name.h

The dependency file once created will not be regenerated unless the make command is re-triggered. This may cause the dependency file to become outdated and resulting in build failure. For example if the file_name.c is modified and the file_name.h inclusion is removed and deleted from the folder, the dependency file is not regenerated and the obj file creation fails as the file_name.h does not exist.

The solution to this problem is to generate the dependency file in the following format (Auto-dependency) as explained in the link http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/ inside 

file_name.obj file_name.d: file_name.c

file_name: obj file_name.d: file_name.h

In this approach, along with obj, the dependency files are also dependent on source file and header file. This ensures if there are any updates in source file or header file the dependency file will be recreated and does not solely depend on the rule in makefile. Hence dependency file will never get outdated. 

Is there any way to generate the auto-dependency  as explained above using the flags from TI CGT?

TI CGT version 18.12.2 LTS

TI CCS version 9.1.0

Thanks,

Aditya

  • Aditya Padmanabha said:
    Is there any way to generate the auto-dependency  as explained above using the flags from TI CGT?

    Unfortunately, no.

    I looked into whether the GCC compiler offers a solution.  It does not have a solution exactly as you describe, but something similar.  Here is the documentation ...

    -MP This option instructs CPP to add a phony target for each dependency other
        than the main file, causing each to depend on nothing. These dummy rules
        work around errors make gives if you remove header files without updating the
       ‘Makefile’ to match.
    
    This is typical output:
    
    test.o: test.c test.h
    test.h:
    

    If the TI compiler implemented this -MP option, would that solve your problem?

    Thanks and regards,

    -George

  • Hi George,

    I tired this method as well. It works and recreates the dependency files when the test.h file no longer exists. Yes please provide the option similar to -MP.

    Can you create a request to do the same?

    Thanks,

    Aditya

  • Hi George,

    Did you create request for the option creation similar to -MP flag in TI CGT?

    Thanks,

    Aditya

  • I apologize for the delay.

    I filed the entry EXT_EP-9925 to request this capability be added to the C2000 compiler.  You are welcome to follow it with the link below in my signature.

    Thanks and regards,

    -George

  • Unfortunately, the request was declined.  At this time, there is not enough customer interest in this capability.

    Thanks and regards,

    -George

  • Hi George,

    Its not good that this capability will not get implemented. Any workarounds I can do to solve the issue in this case?

    Thanks,

    Aditya

  • Unfortunately, there is no feature of the TI compiler which could be used as a workaround.

    One idea to consider ... Write a (pick one: perl, python, awk, sed, etc.) script which modifies the auto-generated dependency file created by the compiler.  You could run it as a post-build step in CCS.

    Thanks and regards,

    -George

  • Hi George,

    Yes we can do that workaround but that's little messy (and not a proper solution as well!!) and I wanted to avoid doing that. Anyway since -MP option will not be provided we will look at work the workarounds.

    Thanks,

    Aditya