]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Default target used to create a header file with svn revision and branch information
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 Jan 2008 16:14:09 +0000 (16:14 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 Jan 2008 16:14:09 +0000 (16:14 +0000)
Makefile

index fd3068eec2edd3e26b9230fe494c58f6f6e92ef8..00cf71acc07f7adf5d33aca23354c0a42e7ae041 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -171,14 +171,29 @@ ALILIBS         := -L$(LIBDIR) -lMUON -lTPC -lPMD -lTRD -lFMD -lTOF \
 
 LIBS := $(ROOTCLIBS) $(ROOTPLIBS) $(SYSLIBS)
 
+ARVERSIONFILE := $(EXPORTDIR)/ARVersion.h
+SVNREV := $(strip $(shell svn info | grep "Last Changed Rev:" | cut -d: -f2 ))
+SVNBRANCH := $(subst //alisoft.cern.ch/AliRoot/,,$(shell svn info | grep "URL:" | cut -d: -f3 ))
+
 #-------------------------------------------------------------------------------
 # default target
 
-default:
+default: $(ARVERSIONFILE)
        $(MUTE)$(MAKE) aliroot
 
 FORCE:
 
+#-------------------------------------------------------------------------------
+# Write header file with aliroot svn version and url
+
+$(ARVERSIONFILE): FORCE $(EXPORTDIR)
+       $(MUTE)rm -f $(ARVERSIONFILE)
+       @echo "***** Making $(ARVERSIONFILE) *****"
+       @echo "#ifndef ALIROOT_ARVersion" >> $@
+       @echo "#define ALIROOT_ARVersion" >> $@
+       @echo "#define ALIROOT_SVN_REVISION $(SVNREV)" >> $@
+       @echo "#define ALIROOT_SVN_BRANCH \"$(SVNBRANCH)\"" >> $@
+       @echo "#endif" >> $@ 
 #-------------------------------------------------------------------------------
 # Each module will add to these macros