From 0fec0340c206ed3dd983f4b669781e4cbe650ed9 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 29 Mar 2010 14:09:25 +0000 Subject: [PATCH] distclean fixes Move daemons/ and lib/ subtargets to their Makefiles so we don't get double cleanup error during execution of distclean target. Instead of duplicating clean target inside distclean target, just use it as a subtarget and avoid add duplicating code. --- Makefile.in | 11 +---------- daemons/Makefile.in | 4 ++++ lib/Makefile.in | 9 +++++++++ make.tmpl.in | 7 ++----- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Makefile.in b/Makefile.in index 49c17bccd..157d995cf 100644 --- a/Makefile.in +++ b/Makefile.in @@ -34,16 +34,7 @@ ifeq ("@APPLIB@", "yes") endif ifeq ($(MAKECMDGOALS),distclean) - SUBDIRS += daemons/clvmd \ - daemons/cmirrord \ - daemons/dmeventd/plugins \ - daemons/dmeventd \ - lib/format1 \ - lib/format_pool \ - lib/locking \ - lib/mirror \ - lib/snapshot \ - liblvm \ + SUBDIRS += liblvm \ udev \ test/api \ test \ diff --git a/daemons/Makefile.in b/daemons/Makefile.in index a0e7268ff..1b4bcbbd5 100644 --- a/daemons/Makefile.in +++ b/daemons/Makefile.in @@ -30,6 +30,10 @@ ifeq ("@BUILD_DMEVENTD@", "yes") SUBDIRS += dmeventd endif +ifeq ($(MAKECMDGOALS),distclean) + SUBDIRS = clvmd cmirrord dmeventd +endif + include $(top_builddir)/make.tmpl ifeq ("@BUILD_DMEVENTD@", "yes") diff --git a/lib/Makefile.in b/lib/Makefile.in index a2e66f3e1..c83dc8946 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -152,6 +152,15 @@ LIB_STATIC = $(LIB_NAME).a CLEAN_TARGETS += $(LIB_NAME).cflow +ifeq ($(MAKECMDGOALS),distclean) + SUBDIRS =\ + format1 \ + format_pool \ + snapshot \ + mirror \ + locking +endif + include $(top_builddir)/make.tmpl $(SUBDIRS): $(LIB_STATIC) diff --git a/make.tmpl.in b/make.tmpl.in index ff4d1b21f..29cccb4ef 100644 --- a/make.tmpl.in +++ b/make.tmpl.in @@ -257,12 +257,9 @@ clean: $(SUBDIRS.clean) $(SOURCES2:%.c=%.d) $(SOURCES:%.c=%.pot) $(SOURCES:%.c=%.gcno) \ $(SOURCES:%.c=%.gcda) $(LDDEPS) -distclean: $(SUBDIRS.distclean) +distclean: clean $(SUBDIRS.distclean) $(RM) -rf $(DISTCLEAN_DIRS) - $(RM) $(DISTCLEAN_TARGETS) \ - $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(SOURCES:%.c=%.d) \ - $(SOURCES2:%.c=%.d) $(SOURCES:%.c=%.pot) $(SOURCES:%.c=%.gcno) \ - $(SOURCES:%.c=%.gcda) $(LDDEPS) \ + $(RM) $(DISTCLEAN_TARGETS) \ config.cache config.log config.status \ Makefile make.tmpl core \ lvm-version.h -- 2.43.5