]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Makefile: build ceph.in the cmake way
authorJohn Spray <john.spray@redhat.com>
Mon, 3 Aug 2015 23:33:05 +0000 (00:33 +0100)
committerJohn Spray <john.spray@redhat.com>
Mon, 10 Aug 2015 13:05:53 +0000 (14:05 +0100)
A little bit more of a tongue-twisting command line
to do string replacement, but saves us from having
separate ceph.in files for cmake vs autotools.

Signed-off-by: John Spray <john.spray@redhat.com>
src/Makefile-client.am

index d68d70db3185abcd4c0d2414b111dfa7da5f454f..14bd712b1b56ea35064f6e9dc6e77652b0febeab 100644 (file)
@@ -19,11 +19,10 @@ bin_PROGRAMS += ceph-syn
 
 ceph: ceph.in ./ceph_ver.h Makefile
        rm -f $@ $@.tmp
-       echo "#!/usr/bin/env python" >$@.tmp
-       grep "#define CEPH_GIT_NICE_VER" $(srcdir)/ceph_ver.h | \
-               sed -e 's/#define \(.*VER\) /\1=/' >>$@.tmp
-       grep "#define CEPH_GIT_VER" $(srcdir)/ceph_ver.h | \
-         sed -e 's/#define \(.*VER\) /\1=/' -e 's/=\(.*\)$$/="\1"/' >>$@.tmp
+       cp $@.in $@.tmp
+       sed -i "s|@PYTHON_EXECUTABLE@|/usr/bin/env python|" $@.tmp
+       grep CEPH_GIT_NICE_VER ./ceph_ver.h | cut -f 3 -d " " | sed s/\"//g | xargs -I "{}" sed -i "s/@CEPH_GIT_NICE_VER@/{}/g" $@.tmp
+       grep CEPH_GIT_VER ./ceph_ver.h | cut -f 3 -d " " | sed s/\"//g | xargs -I "{}" sed -i "s/@CEPH_GIT_VER@/{}/g" $@.tmp
        cat $(srcdir)/$@.in >>$@.tmp
        chmod a+x $@.tmp
        chmod a-w $@.tmp