Re: Adding current svn revision to source automatically
From: Kenneth Goldman <kgoldman_at_us.ibm.com>
Date: Fri, 19 Dec 2008 09:19:57 -0500
Thanks to all who got me clues. In return, I offer my 'solution'.
1 - The hacks using svnversion are just that - hacks. $GlobalRev$
2 - My solution is Unix only. Windows doesn't have svnversion,
My solution:
1 - Create a .h file with this:
extern const unsigned short svn_revision;
I thought of using a .h with #define, but it would have to
I didn't see any advantage of the FAQ approach, using a
2 - Get the svn version in the makefile
SVNVERSION := $(shell svnversion | sed s/\[0-9\]\*:// |sed s/M//)
The FAQ implies that svnversion returns a number, but it could
2 - Create the .c file in the makefile like this
.c: $(everything)
The .c file has to depend on everything else, so the
3 - Create the export target
export:
Since the .c file isn't committed, it has to copied
4 - Add the .o file to the make target.
5 - Add the .c file to the clean target
-- Ken Goldman kgold_at_watson.ibm.com 914-784-7646 (863-7646) ------------------------------------------------------ http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=987467 To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].Received on 2008-12-19 16:52:23 CET |
This is an archived mail posted to the Subversion Users mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.