This is from a bash script I used to build the program:
dateString=$(date +%Y/%m/%d\ %H:%M:%S) revision=(`svn info | grep Revision | tr -d [:alpha:]':'`) echo "#define VERSION_DATE \"$dateString\"" > version.h echo "#define VERSION_REVISION \"$revision\"" >> version.h
I changed the use of the build.sh file in the make file:
version.h: dateString=$$(date +%Y/%m/%d\ %H:%M:%S) revision=(`svn info | grep Revision | tr -d [:alpha:]':'`) echo "#define VERSION_DATE \"$dateString\"" > version.h.tmp echo "#define VERSION_REVISION \"$revision\"" >> version.h.tmp mv version.h.tmp version.h
But the version.h file ends as follows:
#define VERSION_DATE "\ateString" #define VERSION_REVISION "\evision"
It seems I cannot correctly interpret shell variables. I think this is because they are ultimately Makefile vars. If someone knows how to do this, I do not mind knowing how to do it. Many thanks.
Paul kersey
source share