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
", it would be a drag to copy the sources to another directory" There is no need to copy the files - uVision doesn't rely on source files being in the same folder as the Project. You can simply enter the path (which can be relative) when you add the file to the Project.
"There is no need to copy the files. You can simply enter the path (which can be relative) when you add the file to the Project" Yes, and no - if you have a version identifier in the path, it is a lot easier to copy *.c, *.h and *.a51 to a workfile than it is to change all path statements. Erik