From 267bfc18cdbcfe0d00c28ff540c0ca8ce3f81e53 Mon Sep 17 00:00:00 2001 From: fielding Date: Thu, 17 May 2001 23:15:14 +0000 Subject: I wish I'd thought of this first... We don't want a make *clean to stop just because one of the subdirs has already been cleaned. Separating the recursive clean rules from the recursive build rules allows us to make that distinction. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61657 13f79535-47bb-0310-9956-ffa450edef68 --- build/rules.mk.in | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/build/rules.mk.in b/build/rules.mk.in index 1664bb11b..db6a25765 100644 --- a/build/rules.mk.in +++ b/build/rules.mk.in @@ -135,13 +135,9 @@ extraclean: extraclean-recursive install: all-recursive -all-recursive depend-recursive clean-recursive distclean-recursive \ - extraclean-recursive: +all-recursive depend-recursive: @otarget=`echo $@ | sed s/-recursive//`; \ - case $$otarget in \ - *clean) list='$(SUBDIRS) $(CLEAN_SUBDIRS)';; \ - *) list='$(SUBDIRS)';; \ - esac; \ + list='$(SUBDIRS)'; \ for i in $$list; do \ if test -d "$$i"; then \ target="$$otarget"; \ @@ -160,6 +156,27 @@ all-recursive depend-recursive clean-recursive distclean-recursive \ $(MAKE) "local-$$otarget" || exit 1; \ fi +clean-recursive distclean-recursive extraclean-recursive: + @otarget=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS) $(CLEAN_SUBDIRS)'; \ + for i in $$list; do \ + if test -d "$$i"; then \ + target="$$otarget"; \ + echo "Making $$target in $$i"; \ + if test "$$i" = "."; then \ + made_local=yes; \ + target="local-$$target"; \ + fi; \ + (cd $$i && $(MAKE) $$target); \ + fi; \ + done; \ + if test "$$otarget" = "all" && test -z "$(TARGETS)"; then \ + made_local=yes; \ + fi; \ + if test "$$made_local" != "yes"; then \ + $(MAKE) "local-$$otarget"; \ + fi + local-clean: x-local-clean $(RM) -f *.o *.lo *.a *.la *.so *.obj $(CLEAN_TARGETS) $(PROGRAMS) $(RM) -rf .libs @@ -173,7 +190,7 @@ local-extraclean: local-distclean x-local-extraclean $(RM) -f $(EXTRACLEAN_TARGETS) ; \ fi -local-all: $(TARGETS) x-local-all +local-all: $(TARGETS) local-depend: x-local-depend @if test -n "`ls *.c 2> /dev/null`"; then \ @@ -182,8 +199,7 @@ local-depend: x-local-depend fi # to be filled in by the actual Makefile -x-local-all x-local-depend: -x-local-clean x-local-distclean x-local-extraclean: +x-local-depend x-local-clean x-local-distclean x-local-extraclean: # # Implicit rules for creating outputs from input files @@ -197,9 +213,8 @@ x-local-clean x-local-distclean x-local-extraclean: .c.lo: $(LT_COMPILE) -.PHONY: all depend clean distclean extraclean install \ - all-recursive depend-recursive clean-recursive distclean-recursive \ - extraclean-recursive - local-all local-depend local-clean local-distclean local-extraclean \ - x-local-all x-local-depend x-local-clean x-local-distclean \ - x-local-extraclean +.PHONY: all all-recursive local-all install \ + depend depend-recursive local-depend x-local-depend \ + clean clean-recursive local-clean x-local-clean \ + distclean distclean-recursive local-distclean x-local-distclean \ + extraclean extraclean-recursive local-extraclean x-local-extraclean -- cgit v1.2.1