I have the following in my makefile:
..$/svnversion.h:
@echo #define SVN_VERSION $(shell svn info --revision HEAD | grep Revision | cut -f2 -d" ") > ..$/svnversion.h
@echo #define SVN_VERSION_STR "$(shell svn info --revision HEAD | grep Revision | cut -f2 -d" ")" >> ..$/svnversion.h
which generates the following svnversion.h:
#define SVN_VERSION 1837
#define SVN_VERSION_STR "1837"
My question is how can I create a pre-build step that results in the same file generation as that of my make file?
I have the first line of the file generating with:
$if($SVN_BUILD){cmd /c svn info --revision HEAD | grep Revision | sed -e "s/Revision:/#define SVN_VERSION/" > svnversion.h}
but I can't get sed to handle inserting the double quote. I'm also hoping there is a cleaner way to do this with the built in C::B scripting support.
Thanx!