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.

Is it possible changing .out File name depending on a certain compile option in 1 project?

I want to make 2 different .out files depending on the compile option(ex #define)

I have 1 ccs project for 2 different products.

So every time I want to make a certain .out file between 2, I change #define option in my source code,

And when I get .out File, I should change it's name manually.

But I want to make this process automatic.

Is it possible Changing .out file name using Compile option or something in the SOURCE CODE LEVEL?

 

So Is there any solution for this issue?

I use CCS 5.1 with the Compiler Version 6.2.11.

Thanks for your comments

  • I submitted an answer to a similar question at e2e.ti.com/.../1889627

    The out file name is specified using the linker --output_file option (see Basic Options in project properties, i.e. C2000 Linker->Basic Options).

    You might be able to write a program that reads your header file and sets the flag (i.e. --outputfile) in the project file (i.e. .cproject).
    Some issues with doing it this way:
    1. It's complicated. You could corrupt the file or the file format could should change in the future.
    2. You might not be able to write to the cproject file when CCS is running.

    Stephen
  • Hi Yoo,

    It will be better to keep the project output consistent. My suggestion is to create two build configurations for your project. For example, by default there are already "Debug" and "Release" build configurations. You can define different "#define" in project options for each configuration. Then, you can build them and get output files placed in different subdirectories.

    There is another benefit of this method. All the immediate object files are reserved for each build configuration. The time to switch and make the other configuration is very short since there is no need to rebuild all source files.
  • Thanks, I tested your method and it works very well.
    and as you said, It is faster than before!

    This Is a additional question.
    I tested predefined symbols, and I couldn't have find the way to define specific value to a symbol
    For example, I defined A_MODE_ON, and also I UNDEFINED B_MODE_ON.
    But is it possible to pre-define some symbol with value? like #define MODE ('A').

    Best Regards,
  • Thanks,
    At first, I tried programming a batch file to reach my goal.
    But I realized it is so complicated.
    So, I decided to use predefined symbols.

    Best Regards,
  • The post that I had previously mentioned (

    https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/519853/1889627#1889627

    .) had already mentioned to use build configurations with predefined symbols.  I should have mentioned that in my post.

  • Sure, you can pre-define symbols with value. Just use NAME=VALUE in project options.