From 0f5ce5eaa58474d90046a66e8d3230ad83164611 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Tue, 1 Dec 2015 23:25:33 +0900 Subject: [PATCH] Makefile: break out local targets into variables 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 --- src/Makefile.am | 18 ++++++++++++++++-- src/ceph-detect-init/Makefile.am | 10 +++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 8085dce198ff3..03e6aaa59baa5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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) diff --git a/src/ceph-detect-init/Makefile.am b/src/ceph-detect-init/Makefile.am index a2c885aae697a..932f7555aaad7 100644 --- a/src/ceph-detect-init/Makefile.am +++ b/src/ceph-detect-init/Makefile.am @@ -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 -- 2.39.5