Hi there! In a few weeks, I might have to derive a product from another products. The hardware is the same, but the software is slightly different. I think, it would be a drag to copy the sources to another directory and and take care of two code versions. So it would be nice to know, which project it is while compilation time, so that I could use some #ifdef statement to get conditional compilation. Other than that, I just had the idea to have a "higher source level files that define a compiler constant and then include the low level source files. Like:
"highlevel.c" #define OEM #include "lowlevel.c" "lowlevel.c" #ifdef OEM #include ... #else #include ... #endif // some common source #ifdef OEM // OEM source only #else // non OEM source #endif // some common source
"If you use uVision2, you can create a target for each program." The trouble with that is that each target is completely independent - so if you want to make a chage which needs to go into every taget, you have to change each target individually :-( What uVision needs is an extra level in the hierarchy, where you can specify "global" options common to all targets - in addition to the existing target-specific, group-specific and file-specific options.
The trouble with that is that each target is completely independent - so if you want to make a chage which needs to go into every taget, you have to change each target individually :-( Huh? We must be talking about different stuff. I have several projects with multiple targets that I make global changes to (ie. changes that affect every target). You must be talking about something different. Jon
"...projects with multiple targets that I make global changes to (ie. changes that affect every target)." How? I have uVision v2.23. Only one target is ever visible in the Project window at any one time - it is at the "root" of the displayed structure. If I make a change at this "root" level (ie, at the Target level), it will only affect the currently-displayed Target; if I want to make the same change in a different Target, I must change to that Target and then make the same change again "You must be talking about something different." This is quite possible!