From: Tom Tromey Date: Wed, 30 Apr 1997 01:30:40 +0000 (+0000) Subject: run clean subdirs in reverse order X-Git-Tag: Release-1-1p~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=447031fe12d5cd5edead99215d21ce9828fb0d7a;p=thirdparty%2Fautomake.git run clean subdirs in reverse order --- diff --git a/ChangeLog b/ChangeLog index b910c1f56..570a7adb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ Tue Apr 29 19:11:45 1997 Tom Tromey + * subdirs.am: Clean targets now run in reverse order. From Kevin + Dalley. + * automake.in (handle_texinfo): Put `aminfo', not `info' on @clean. diff --git a/Makefile.in b/Makefile.in index 889568d0d..3aa3347ad 100644 --- a/Makefile.in +++ b/Makefile.in @@ -313,10 +313,18 @@ uninstall-pkgdataDATA: all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ -check-recursive installcheck-recursive info-recursive dvi-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @for subdir in $(SUBDIRS); do \ + target=`echo $@ | sed s/-recursive//`; \ + echo "Making $$target in $$subdir"; \ + (cd $$subdir && $(MAKE) $$target) \ + || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" + mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @for subdir in $(SUBDIRS); do \ + @rev=''; for subdir in $(SUBDIRS); do rev="$$rev $$subdir"; done; \ + for subdir in $$rev; do \ target=`echo $@ | sed s/-recursive//`; \ echo "Making $$target in $$subdir"; \ (cd $$subdir && $(MAKE) $$target) \ diff --git a/THANKS b/THANKS index c60cef88a..344469f43 100644 --- a/THANKS +++ b/THANKS @@ -29,6 +29,7 @@ Joerg-Martin Schwarz Josh MacDonald Joshua Cowan Karl Berry +Kevin Dalley Marius Vollmer Mark Eichin Mark Galassi diff --git a/lib/am/subdirs.am b/lib/am/subdirs.am index 5b7571de3..0622e8dda 100644 --- a/lib/am/subdirs.am +++ b/lib/am/subdirs.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -26,10 +26,26 @@ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive @INSTALLINFO@ \ -check-recursive installcheck-recursive info-recursive dvi-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @for subdir in $(SUBDIRS); do \ + target=`echo $@ | sed s/-recursive//`; \ + echo "Making $$target in $$subdir"; \ + (cd $$subdir && $(MAKE) $$target) \ +## This trick allows "-k" to keep its natural meaning when running a +## recursive rule. + || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" + +## We run all `clean' targets in reverse order. Why? It's an attempt +## to alleviate a problem that can happen when dependencies are +## enabled. In this case, the .P file in one directory can depend on +## some automatically generated header in an earlier directory. Since +## the dependencies are required before any target is examined, make +## bombs. mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @for subdir in $(SUBDIRS); do \ + @rev=''; for subdir in $(SUBDIRS); do rev="$$rev $$subdir"; done; \ + for subdir in $$rev; do \ target=`echo $@ | sed s/-recursive//`; \ echo "Making $$target in $$subdir"; \ (cd $$subdir && $(MAKE) $$target) \ diff --git a/subdirs.am b/subdirs.am index 5b7571de3..0622e8dda 100644 --- a/subdirs.am +++ b/subdirs.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. +## Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -26,10 +26,26 @@ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive @INSTALLINFO@ \ -check-recursive installcheck-recursive info-recursive dvi-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @for subdir in $(SUBDIRS); do \ + target=`echo $@ | sed s/-recursive//`; \ + echo "Making $$target in $$subdir"; \ + (cd $$subdir && $(MAKE) $$target) \ +## This trick allows "-k" to keep its natural meaning when running a +## recursive rule. + || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" + +## We run all `clean' targets in reverse order. Why? It's an attempt +## to alleviate a problem that can happen when dependencies are +## enabled. In this case, the .P file in one directory can depend on +## some automatically generated header in an earlier directory. Since +## the dependencies are required before any target is examined, make +## bombs. mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @for subdir in $(SUBDIRS); do \ + @rev=''; for subdir in $(SUBDIRS); do rev="$$rev $$subdir"; done; \ + for subdir in $$rev; do \ target=`echo $@ | sed s/-recursive//`; \ echo "Making $$target in $$subdir"; \ (cd $$subdir && $(MAKE) $$target) \