From: Dan Mick Date: Thu, 13 Feb 2014 03:28:30 +0000 (-0800) Subject: Add NO_VERSION to avoid rebuilding ceph_ver.h and relinking X-Git-Tag: v0.79~123^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1499%2Fhead;p=ceph.git Add NO_VERSION to avoid rebuilding ceph_ver.h and relinking Signed-off-by: Dan Mick --- diff --git a/src/Makefile.am b/src/Makefile.am index 599cb5706fe4..fdef8993265d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 diff --git a/src/make_version b/src/make_version index e2fed42fdbd8..3ed2bac691d8 100755 --- a/src/make_version +++ b/src/make_version @@ -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"