From cvs-return-1264-apmail-apr-cvs-archive=apr.apache.org@apr.apache.org Thu May 17 23:15:15 2001 Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 39650 invoked by uid 500); 17 May 2001 23:15:15 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 39631 invoked by uid 1075); 17 May 2001 23:15:14 -0000 Date: 17 May 2001 23:15:14 -0000 Message-ID: <20010517231514.39630.qmail@apache.org> From: fielding@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/build rules.mk.in fielding 01/05/17 16:15:14 Modified: build rules.mk.in Log: 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. Revision Changes Path 1.16 +30 -15 apr/build/rules.mk.in Index: rules.mk.in =================================================================== RCS file: /home/cvs/apr/build/rules.mk.in,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- rules.mk.in 2001/05/17 22:25:57 1.15 +++ rules.mk.in 2001/05/17 23:15:14 1.16 @@ -135,13 +135,9 @@ 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 @@ $(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 @@ $(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 @@ 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 @@ .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