Reply by Ian Okey January 8, 20082008-01-08
I tried deleting the object file as the last part of the build but
this caused problems with the debugger. When I tried to start a
debugging session it would build the code and then, when the debugger
started it gave me an error saying that the object file was missing.
I had to remove the file delete any time that I was using the
debugger.

I raised this as a problem with IAR (Anders the reference was CALL
84256_IAR) at version 3.21 and 3.30.

Ian

On 07/01/2008, Bill Knight wrote:
> Erik
> I'm not familiar with IAR's 'make' functionality but can you make
> 'version.o' dependent upon ALL other .o's? That way if any other .o is
> newer than 'version.o', it will be rebuilt from (an unmodified) 'version.c'.
>
> Regards
> -Bill Knight
> R O SoftWare
>
> PS - IIRC for IAR, the .o files might be .r43 files
> erikshreve wrote:
> > Is there any way to force a c source file to be compiled every time
> > in IAR? I have a C file (version.c) that defines variables for the
> > build time and date using __TIME__ and __DATE__. I want this file re-
> > compiled every time a "make" command is performed and other files
> > are compiled.
> >
> > I am aware that I can do a "Rebuild all", but this is not what I
> > want. I want my version.c file to be compiled _if_ other files in
> > the project need to be compiled.
> >
> > I've tried the pre-build command, but it runs after the build tree
> > has been created, thus it can't impact the build tree. Also,
> > iarbuild.exe doesn't seem to have an option to cause a single file
> > to be compiled.
> >
> > I don't want to play around with modified dates because that throws
> > off our version control system.
> >
> > Any other ideas?
> >
> > Thanks,
> > Erik

Beginning Microcontrollers with the MSP430

Reply by erikshreve January 8, 20082008-01-08
--- In m..., Bill Knight wrote:
>
> Erik
> I'm not familiar with IAR's 'make' functionality but can you
make
> 'version.o' dependent upon ALL other .o's? That way if any
other .o is
> newer than 'version.o', it will be rebuilt from (an
unmodified) 'version.c'.
>
> Regards
> -Bill Knight
> R O SoftWare
>
> PS - IIRC for IAR, the .o files might be .r43 files
> erikshreve wrote:
> > Is there any way to force a c source file to be compiled every
time
> > in IAR? I have a C file (version.c) that defines variables for
the
> > build time and date using __TIME__ and __DATE__. I want this
file re-
> > compiled every time a "make" command is performed and other
files
> > are compiled.
> >
> > I am aware that I can do a "Rebuild all", but this is not what I
> > want. I want my version.c file to be compiled _if_ other files
in
> > the project need to be compiled.
> >
> > I've tried the pre-build command, but it runs after the build
tree
> > has been created, thus it can't impact the build tree. Also,
> > iarbuild.exe doesn't seem to have an option to cause a single
file
> > to be compiled.
> >
> > I don't want to play around with modified dates because that
throws
> > off our version control system.
> >
> > Any other ideas?
> >
> > Thanks,
> > Erik
>

There dosen't appear to be any way to create a dependency like that.
IAR's system is GUI and xml driven, so the options are more limited
than using something like gnu's make.

Erik
Reply by Bill Knight January 7, 20082008-01-07
Erik
I'm not familiar with IAR's 'make' functionality but can you make
'version.o' dependent upon ALL other .o's? That way if any other .o is
newer than 'version.o', it will be rebuilt from (an unmodified) 'version.c'.

Regards
-Bill Knight
R O SoftWare

PS - IIRC for IAR, the .o files might be .r43 files
erikshreve wrote:
> Is there any way to force a c source file to be compiled every time
> in IAR? I have a C file (version.c) that defines variables for the
> build time and date using __TIME__ and __DATE__. I want this file re-
> compiled every time a "make" command is performed and other files
> are compiled.
>
> I am aware that I can do a "Rebuild all", but this is not what I
> want. I want my version.c file to be compiled _if_ other files in
> the project need to be compiled.
>
> I've tried the pre-build command, but it runs after the build tree
> has been created, thus it can't impact the build tree. Also,
> iarbuild.exe doesn't seem to have an option to cause a single file
> to be compiled.
>
> I don't want to play around with modified dates because that throws
> off our version control system.
>
> Any other ideas?
>
> Thanks,
> Erik