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.

CCS dynamic variables (in particular the base of the current source file)

I've been trying to find an definition of the various dynamic variables maintained by CCS. The best I have found is a TI document of building portable projects (https://software-dl.ti.com/ccs/esd/documents/ccs_portable-projects.html), but this just refers you to the System variables within CCS, which doesn't provide a lot of details as to what the various dynamic variables provide.

The specific issue I have is accessing the base or root name of the current source (or object) file being processed. The build is generating a set of objects for insertion in a static library, and I want to be able to capture some assembly details as it processes each source file, ideally under the root name of the source being processed. For instance, if its processing test.c to produce test.o, I want to be able to capture the "test" to generate something like test.s. The output base is available under BuildArtifactFileBaseName but this only gives me the base for the target library, not the components that go to produce it. I can see what I am after at the make level (basename), but have been trying to avoid touching the generated make tree.

Interestingly, the default build command  generated within CCS is of the form "${command} ${flags} ${output_flag}${output} ${inputs}", and none of these are even listed in the System Variables (although "command" is defined in the build pane as "${CG_TOOL_GCC}" -c which is resolvable back to system variables).

Failing this, are these dynamic variables documented anywhere, either as part of CCS or Eclipse.

Thanks - ANdrew

  • root name of the current source (or object) file being processed.

    I don't think CCS (Eclipse) knows anything about which file is being processed in a temporal sense. Only the external compiler (e.g. cl2000.exe) knows which file is being processed at any particular time so I think it's unlikely that an CCS variable exists for your purposes.

  • But the external compiler has no knowledge of what files should be processed.... it needs to be told somehow. 

  • Of course, via the {inputs} argument to the builder.

    I'm just trying to answer your request for "the base or root name of the current source (or object) file being processed".

    You could try parsing the console log file for lines beginning "Building file:"

  • The build is generating a set of objects for insertion in a static library, and I want to be able to capture some assembly details as it processes each source file, ideally under the root name of the source being processed. For instance, if its processing test.c to produce test.o, I want to be able to capture the "test" to generate something like test.s

    Are you just looking to capture the intermediate generated assembly file for a source file after it has been compiled?

  • Thanks all. I've just had to have a bit of a make refresher to understand how this was working. 

    As part of the makefile generation, CCS generates a subdir_sources.mk, which includes all the sources that need to be compiled and inserted into the library (for a static library project). This is then available to the makefile to do the actual processing. So you are quite right, while CCS may be aware of what needs to be built, it is disconnected from the specific processing when each source is being built.

    But, the expansion symbolic references used by CCS (of the form ${symbol}) are different to the variable expansion used by make (of the form $(variable)). So while CCS may swallow symbol expansion of symbols it knows nothing about (for instance ${xxx}), it is happy to pass make variable expansion requests (such as $(xxx)) through to make for it to sort out.

    So by adding something of the form "-Wa,-ahln=$(*F).s, -fverbose-asm" to the miscellaneous compiler flags in CCS, the $(*F) is passed through intact to make, which replaces this with <source_root_name>.s, which is exactly what I am after.