[Icc-mot] Build/Link time

Dean Bell dean.bell at flightec.com
Mon May 28 15:04:30 PDT 2007


I did ask Richard some time ago for an "Execute command before build" option
for V7 to do the .h file modifications similar to what Edward was doing with
his autoexec.bat file, but Richards comment was that I was the only one who
has requested this future. So are there more people who would like this
future?

There are three other compiler options I would like to see __BULID__,
__NOW__ and a build history file "projectname.hst" with tick box activation.



Macro __BULID__ returns an unsigned integer of the current project's
successful build count. For a new project this counter would start at 1 and
is found in the "projectname.prj" file.


Macro __NOW__ (4 bytes) returns an unsigned long of the build date & time in
seconds with an epoch of 1/1/1970 (like UNIX) it is good for 136 years
(1/1/2106). This is an alternant to using the strings __DATE__ (12 bytes),
__TIME__ (9 bytes), handy for small micro and doing logical checks:-
if( new_time > __NOW__ ){DoSomeThing( &new_time );}.


Build history is a file that contains the warnings and errors that appear in
the IDE status window with the current build count EG:- 

!W C:\iccv712\Icc-mot\BuildAndLink\DateAndTime.c(19):[warning] parameter
`pointer to char txt' is not referenced
!W C:\iccv712\Icc-mot\BuildAndLink\DateAndTime.c(19):[warning] parameter
`char prt' is not referenced
!W C:\iccv712\Icc-mot\BuildAndLink\DateAndTime.c(22):[warning] parameter
`pointer to char txt' is not referenced
!W C:\iccv712\Icc-mot\BuildAndLink\DateAndTime.c(22):[warning] parameter
`char prt' is not referenced
Device 0% full.
Build 1, Done. Mon May 28 10:23:52 2007

!W C:\iccv712\Icc-mot\BuildAndLink\DateAndTime.c(19):[warning] parameter
`pointer to char txt' is not referenced
!W C:\iccv712\Icc-mot\BuildAndLink\DateAndTime.c(19):[warning] parameter
`char prt' is not referenced
!W C:\iccv712\Icc-mot\BuildAndLink\DateAndTime.c(22):[warning] parameter
`pointer to char txt' is not referenced
!W C:\iccv712\Icc-mot\BuildAndLink\DateAndTime.c(22):[warning] parameter
`char prt' is not referenced
!E C:\iccv712\Icc-mot\BuildAndLink\BuildAndLinkMain.c(8): undeclared
identifier `x'
!W C:\iccv712\Icc-mot\BuildAndLink\BuildAndLinkMain.c(9):[warning]
expression with no effect elided
!E C:\iccv712\Icc-mot\BuildAndLink\BuildAndLinkMain.c(9): syntax error;
found `}' expecting `;'
Build 2, Done: there are error(s). Exit code: 1. Mon May 28 10:27:34 2007

!W DateAndTime.c(19):[warning] parameter `pointer to char txt' is not
referenced
Device 0% full.
Build 2, Done. Mon May 28 10:30:31 2007

Device 0% full.
Build 3, Done. Mon May 28 10:33:04 2007


It would be advantages to have additional information in the
"projectname.mp" file showing the last modification date/time & size of the
source files (.c .s .a) EG:-

       8032  _GetCompileDateAndTime
       8085  _main
       8086  __HC12Setup
       808B  __text_end

Files Linked, Build 3      [ module(s) ]

C:\iccv712\lib\crt12.o	[ crt12.s, ?, ?, ? ]
DateAndTime.o      [ DateAndTime.c, 28 May 2007, 09:56:11, 811 bytes ]
BuildAndLinkMain.o [ BuildAndLinkMain.c, 28 May 2007, 10:03:24, 33 bytes ]
<library>	[ setup.s, ?, ?, ? ]

User Global Definitions

init_sp = 0x1000

User Base Address Definitions

text = 0x8000
data = 0x800


I think the key thing we are all trying to achieve here is tractability
(object to source) what ever method we use.

Any comments?

Dean.

-----Original Message-----
From: icc-mot-bounces at imagecraft.com [mailto:icc-mot-bounces at imagecraft.com]
On Behalf Of Barry Callahan
Sent: Saturday, 26 May 2007 09:11
To: Discussion List for ICC08/11/12/16 users. You do NOT need to subscribe
to icc-announce if you are a member of this.
Subject: [Icc-mot] Build/Link time

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