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.

command line compile with macro define

I have a working MSP430Gxxxx CCSv5 project built with Grace with 18 variations defined by a #define macro.  I'm looking for the command line syntax to support changes to the macros and define specific output file names?

If I had a  standard GNU make project, I could create a batch file that would cycle through all the various modifications needed, something like the following:

make -D TIME_RANGE=1 -o myBuild_Range1.out 

I'm not sure if its the Grace addition or just an added complication with CCSv5 but I cannot find a working example of the syntax to use to issue this from a command line.

 Can anyone provide additional advice or suggestions?

  • Hi,

    If I understood your problem correctly, did you try to use different Build Configurations (menu Project --> Build Configurations --> Manage)? I usually create several Build Configurations for each device or device family in a single project, and you can set several project build options for each one (including the -D, the name of the output file, add or exclude files from building, etc.)

    That will also help you if you are trying to build from the command line, as you can always set the -ccs.configuration property appropriately. Check this link for details.

    Hope this helps,

    Rafael

  • Hi Rafael

    I like the suggestion, but I am not sure how this  would work in creating all projects.  The only way I could see this to work would be to create multiple projects in my work space that all share the same files?  The only change between each project will be a project name and a compile macro specific to that project.  All files should be shared.

    I attempted this but it seems that CCSv5 makes a copy of all files and I don't want a copy, I want them to be shared so if I make any changes they will be consistent to all projects.

    Any easy suggestion on how to get up to 18 projects to all share the same source  files?

  • Hi,

    My suggestion does not require you to create multiple projects. Please check the project attached which has the same set of source files but four build configurations for different CortexA devices. 

    In case you prefer to have multiple projects (one per device), you can leave your source files in a common location and simply link (not add) the files to each project. The ideal solution would make the project portable, according to the following page:

    http://processors.wiki.ti.com/index.php/Portable_Projects

    Hope this helps,

    Rafael

    CIO_test_CortexA.zip