]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Tidy and fix clean and distclean rules for old testsuite.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 22 Aug 2010 04:14:06 +0000 (06:14 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 22 Aug 2010 08:17:18 +0000 (10:17 +0200)
* Makefile.am (clean-local-legacy): Use $(CONF_SUBDIRS) instead
of hard-coding the list of test directories.  Use
$(AM_MAKEFLAGS).
(fake-distclean-legacy): New phony rule, to create fake Makefile
files if needed so that the automake-generated
distclean-recursive rule can work properly.
(distclean_recursive): New helper variable.
(distclean-recursive): Depend on fake-distclean-legacy.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
Makefile.am

index 5f5e23ad610e84b5fac37ad61b565fe1a5fad6b9..6b8767f6a75d32ed8f669b034e59e604e6e9060e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Tidy and fix clean and distclean rules for old testsuite.
+       * Makefile.am (clean-local-legacy): Use $(CONF_SUBDIRS) instead
+       of hard-coding the list of test directories.  Use
+       $(AM_MAKEFLAGS).
+       (fake-distclean-legacy): New phony rule, to create fake Makefile
+       files if needed so that the automake-generated
+       distclean-recursive rule can work properly.
+       (distclean_recursive): New helper variable.
+       (distclean-recursive): Depend on fake-distclean-legacy.
+
 2010-08-22  Paolo Bonzini  <bonzini@gnu.org>
 
        Fix sed_make_literal_regex.
index d689e09c67781e408b775b54270c8d9859c5207c..2c4a3db7fccbc80ce272df74cddb09c80662880c 100644 (file)
@@ -712,12 +712,26 @@ $(srcdir)/tests/defs.in: $(auxdir)/general.m4sh tests/defs.m4sh Makefile.am
 
 # We need to remove any files that the above tests created.
 clean-local-legacy:
-       -cd tests; \
-       for dir in cdemo demo depdemo f77demo fcdemo mdemo mdemo2 pdemo tagdemo; \
-       do \
-           test -f $$dir/Makefile && ( cd $$dir && $(MAKE) distclean; ); \
+       -for dir in $(CONF_SUBDIRS); do \
+         if test -f $$dir/Makefile; then \
+           (cd $$dir && $(MAKE) $(AM_MAKEFLAGS) distclean); \
+         else :; fi; \
        done
        rm -rf _inst
 
+# For distclean, we may have to fake Makefiles in the test directories
+# so that descending in DIST_SUBDIRS works.
+# Hide the additional dependency from automake so it still outputs the rule.
+distclean_recursive = distclean-recursive
+$(distclean_recursive): fake-distclean-legacy
+.PHONY: fake-distclean-legacy
+fake-distclean-legacy:
+       -for dir in $(CONF_SUBDIRS); do \
+         if test ! -f $$dir/Makefile; then \
+           $(mkinstalldirs) $$dir; \
+           echo 'distclean: ; rm -f Makefile' > $$dir/Makefile; \
+         else :; fi; \
+       done
+
 $(TESTS): tests/defs
 DISTCLEANFILES += tests/defs