]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Add NO_VERSION to avoid rebuilding ceph_ver.h and relinking 1499/head
authorDan Mick <dan.mick@inktank.com>
Thu, 13 Feb 2014 03:28:30 +0000 (19:28 -0800)
committerDan Mick <dan.mick@inktank.com>
Wed, 19 Mar 2014 02:05:19 +0000 (19:05 -0700)
Signed-off-by: Dan Mick <dan.mick@inktank.com>
src/Makefile.am
src/make_version

index 599cb5706fe4605e6b97c5cd5519189ab968b9e3..fdef8993265d018a8a0e6365cf14f6bf5af94654 100644 (file)
@@ -276,8 +276,19 @@ base: core-daemons admin-tools \
 FORCE:
 .git_version: FORCE
        $(srcdir)/check_version $(srcdir)/.git_version
+
+# if NO_VERSION is set, only generate a new ceph_ver.h if there currently 
+# is none, and call "make_version -n" to fill it with a fixed string.
+# Otherwise, set it from the contents of .git_version.
+
 ceph_ver.h: .git_version
-       $(srcdir)/make_version $(srcdir)/.git_version ./ceph_ver.h
+       if [ -n "$$NO_VERSION" ] ; then \
+           if [ ! -f ./ceph_ver.h ] ; then \
+               $(srcdir)/make_version -n ./ceph_ver.h ; \
+           fi; \
+        else \
+           $(srcdir)/make_version $(srcdir)/.git_version ./ceph_ver.h ; \
+       fi
 
 ceph_ver.c: ./ceph_ver.h
 common/version.cc: ./ceph_ver.h
index e2fed42fdbd85e4a362c12820d47bb99ea894f84..3ed2bac691d8b0a4bee4499d45ed05f4696ee3b3 100755 (executable)
@@ -1,7 +1,14 @@
 #!/bin/sh
 
-cur=`head -1 $1`
-v=`tail -1 $1 | cut -c 2-`
+echo '$1: '$1
+
+if [ "$1" =  "-n" ] ; then
+   cur="no_version"
+   v="Development"
+else
+   cur=`head -1 $1`
+   v=`tail -1 $1 | cut -c 2-`
+fi
 
 print_all() {
        echo "#ifndef CEPH_VERSION_H"