Is it possible to have the version number of a compile auto increment and be a part of the code to be retrieved at run time? Thanks
Im not sure if I follow how the #define BUILD_NUMBER would change for each build. The increment program was created once years ago and used for multiple projects. No need to change it, as long as you have the string "BUILD_NUMBER" somewhere in the referenced file (in my case, 'version.h'). There is no recompiling of the DOS program. I agree though that the string to modify should actually be passed though the command line, but for me, I have found that it is always the same string anyway! Im always open to a better version!
I described by timestamp.c approach in this thread (it's near the end): http://www.keil.com/forum/docs/thread2789.asp
Im not sure if I follow how the #define BUILD_NUMBER would change for each build. Use the compiler command line option to define the value of BUILD_NUMBER. Instead of
file.c: // edit xxx to build number for each release #define BUILD_NUMBER xxx ... printf ("Build: %u\n", BUILD_NUMBER); Make: build_number_patch file.c 123 c51 file.c
file.c: // no #define in this file printf ("Build: %u\n", BUILD_NUMBER); Make: c51 DEFINE (BUILD_NUMBER=$BUILD) file.c