In one of our product, we use R8C23 MCU. Renesas High-Performace Embedded Workshop and M16C Series, R8C Family C Compiler V.5.45 is used as the development tool. The executable file generated is .mot file.
Now we plan to use one base line of code to support multiple versions of hardware. Since the hardware differences are minor, I want to find a way to generate multiple .mot files (executable files), one for each version of hardware, when select Build->Build All using HEW development environment. Is it possible? If yes, how should I set "Renesas M16C Standard Toolchain"?
Basically, I can add some macro at the code, like:
/* do hardware_1 specific actions */
/* do hardware_2 specific actions */
/* do hardware_3 specific actions */
But I don't know how can I set up the HEW build environment to be able to build three executable files (e.g. hw_1.mot, hw_2.mot, hw_3.mot) upon above macros.
The way I have seen it done:
Create 3 build configurations (such as HW_1, HW_2 and HW_3).
Each configuration sets the appropriate define you mentioned above (HW_1 sets HARDWARE_1, etc.) in the BUILD "defines" window.
Each one should have a different output file name (hw_1.mot, hw_2.mot, hw_3.mot) in the Linker window.
During Debug, the user can select the configuration they are testing and build manually to debug.
To just build all 3 automatically, use a batch file with 6 commands
When you want to build all three, run the Batch file from the command window instead of clicking the build button (by the way if a long build you can go for a coffee at this point).
You can add other command like a CLEAN if you want to force an entire rebuild from scratch, BUILD_ALL instead of BUILD, etc..
Been a while since I did/saw this, but still should work. Hopfully I didn't miss anything in the description.
Hope this helps.
Just to add to kevinpkings reply. It's as he said :
One complication of this is that you then have to manually maintain all build configuration settings if any need changing. See http://renesasrulz.com/tools_and_support/high-performance_embedded_workshop_hew/f/49/t/3072.aspx.