Dec 26 2008, 08:45 PM
Post
#1
|
|
![]() Group: Members Posts: 2,350 Joined: 30-July 06 Member No.: 10,575 |
I've been working on some stuff, and have it in a local subversion repo. Since I've got a client and a server, I'd like to have my code check to ensure that both are using the same version. I thought that, for at least testing, using the revision number would be a good way to go (I could throw in some compile-time options to have an actual number if stuff ever gets to that point).
My problem is that I have yet to figure out a way to find the revision number. I've got a script that builds binaries, and thought it would be as easy as doing something like: CODE g++ -o mytestprogram src/*.cpp -DVERSION=`cat .svn/version` -lMYLIBS (sorry about the likely poor syntax with the "-D..." part. I've never tried to actually define something as a string, just as existing or not, plus it's been a long day) Anyway, I didn't see the revision anywhere in the .svn dirs. Could somebody help me out (once again, sorry if this is obvious, I'm tired)? Thanks. |
|
|
|
![]() |
Dec 28 2008, 07:22 PM
Post
#2
|
|
![]() Group: Members Posts: 2,350 Joined: 30-July 06 Member No.: 10,575 |
I've been meaning to get autotools working with this project, but haven't found a good how-to, and I haven't looked into Makefiles. I guess I should.
Thanks! EDIT: Well, the Makefile helps, but I still can't figure out how to do this defining stuff. All I want is a way to #define a version number... EDIT2: It looks like most examples just echo the version to a file and then delete said file when doing a "make clean." There's got to be a better way. |
|
|
|
Capn_Fish Find Revision In Subversion Dec 26 2008, 08:45 PM
dhns CODE/usr/bin/svnversion
http://svnbook.red-bean.co... Dec 27 2008, 12:43 AM
Capn_Fish Thanks! Now I've got another question:
Ho... Dec 28 2008, 11:30 AM
speculatrix I'd have thought a makefile macro would be the... Dec 28 2008, 03:00 PM
sdjf There probably is a way to use bash to extract the... Dec 29 2008, 09:51 PM
Capn_Fish I don't want to rename anything, just get a ve... Dec 30 2008, 04:56 PM![]() ![]() |
|
Lo-Fi Version | Time is now: 19th June 2013 - 02:38 PM |