I\'d like to implement a way of recording the version of a project within code, so that it can be used when testing and to help track bugs. It seems the best version number
in your Makefile, add:
SVNDEV := -D'SVN_REV="$(shell svnversion -n .)"' CFLAGS := $(SVNDEV) ...
then you can use macro SVN_REV anywhere in your code, eg:
SVN_REV
printf ("Version: SVN %s\n", SVN_REV);