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.

C2000 compiler options and object output file

Other Parts Discussed in Thread: TMS320C28346

I am developing rather complex embedded software for TMS320c28346. Managing different variants of this software has become difficult using CCS IDE and I have decided to compile these variants using makefiles. Managing makefiles by hand is laborious and I have had good experiences using CMake as front-end for generating makefiles.

CMake expects that the compiler supports defining object output files in the command line parameters. E.g. using standard GCC compiler, one would define output object file using -o flag:

gcc -c program.c -o release_objs/program_release.obj

I read the "SPRU514C" compiler manual and discovered that cl2000 compiler does not seem to support naming the output object file. Using --obj_directory and --obj_extension it is possible to place object files in specific directory and change its extension. However, output objects filename can not be changed.

Is the a way to specify compiler's output object filename and preferably also the path? I am trying to modify this piece of CMake compile directive:

# compile a C file into an object file
IF(NOT CMAKE_C_COMPILE_OBJECT)
  SET(CMAKE_C_COMPILE_OBJECT
    "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT>   -c <SOURCE>")
ENDIF(NOT CMAKE_C_COMPILE_OBJECT)

Best regards,
-Henrik

  • First off, I am unable to help you about your CMake issue.  However I am wondering whether you knew about Build Configurations in CCS.  It will allow you to modify which files you include for a build (and also the build settings) and save the configuration.  I have attached a screenshot showing one of my projects with a number of build configurations for different processors (basically I included the linker and header files for the certain processor in each build configuration).  I have forgotten exactly how to do it at the moment but I am just pointing it out if you were unable to find it originally.

     

    Thanks

     

    Tim

  • Chesterdam said:

    I am developing rather complex embedded software for TMS320c28346. Managing different variants of this software has become difficult using CCS IDE and I have decided to compile these variants using makefiles. Managing makefiles by hand is laborious and I have had good experiences using CMake as front-end for generating makefiles.

    CMake expects that the compiler supports defining object output files in the command line parameters. E.g. using standard GCC compiler, one would define output object file using -o flag:

    gcc -c program.c -o release_objs/program_release.obj

    I read the "SPRU514C" compiler manual and discovered that cl2000 compiler does not seem to support naming the output object file. Using --obj_directory and --obj_extension it is possible to place object files in specific directory and change its extension. However, output objects filename can not be changed.

    Is the a way to specify compiler's output object filename and preferably also the path? I am trying to modify this piece of CMake compile directive:

    # compile a C file into an object file
    IF(NOT CMAKE_C_COMPILE_OBJECT)
      SET(CMAKE_C_COMPILE_OBJECT
        "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT>   -c <SOURCE>")
    ENDIF(NOT CMAKE_C_COMPILE_OBJECT)

    Best regards,
    -Henrik

    Henrik,

    The output file can be named using: --output_file=name.out

    For example: cl2000 -v28 symtab.c file.c seek.asm find.sa --run_linker --library=lnk.cmd --library=rts2800.lib --output_file=myprogram.out

    The alias -o also works.  Please refer to section 4.2 of www.ti.com/lit/spru514.

    Regards,

    Lori

     

  • Thank you Tim and Lori for your fast responses.

    Tim,

    I am aware of these CCS build configurations. They might work in my case if I would organized my source code tree a bit differently. However, I would prefer makefiles since we have multiple developers and managing CCS project files is a bit cumbersome between different CCS versions. Also changing e.g. compiler optimization flag from -O1 to -O2 for one file will produce/change multiple lines in project files. This makes tracking of changes difficult and hard to understand.

    Also I would like to use automatic builds and tests for different variants using e.g. Hudson. Obviously Hudson build system can not command CCS IDE.

    Lori,

    Method you described invokes linker and uses --output_file= flag to name the final executable object file. My goal was to control naming and placing of the compiler's output object files (object files produced by the assembler in SPRU514 Figure 1-1. TMS320C28x Software Development Flow).

    Thanks,
    Henrik

     

     

  • Chesterdam said:

    Lori,

    Method you described invokes linker and uses --output_file= flag to name the final executable object file. My goal was to control naming and placing of the compiler's output object files (object files produced by the assembler in SPRU514 Figure 1-1. TMS320C28x Software Development Flow).

    Thanks,
    Henrik

    Hendrick,

    Ah I understand.  I don't think there is a way to change the name itself (just the directory and extension as you mentioned); but let me check with the compiler team.

    -Lori

     

  • Hendrick,

    The compiler team confirmed this:

    You are correct.  However, a future release (not sure which one) will add an option --output_file that can be used like gcc -o.

    Regards,

    Lori