gnupic: Re: [gnupic] Adding a DATE macro to gpsim
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