Skip to content

Commit

Permalink
Add NO_VERSION to avoid rebuilding ceph_ver.h and relinking
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Mick <dan.mick@inktank.com>
  • Loading branch information
Dan Mick committed Mar 19, 2014
1 parent 381850b commit b227426
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
13 changes: 12 additions & 1 deletion src/Makefile.am
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions 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"
Expand Down

0 comments on commit b227426

Please sign in to comment.