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: CCS variables and environment



Tool/software: Code Composer Studio

Hi,

Can you please explain the difference and usage of CCS variables:

under C/C++ Build option in project setting there are two tabs - Build Variables and Environment - what exactly is the difference between them (i.e. when defining a new one on which TAB should i place it,...) also under resource -> linked resources there is another place where variables can be defined ???

How can i see the full expansion of a variable - if it is defined using another one and/or when it says <ECLIPSE DYNAMIC VARIABLE> (what does this mean and how to see to what it evaluates?)

When i set variables under the Environment option , it turns out that if windows already have such an environment variable - the value i placed in CCS is appended to the windows one - which is not always desired. i tried choosing the radio-button for "Replace native environment with specified one" but after doing this it causes lots of problems - 

I am building the project using external makefile (i use external builder and call gmake from the build command) and after setting the option to "replace native..." i get errors:

06:50:37 **** Incremental Build of configuration Default for project EVE ****
"gmake" TARGET_BUILD=release
process_begin: CreateProcess(make10448-1.bat, make10448-1.bat, ...) failed.
process_begin: CreateProcess(make10448-2.bat, make10448-2.bat, ...) failed.
make (e=267): The directory name is invalid.

gmake: *** [all] Error 267

when returning it to append variables option everything is OK but again when opening the project on another computer that may have a same name environment variable - the values are concatenated and this causes errors - can you please explain the error when choosing "replace .." option and how to make CCS not append variables with windows one?

another question - as mentioned i am using external builder and call gmake. gmake is not actually on the path so from CCS on the build command i give it the full path to gmake. my makefiles are calling other makefiles for within them the theses called makefile also call gmake with not path specified - how does the gmake location gets transferred to the internal makefiles (how does it finds gmake?) - is there a way i can print from within the makefile where does it takes/finds the gmake program it executes? (when i tried to call the where gmake from the makefile it says there is no such file - so it does not look like it is not on the path so how can i find out where does it finds it)

Thanks

Guy

  • Hi Guy,

    Guy Mardiks said:

    Can you please explain the difference and usage of CCS variables:

    under C/C++ Build option in project setting there are two tabs - Build Variables and Environment - what exactly is the difference between them (i.e. when defining a new one on which TAB should i place it,...)

    This thread has a good explanation:

    https://www.eclipse.org/forums/index.php/t/206008/

    Guy Mardiks said:
    also under resource -> linked resources there is another place where variables can be defined ???

    Those variables are 'Path Variables' that is used only for linked resources

    Guy Mardiks said:
    How can i see the full expansion of a variable - if it is defined using another one and/or when it says <ECLIPSE DYNAMIC VARIABLE> (what does this mean and how to see to what it evaluates?)

    For build variables, there is not a clean way to easily see the full expansion in the dialog. If it relies on another build variable, I look for that variable in the list first to do my own expansion.

    Note that the ECLIPSE DYNAMIC VARIABLE is a represents a special kind of eclipse variable that differs from standard build variables. These variables get expanded last during build time. Hence you will not be able to see what that variable expands to for a particular build variable until when you build. Hence the dialog simply shows '<ECLIPSE DYNAMIC VARIABLE>' as a place holder.

    Guy Mardiks said:
    When i set variables under the Environment option , it turns out that if windows already have such an environment variable - the value i placed in CCS is appended to the windows one - which is not always desired.

    Yes I generally recommend using Eclipse CDT build variables and path variables. There are very specific cases where you would want to muck around with the environment variables

    Guy Mardiks said:

    I am building the project using external makefile (i use external builder and call gmake from the build command) and after setting the option to "replace native..." i get errors:

    06:50:37 **** Incremental Build of configuration Default for project EVE ****
    "gmake" TARGET_BUILD=release
    process_begin: CreateProcess(make10448-1.bat, make10448-1.bat, ...) failed.
    process_begin: CreateProcess(make10448-2.bat, make10448-2.bat, ...) failed.
    make (e=267): The directory name is invalid.

    gmake: *** [all] Error 267

    when returning it to append variables option everything is OK but again when opening the project on another computer that may have a same name environment variable - the values are concatenated and this causes errors - can you please explain the error when choosing "replace .." option and how to make CCS not append variables with windows one?

    I believe by choosing the "replace" option, not only would you completely replace the value of existing variables, you would also blow away any other variables not defined in the properties dialog. Basically you completely replace the existing list of variables with the the just ones in the dialog. Looks like by doing that, some required variables normally defined are not defined anymore during build, causing the error.

    I'll need to confirm the above behavior.

    Guy Mardiks said:
    another question - as mentioned i am using external builder and call gmake. gmake is not actually on the path so from CCS on the build command i give it the full path to gmake. my makefiles are calling other makefiles for within them the theses called makefile also call gmake with not path specified - how does the gmake location gets transferred to the internal makefiles (how does it finds gmake?)

    You've likely noticed that CCS comes with gmake in <CCS INSTALL DIR>\ccs7\utils\bin. The builder calls gmake using the buildin ${CCS_UTILS_DIR} variable which expands to <CCS INSTALL DIR>\ccs7\utils. If the path to gmake is not explicitly specified, then it will check the system path for location of gmake. Note that gmake comes with other SW packages form TI. For example, I found one in my xdctools. When you run 'where gmake' in a DOS console, it does not find it? If that is the case, then the calls to gmake without the path prepended should fail

    ki

  • Hi Ki-Soo Lee.

    Thanks for your answers.

    If what you assume that by choosing replace in the environment variables it indeed also "removes" any variable that is not specifically defined in eclipse then it sounds like an actual bug as i don't believe this was the intended purpose - could it be a bug in the CCS (and not in general ECLIPSE) - if so is there a way to bypass it?

    can you suggest a way to defined environment variables in CCS (which i must since i need them to be seen and used by the makefiles ) while on the same time if there was such a variable defined in the OS environment not to concatenate by take the one CCS defined (what i assume the radio button supposed to do - is there a way to somehow manually make this happen?)

    as for gmake - i still dont really understand how the makefile which calls gmake itself (recursive gmake call) find gmake - from eclipse i first call gmake with an explicit path to my gmake location (which is not eclipse's default) also when i print from the makefile "where gmake" it does not find it as it is not on the path. i also printed the version of gmake the makefile uses and it consistent my the gmake i pointed to and not with eclipses's default (even though i cannot be sure it actually is the same location of  the initial run as i have several installation). i tried searching in the make docs but could not find any reasonable explanation. i saw that it is suggested in recursive makes to use the variable $MAKE which is defined automatically to the original called make utility but in the make file i have they use specific call to gmake and still some how seems to be able to find it. is there a way in makefile to print the location of the program (gmake) the maekefile uses ? 

    Thanks

    Guy