Including the SVN version of the project in the C source code

How do I include the SVN version of my project (not the file revision) in the C source code or in the Makefile?

+5
source share
2 answers

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).

+8
source

From the SVN book :

, $Rev$. , , , $Rev $. $Rev$ , , , , . , - Subversion, , ?

. Subversion svnversion, . . , , . svnversion . "svnversion-Subversion Working Copy Version Info" 9, Subversion.

+4

All Articles