From b227426838df4a304614341e5ce0530a3d5140c2 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Wed, 12 Feb 2014 19:28:30 -0800 Subject: [PATCH] Add NO_VERSION to avoid rebuilding ceph_ver.h and relinking Signed-off-by: Dan Mick --- src/Makefile.am | 13 ++++++++++++- src/make_version | 11 +++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 599cb5706fe46..fdef8993265d0 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 e2fed42fdbd85..3ed2bac691d8b 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"