I just wanted to know if there is a way to make a condition inside .prm file, such as #ifdef or something like that.
The idea is to merge a project with the bootloader, using the HEXFILE sentence, and the conditional would be used to compile with or without it
Best regards!
Solved! Go to Solution.
Hello,
the answer depends if your are using the classic CodeWarrior or the eclipse one.
In classic you find that option in the linker preference panel as "Preprocess PRM file".
Extract from the manual:
Preprocess PRM file: When checked, the preprocessor of the ANSI-C compiler is
used to preprocess the PRM file prior to the linking step. In the PRM file, all ANSI-
preprocessor conditions like conditional inclusion (#if) are available. The same
preprocessor macros as in ANSI-C code can be used (e.g., #ifdef __SMALL__).
BK
Hello,
the answer depends if your are using the classic CodeWarrior or the eclipse one.
In classic you find that option in the linker preference panel as "Preprocess PRM file".
Extract from the manual:
Preprocess PRM file: When checked, the preprocessor of the ANSI-C compiler is
used to preprocess the PRM file prior to the linking step. In the PRM file, all ANSI-
preprocessor conditions like conditional inclusion (#if) are available. The same
preprocessor macros as in ANSI-C code can be used (e.g., #ifdef __SMALL__).
BK
Hello BlacKnight,
I encountered the following problem, maybe you can help me.
I set the "Preprocess PRM file" option as you said (btw without this option and without conditionals in the prm file, I get no errors during make).
I use the MemoryBanker tool which is generating a .pre.prm file. All the errors that I get are located inside this file and are linked to each "#pragma" instruction. Even without any conditionals in the .prm file I get those errors when the "Preprocess PRM file" option is set. You will find more information in the attachments...
Thank you for your time.
Allem77.
Hi Allem77!
I've never used #pragma's in prm pre-processesing. Looking at your warning and error image, I can suggest two things:
1) "Preprocessor failure because of not supported preprocessor directive", perhaps pragma is not suported
2) "Preprocessor failure because of Expected # at line start", maybe you should erase indet and put the #pragma at the begining of the line (column 0)
Hi Sebastian,
thank you for the hints.
Actually the #pragma's are coming from the MemoryBanker tool when it is optimizing the location of the different functions in the banks. So I don't have any control about the generation of those #pragma's.
It seems that the MemoryBanker tool is not compatible with the .prm perprocessing possibility... hmmm
Hi BlackNight, thanks for you inmediate response!
I forgot to specify that, II'm using CW v3.1; so yes, it's the classic one.
But I don't have that option
In CW 4.6 is there, but no in CW 3.1.... Is there anything I can do under CW 3.1? Update linker or use linker from CW 4.6?
Hello,
this option is a feature of the IDE, so you would need to upgrade to that IDE/CW version.
But if you want to use the build tools from 3.1, then technically this should be possible: use the prog and lib folders from 3.1 inside the 4.6 IDE.
BK
Thanks again!
I've migrated my proect from CW 3.1 to 4.6 so I can compile with v4.6