gnupic: Re: [gnupic] Adding a DATE macro to gpsim


Previous by date: 20 Apr 2005 10:35:51 +0100 Re: [gnupic] Adding a DATE macro to gpsim, Pascal Baijot
Next by date: 20 Apr 2005 10:35:51 +0100 Re: [gnupic] Adding a DATE macro to gpsim, Peter
Previous in thread: 20 Apr 2005 10:35:51 +0100 Re: [gnupic] Adding a DATE macro to gpsim, Pascal Baijot
Next in thread: 20 Apr 2005 10:35:51 +0100 Re: [gnupic] Adding a DATE macro to gpsim, Peter

Subject: Re: [gnupic] Adding a DATE macro to gpsim
From: Peter ####@####.####
Date: 20 Apr 2005 10:35:51 +0100
Message-Id: <6d79206c6974746c@lxv.xmglt.mgy.gnqi>

On Wed, 20 Apr 2005, Chris Emerson wrote:

> you wanted, put in an absolute path inside the script, and make sure
> it's ahead of the binary on the path)
>
> #!/bin/sh
> gpasm -DDATE=`date +%Y-%m-%d` "$@"

How about putting all this and a version number incrementor into a 
makefile and running make instead of gpasm ? Which is what I have been 
doing for some time now, in various ways. The version number lives in a 
file and is incremented with every build. E.g.:

(put following in your makefile, include version.c in the dependency list):

## dependency list
hello: hello.c version.c

## automatic version number generator
.PHONY: version.c
version.c:
         @test -f buildcount || echo -1 >buildcount; \
         Z=`cat buildcount` ;\
         Z=$$(( $$Z + 1 ))  ;\
         echo -e "#define VER \"`date` build $$Z\"" >version.c ;\
         echo $$Z >buildcount ;\
         echo "rebuild $$Z - `date`" >>build.log ;\
         echo "Build $$Z"

~ 
Peter

Previous by date: 20 Apr 2005 10:35:51 +0100 Re: [gnupic] Adding a DATE macro to gpsim, Pascal Baijot
Next by date: 20 Apr 2005 10:35:51 +0100 Re: [gnupic] Adding a DATE macro to gpsim, Peter
Previous in thread: 20 Apr 2005 10:35:51 +0100 Re: [gnupic] Adding a DATE macro to gpsim, Pascal Baijot
Next in thread: 20 Apr 2005 10:35:51 +0100 Re: [gnupic] Adding a DATE macro to gpsim, Peter


Powered by ezmlm-browse 0.20.