cont'd...
One of the advantages of the IDE is that it keeps track of all the files, etc, so you don't have to worry about maintaining makefiles, etc (which I really don't want to have to do just because I simply just want to pass a variable to the compiler).
One workaround is to create a batch file that saves the variable to a *.c file then call the CmdIDE.exe that contains that *.c file within the project. It works, but I don't really like this method. I would just rather pass the variable as a compiler argument. Can anyone help?
Here is a sample batch file as described above <mybatch.bat>:
//------------------------------------------
@echo off
rem The [%1] argument gives the path & filename for the file you want to define the variable in (e.g. "C\myfile.c")
rem The [%2] is your intended value of the variable
rem Also, this batch file assumes that <myfile.h> contains: extern const unsigned int myvariable;
rem Example: mybatch.bat "c:\test directory\myfile.c" 4
if exist %1 del %1
echo #include "myfile.h" >> %1
echo const unsigned int myvariable %2 >> %1
<COMPILER_PATH>CmdIDE.exe /f n /b /c /q <PROJECT_PATH>my_project.mcp
//------------------------------------------------