[Icc-mot] Build/Link time

John Baraclough j_baraclough at zetnet.co.uk
Sat May 26 10:24:34 PDT 2007


Hi Barry,

Just put the __DATE__ & __TIME__ macros into a very small file as 
below then delete the '.o' file after every build.

HTH

John

/* ************************************************************************ *\
   File: DateAndTime.c

   Purpose: Creates a string containing the compilation date & time.

   Revisions:
   1.00 JNB 2006-10-18

   Notes: The intermediate file 'DateAndTime.o' is deleted after every
          compilation, so that it is recompiled each time with the new date
          and time.

\* ************************************************************************ */

#include <includes.h>

void GetCompileDateAndTime(void)
{
   cstrcpy(MessageOut, "Build - ");
   cstrcat(MessageOut, __DATE__);
   cstrcat(MessageOut, " \100 ");
   cstrcat(MessageOut, __TIME__);
}






At 22:10 25/05/2007, you wrote:
>I want to keep a string that indicates the date and time that the 
>firmware was built.
>
>Right now, I'm building a string with __DATE__ and __TIME__
>
>Problem is, those are evaluated by the preprocessor at compile time. 
>If I modify a file which doesn't reference those macros and forget 
>to do a "rebuild all", the version string doesn't get updated.
>
>In ICC12 (both v6 and v7) there's a text field under the "Compiler" 
>tab of the "Compiler Options" dialog labeled "Execute Command After 
>Successful Build:"
>
>Right now, I'm using this field to touch (update the modification 
>time) on the file which builds the timestamp. That way, (assuming 
>the build completed successfully) the next time I rebuild, that file 
>will be guaranteed to recompile, regardless of whether I edit it or not.
>
>Ideally, I'd touch this file *before* building so I know that the 
>string always accurately reflects the date and time of when the 
>program was built, regardless of whether the previous compile was 
>clean or not..
>
>
>Any suggestions?
>Thanks.
>
>Barry
>
>_______________________________________________
>Icc-mot mailing list
>Icc-mot at imagecraft.com
>http://dragonsgate.net/mailman/listinfo/icc-mot
>




More information about the Icc-mot mailing list