This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Build counter

One can often see "build number" in about boxes of different applications for PC. Wouldn't it be nice if uVision had some sort of 'build counter'? It would help in tracing version numbers and show the amount of work spent for writing software.

Parents
  • We use a file called compileinfo.h which is 'touched' each time we compile for our release target.

    char *CompileTime = __TIME__;
    
    char *CompileDate = __DATE__;
    

    The target options/Output tab has the following setting to run the external program 'touch':

    touch "compileinfo.h"

    We use the 'touch' program supplied with the mingw tools.

    In our code we have the line:

      printf( "Compiled on %s at %s\n", CompileDate, CompileTime );
    

    which, when the program comes to life, prints the date and time that the program was compiled. Having the compileinfo.i as a separate file (i.e. not just touching the main source file) is necessary on our system to avoid CVS thinking that the main source file has been altered.

    I like Jon's method though, thanks for the script!

Reply
  • We use a file called compileinfo.h which is 'touched' each time we compile for our release target.

    char *CompileTime = __TIME__;
    
    char *CompileDate = __DATE__;
    

    The target options/Output tab has the following setting to run the external program 'touch':

    touch "compileinfo.h"

    We use the 'touch' program supplied with the mingw tools.

    In our code we have the line:

      printf( "Compiled on %s at %s\n", CompileDate, CompileTime );
    

    which, when the program comes to life, prints the date and time that the program was compiled. Having the compileinfo.i as a separate file (i.e. not just touching the main source file) is necessary on our system to avoid CVS thinking that the main source file has been altered.

    I like Jon's method though, thanks for the script!

Children
  • Rather than adding an external 'touch' command, could you not just set the 'Always Build' option for this file in this Target?

    I do this with a timestamp.c in every Target of every project - I haven't tried it with just one Target of a project.

    Is there any particular reason to restrict it to just one Target of a project, though?