From: Julian Seward Date: Mon, 20 Dec 2004 04:37:50 +0000 (+0000) Subject: New function LibVEX_Version, returning version string automagically X-Git-Tag: svn/VALGRIND_3_0_1^2~660 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0d26e5ca99c9a541e3bfbbf2dc03e1520004dda2;p=thirdparty%2Fvalgrind.git New function LibVEX_Version, returning version string automagically generated by 'svnversion -n .'. Only updated when you do 'make version'. git-svn-id: svn://svn.valgrind.org/vex/trunk@674 --- diff --git a/VEX/Makefile b/VEX/Makefile index 7ad1f565e5..b6058590b9 100644 --- a/VEX/Makefile +++ b/VEX/Makefile @@ -76,9 +76,15 @@ libvex.a: $(LIB_OBJS) ar clq libvex.a $(LIB_OBJS) clean: - rm -f $(LIB_OBJS) libvex.a vex test_main.o + rm -f $(LIB_OBJS) libvex.a vex test_main.o priv/main/vex_svnversion.h (cd head20041019 && make --quiet clean) +version: + rm -f priv/main/vex_svnversion.h + echo -n "\"" > priv/main/vex_svnversion.h + svnversion -n . >> priv/main/vex_svnversion.h + echo "\"" >> priv/main/vex_svnversion.h + ALL_HEADERS = $(PUB_HEADERS) $(PRIV_HEADERS) ALL_INCLUDES = $(PUB_INCLUDES) $(PRIV_INCLUDES) diff --git a/VEX/priv/main/vex_main.c b/VEX/priv/main/vex_main.c index b93ee57182..911ad8a9f7 100644 --- a/VEX/priv/main/vex_main.c +++ b/VEX/priv/main/vex_main.c @@ -53,6 +53,16 @@ /* --------- Initialise the library. --------- */ +/* Exported to library client. */ + +HChar* LibVEX_Version ( void ) +{ +return +#include "main/vex_svnversion.h" + ; +} + + /* Exported to library client. */ void LibVEX_default_VexControl ( /*OUT*/ VexControl* vcon ) diff --git a/VEX/pub/libvex.h b/VEX/pub/libvex.h index ea5a85cf0b..20efe5a818 100644 --- a/VEX/pub/libvex.h +++ b/VEX/pub/libvex.h @@ -81,6 +81,11 @@ typedef extern void LibVEX_default_VexControl ( /*OUT*/ VexControl* vcon ); +/* Returns the Vex SVN version. */ + +extern HChar* LibVEX_Version ( void ); + + /* Initialise the translator. */ extern void LibVEX_Init (