We use the following line in our makefile:
REPO_REV := $(shell svnversion -n)
Saves the revision number of the working copy in the make variable. To use it in C code, you can use the makefile to define a macro on the compiler command line (something like -DREPO_REV=$(REPO_REV)for gcc).
source
share