avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Adding date/version information to project??


From: David Kelly
Subject: Re: [avr-gcc-list] Adding date/version information to project??
Date: Mon, 28 Nov 2005 23:01:07 -0600


On Nov 28, 2005, at 10:20 PM, <address@hidden> wrote:

Hi all:

I am looking for an automated way to update a static string in program
space when my project is built. Is there an easy way to do this, either by adding an extra target to the makefile, or some other way? I'd prefer not to manually have to change the information, and I'd also prefer for
it to NOT change when none of the other source files change. That is,
the requirement is as follows:

Incomplete, but this could get you started:

Research the ability to run a script or executable from within Windows gmake. Copy stdout into a Make variable something like this:

CFLAGS += -DThe_Date_Is=`date`

Create a project file named something like makedate.c and tweak the Make rules so that makedate.c must be built for the situations you wish the date to be updated.

makedate.c would look something like:

const char My_Build_Date[] = "The_Date_Is";

gcc already has a bluzillion predefined environment variables. I wouldn't be surprised that one contains date and time stamp, lets check:

% touch foo.h ; avr-cpp -dM foo.h

Nope, didn't see a timestamp.

--
David Kelly N4HHE, address@hidden
========================================================================
Whom computers would destroy, they must first drive mad.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]