[Icc-mot] Build/Link time

Barry Callahan barryc at rjlsystems.com
Fri May 25 14:10:55 PDT 2007


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



More information about the Icc-mot mailing list