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.

Method for text file to force xdc rebuild

Hello,

I have a handful of XDC modules which reference text files as configuration parameters. These text files are read in to produce various lookup tables. Is there a method to force a rebuild if one of these referenced files is modified?

ex:

ModA

{

    config string CsvLookupFile = "table.txt";

    blah.. blah.. blah...

}

other than manually cleaning, if table.txt changes, is there a method which can that force a rebuild (re-run of the configuration process) "automatically"?

Thanks!

  • I don't know it this is a recommended way, you can get a better answer in the CCS forum, but what works for me is to edit makefile.defs, which is located in the top project directory, and to add:
    ./configPkg/linker.cmd: ../table.txt

    assuming table.txt is also located in the top project directory. The file linker.cmd is one of the files generated from the CFG script, so this dependency will force evaluation of the CFG script.

  • I'm not using CCS to build any of my code. And I ran a find on my project directories and I did not see a makefile.defs.

  • How do you build?
    If you are using package.bld files, then you can use Pkg.makeEpilogue or Pkg.makePrologue to add content to the generated makefiles.

  • I build with python scripts which manually build all the repositories and binaries using the xdc command. I'll give Pkg.makeEpilogue or Pkg.makePrologue a try.

  • It looks like those calls can only be made in package.bld files. In which case it does not seem like I can reference modA.CsvLookupFile. Which implies that when the config for the filename changes the package.bld file needs to change too?

  • So, how are these filename parameters configured, and which part of the build you want to make conditional?
    Here is how the build work, broadly speaking:
    1. package.bld is processed and out of that come all makefiles
    2. config step runs
    3. app compile and link

    You can add rules to make files, or add whole new makefiles only in 1. If you need to run 2. to find out which files you want to depend on, then it's too late to change makefiles. Even if it weren't, you would be only able to make 3. conditional, but I don't think that's what you are trying to do.
    Can you explain more?

  • The file name parameters are configured in the applications cfg file.


    The file name get's specified in step 2. If that file has changed, force step 2 and 3 to re-run. It sounds like that may not be possible.


    It is inside the module (who references said file by name) static init(s) that the file gets read, and lookup tables get generated.

    maybe I just have to force a clean of the executable on every build to ensure that step 2 gets run every time, regardless of if the referenced file changed or not.