To extend @ sashang's answer, avoiding the "$ Id: $" issues mentioned by @ cdunn2001, ...
You can add the file "version_info.h" to your project, which only has:
#define VERSION_MAJOR "1" #define VERSION_MINOR "0" #define VERSION_PATCH "0" #define VERSION_BUILD "0"
And in your main.c file there is a line:
static char version[] = VERSION_MAJOR "." VERSION_MINOR "." VERSION_PATCH "." VERSION_BUILD; static char timestamp[] = __DATE__ " " __TIME__;
(or, nevertheless, you want to use these values ββin your program)
Then configure the pre-build step, which reads the version_info.h file, issues the numbers accordingly and writes it again. A daily build would simply increase the number of VERSION_BUILD, while a more serious release would affect other numbers.
If your make file lists this in the list of necessary objects, then the assembly will recompile what it needs.
Jesse chisholm
source share