]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Makefile: break out local targets into variables
authorHector Martin <marcan@marcan.st>
Tue, 1 Dec 2015 14:25:33 +0000 (23:25 +0900)
committerHector Martin <marcan@marcan.st>
Tue, 1 Dec 2015 15:29:55 +0000 (00:29 +0900)
To support more than one set of local-* rules, break them out into
sub-rules referenced by appending to variables. This will be used
when introducing the Cython-based librbd bindings that rely on
setup.py

Signed-off-by: Hector Martin <marcan@marcan.st>
src/Makefile.am
src/ceph-detect-init/Makefile.am

index 8085dce198ff3b13b22fb3a916f75b1b975954f4..03e6aaa59baa5de4525e4176efda9c439ea1b48c 100644 (file)
@@ -3,6 +3,11 @@ include Makefile-env.am
 SUBDIRS += ocf java
 DIST_SUBDIRS += gmock ocf java
 
+LOCAL_ALL =
+LOCAL_CLEAN =
+LOCAL_INSTALLDATA =
+LOCAL_INSTALLEXEC =
+
 if NO_GIT_VERSION
 export NO_VERSION="yes"
 endif
@@ -192,11 +197,12 @@ CLEANFILES += ceph_ver.h sample.fetch_config
 
 # cleaning
 
-clean-local::
+base-clean-local::
        rm -f *.so 
        find . -name '*.gcno' -o -name '*.gcda' -o -name '*.lcov' -o -name "*.o" -o -name "*.lo" | xargs rm -f
        rm -f ceph java/java/com/ceph/crush/Bucket.class
 
+LOCAL_CLEAN += base-clean-local
 
 # pybind
 
@@ -242,11 +248,13 @@ if ENABLE_COVERAGE
        -test/coverage.sh -d $(srcdir) -o check-coverage make check
 endif
 
-install-data-local:: install-coverage
+base-install-data-local:: install-coverage
        -mkdir -p $(DESTDIR)$(sysconfdir)/ceph
        -mkdir -p $(DESTDIR)$(localstatedir)/log/ceph
        -mkdir -p $(DESTDIR)$(localstatedir)/lib/ceph/tmp
 
+LOCAL_INSTALLDATA += base-install-data-local
+
 uninstall-local:: uninstall-coverage
        -rmdir -p $(DESTDIR)$(sysconfdir)/ceph/
        -rmdir -p $(DESTDIR)$(localstatedir)/log/ceph
@@ -277,3 +285,9 @@ if ENABLE_SERVER
 include Makefile-server.am
 endif
 
+# local targets
+
+all-local: $(LOCAL_ALL)
+clean-local: $(LOCAL_CLEAN)
+install-exec-local: $(LOCAL_INSTALLEXEC)
+install-data-local: $(LOCAL_INSTALLDATA)
index a2c885aae697aeb92fd5c8d27136724ee9f1b910..932f7555aaad76303c5110e0fc143b4a9ff4eb4c 100644 (file)
@@ -53,13 +53,13 @@ EXTRA_DIST += \
        ceph-detect-init/tests/test_all.py \
        ceph-detect-init/tox.ini
 
-all-local::
+ceph-detect-init-all:
        cd $(srcdir)/ceph-detect-init ; python setup.py build
 
-clean-local::
+ceph-detect-init-clean:
        cd $(srcdir)/ceph-detect-init ; python setup.py clean ; rm -fr wheelhouse .tox build .coverage *.egg-info
 
-install-data-local::
+ceph-detect-init-install-data:
        cd $(srcdir)/ceph-detect-init ; \
        if test "$(DESTDIR)" ; then \
                if lsb_release -si | grep --quiet 'Ubuntu\|Debian\|Devuan' ; then \
@@ -70,3 +70,7 @@ install-data-local::
                root="--root=$(DESTDIR)" ; \
        fi ; \
        python setup.py install $$root $$options
+
+LOCAL_ALL += ceph-detect-init-all
+LOCAL_CLEAN += ceph-detect-init-clean
+LOCAL_INSTALLDATA += ceph-detect-init-install-data