I am working on an IAR C project that builds hex files for more than one similar products.
Some of the products use the ATmega48V and some other use the ATmega88V, because of it's larger memories. I mean that some functions don't used by some products, so they excluded by the compiler instructions (#ifdef, #ifndef e.t.c.)
So each time I have to build a file for product uses the ATmega48:
1. I have to sellect the product name:
#define product1 //#define product2 //#define product3 //#define product4 //#define product5
2. I have to change the type of the microcontroller at general options/target
3. I have to change the .xcl file, at linker/config.
Is there any other way to do this automatically. I don't want to split my project, in order to have one for the ATmega48V products and one for the ATmega88V, because each time I update the code I want to update all products.
Thanks for your time,