From: Alexandre Duret-Lutz Date: Mon, 27 Dec 2004 20:38:22 +0000 (+0000) Subject: Declare recursive install targets as dependencies of `.MAKE', so X-Git-Tag: Release-1-9b~223 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b35451144a9aa9a308b1ee842476e4ba85026b4;p=thirdparty%2Fautomake.git Declare recursive install targets as dependencies of `.MAKE', so that `make -n install' works with BSD Make too. --- diff --git a/ChangeLog b/ChangeLog index 4a2115204..99c1d8db2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2004-12-27 Alexandre Duret-Lutz + + Declare recursive install targets as dependencies of `.MAKE', so + that `make -n install' works with BSD Make too. + + * lib/Automake/Rule.pm (reset) <%dependencies>: Add `.MAKE'. + * automake.in (target_cmp): Move all `.XYZ' target last, not + only `.PHONY'. + (handle_factored_dependencies): Add target with hooks to `.MAKE'. + Do not let a user definition of .MAKE override ours. + * lib/am/install.am (install-am, install-strip): Mark as `.MAKE'. + * lib/am/multilib.am (all-multi, install-multi, mostlyclean-multi, + clean-multi, distclean-multi, maintainer-clean-multi): Likewise. + * lib/am/subdirs.am (mostlyclean-recursive, clean-recursive, + distclean-recursive, maintainer-clean-recursive): Likewise. + 2004-12-18 Alexandre Duret-Lutz * lib/config-ml.in, lib/config.guess, lib/config.sub, diff --git a/Makefile.in b/Makefile.in index d59bf7c17..6c6794849 100644 --- a/Makefile.in +++ b/Makefile.in @@ -64,6 +64,8 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -262,8 +264,7 @@ $(RECURSIVE_TARGETS): $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: +$(RECURSIVE_CLEAN_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ @@ -592,19 +593,21 @@ uninstall-am: uninstall-binSCRIPTS uninstall-info-am uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ - check-am clean clean-generic clean-recursive ctags \ - ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ - dist-tarZ dist-zip distcheck distclean distclean-generic \ - distclean-recursive distclean-tags distcleancheck distdir \ +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-exec-am install-strip uninstall-am + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ + dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-generic distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-exec install-exec-am install-exec-hook \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-binSCRIPTS uninstall-hook \ uninstall-info-am diff --git a/automake.in b/automake.in index 2ac77c54e..b9eca7c66 100755 --- a/automake.in +++ b/automake.in @@ -4386,16 +4386,20 @@ sub handle_clean ($) # &target_cmp ($A, $B) # -------------------- -# Subroutine for &handle_factored_dependencies to let `.PHONY' be last. +# Subroutine for &handle_factored_dependencies to let `.PHONY' and +# other `.TARGETS' be last. sub target_cmp { - return 0 - if $a eq $b; - return -1 - if $b eq '.PHONY'; - return 1 - if $a eq '.PHONY'; - return $a cmp $b; + return 0 if $a eq $b; + + my $a1 = substr ($a, 0, 1); + my $b1 = substr ($b, 0, 1); + if ($a1 ne $b1) + { + return -1 if $b1 eq '.'; + return 1 if $a1 eq '.'; + } + return $a cmp $b; } @@ -4440,6 +4444,7 @@ sub handle_factored_dependencies $actions{"$_-am"} .= ("\t\@\$(NORMAL_INSTALL)\n" . "\t" . '$(MAKE) $(AM_MAKEFLAGS) ' . "$_-hook\n"); + depend ('.MAKE', "$_-am"); } } @@ -4462,8 +4467,9 @@ sub handle_factored_dependencies # to append dependencies. This would not work if Automake # refrained from defining its own .PHONY target as it does # with other overridden targets. + # Likewise for `.MAKE'. my @undefined_conds = (TRUE,); - if ($_ ne '.PHONY') + if ($_ ne '.PHONY' && $_ ne '.MAKE') { @undefined_conds = Automake::Rule::define ($_, 'internal', diff --git a/doc/Makefile.in b/doc/Makefile.in index 050c131e3..3ca7f7507 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -286,9 +286,9 @@ dist-info: $(INFO_DEPS) done mostlyclean-aminfo: - -rm -rf automake.aux automake.cm automake.cp automake.cps automake.cv \ - automake.fn automake.ky automake.kys automake.log \ - automake.op automake.ov automake.pg automake.pgs \ + -rm -rf automake.ac automake.aux automake.cm automake.cp automake.cps \ + automake.fn automake.fns automake.ky automake.kys \ + automake.log automake.op automake.pg automake.pgs \ automake.tmp automake.toc automake.tp automake.tps \ automake.tr automake.vr automake.vrs automake.dvi \ automake.pdf automake.ps automake.html @@ -488,6 +488,8 @@ ps-am: $(PSS) uninstall-am: uninstall-info-am +.MAKE: install-am install-strip + .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ ctags dist-info distclean distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index bcfc3b85f..352e73227 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -68,6 +68,8 @@ am__installdirs = "$(DESTDIR)$(perllibdir)" "$(DESTDIR)$(perllibdir)" dist_perllibDATA_INSTALL = $(INSTALL_DATA) nodist_perllibDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_perllib_DATA) $(nodist_perllib_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -270,8 +272,7 @@ $(RECURSIVE_TARGETS): $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: +$(RECURSIVE_CLEAN_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ @@ -489,17 +490,19 @@ uninstall-am: uninstall-dist_perllibDATA uninstall-info-am \ uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-recursive ctags ctags-recursive \ - distclean distclean-generic distclean-recursive distclean-tags \ +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic ctags \ + ctags-recursive distclean distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am \ install-dist_perllibDATA install-exec install-exec-am \ install-info install-info-am install-man \ install-nodist_perllibDATA install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic maintainer-clean-recursive \ - mostlyclean mostlyclean-generic mostlyclean-recursive pdf \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-dist_perllibDATA uninstall-info-am \ uninstall-nodist_perllibDATA diff --git a/lib/Automake/Rule.pm b/lib/Automake/Rule.pm index 1dd3ce868..25372e5cf 100644 --- a/lib/Automake/Rule.pm +++ b/lib/Automake/Rule.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004 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 @@ -349,6 +349,8 @@ sub reset() # Phoning. '.PHONY' => [], + # Recursive install targets (so `make -n install' works for BSD Make). + '.MAKE' => [], ); %actions = (); } diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index fd74b802d..dd2c8fe4a 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -342,6 +342,8 @@ ps-am: uninstall-am: uninstall-info-am +.MAKE: install-am install-strip + .PHONY: all all-am check check-TESTS check-am clean clean-generic \ distclean distclean-generic distdir dvi dvi-am html html-am \ info info-am install install-am install-data install-data-am \ diff --git a/lib/Makefile.in b/lib/Makefile.in index e44c29c62..4ffb9fb86 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -71,6 +71,8 @@ am__installdirs = "$(DESTDIR)$(pkgvdatadir)" "$(DESTDIR)$(scriptdir)" dist_pkgvdataDATA_INSTALL = $(INSTALL_DATA) dist_scriptDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_pkgvdata_DATA) $(dist_script_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -246,8 +248,7 @@ $(RECURSIVE_TARGETS): $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: +$(RECURSIVE_CLEAN_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ @@ -466,17 +467,19 @@ uninstall-am: uninstall-dist_pkgvdataDATA uninstall-dist_scriptDATA \ uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-recursive ctags ctags-recursive \ - distclean distclean-generic distclean-recursive distclean-tags \ +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-data-am install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic ctags \ + ctags-recursive distclean distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-data-hook \ install-dist_pkgvdataDATA install-dist_scriptDATA install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installcheck-local \ installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic maintainer-clean-recursive \ - mostlyclean mostlyclean-generic mostlyclean-recursive pdf \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-dist_pkgvdataDATA uninstall-dist_scriptDATA \ uninstall-info-am diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in index 77e4d3051..63a06d6ca 100644 --- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -333,6 +333,8 @@ ps-am: uninstall-am: uninstall-dist_amDATA uninstall-info-am +.MAKE: install-am install-strip + .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ diff --git a/lib/am/install.am b/lib/am/install.am index 487ff28a7..7864e1af7 100644 --- a/lib/am/install.am +++ b/lib/am/install.am @@ -64,7 +64,7 @@ install-data: install-data-am uninstall: uninstall-am endif !%?SUBDIRS% -.PHONY: install-am +.MAKE .PHONY: install-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am @@ -78,7 +78,7 @@ install-am: all-am ## If you ever modify this, keep in mind that INSTALL_PROGRAM is used ## in subdirectories, so never set it to a value relative to the top ## directory. -.PHONY: install-strip +.MAKE .PHONY: install-strip install-strip: ## Beware that they are two variables used to install programs: ## INSTALL_PROGRAM is used for ordinary *_PROGRAMS diff --git a/lib/am/multilib.am b/lib/am/multilib.am index e483a9186..245f8bf6e 100644 --- a/lib/am/multilib.am +++ b/lib/am/multilib.am @@ -32,7 +32,7 @@ all-multi: install-multi: $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE) -.PHONY: all-multi install-multi +.MAKE .PHONY: all-multi install-multi mostlyclean-multi: @@ -44,7 +44,7 @@ distclean-multi: maintainer-clean-multi: $(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE) -.PHONY: mostlyclean-multi clean-multi distclean-multi maintainer-clean-multi +.MAKE .PHONY: mostlyclean-multi clean-multi distclean-multi maintainer-clean-multi install-exec-am: install-multi ## No uninstall rule? diff --git a/lib/am/subdirs.am b/lib/am/subdirs.am index c1150e724..19bcafbfd 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, 1997, 1998, 1999, 2000, 2001, 2003 +## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 ## Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify @@ -17,10 +17,12 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -RECURSIVE_TARGETS += \ -all-recursive check-recursive installcheck-recursive +RECURSIVE_TARGETS += all-recursive check-recursive installcheck-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive -.PHONY: $(RECURSIVE_TARGETS) +.PHONY: $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS) +.MAKE: $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -56,17 +58,13 @@ clean: clean-recursive distclean: distclean-recursive maintainer-clean: maintainer-clean-recursive -.PHONY: mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive - ## 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: +$(RECURSIVE_CLEAN_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ ## For distclean and maintainer-clean we make sure to use the full diff --git a/m4/Makefile.in b/m4/Makefile.in index a21814a63..6552d965d 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -328,6 +328,8 @@ ps-am: uninstall-am: uninstall-dist_m4dataDATA uninstall-info-am +.MAKE: install-am install-strip + .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ diff --git a/tests/Makefile.in b/tests/Makefile.in index da127626d..fc6dd2180 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -908,6 +908,8 @@ ps-am: uninstall-am: uninstall-info-am +.MAKE: install-am install-strip + .PHONY: all all-am check check-TESTS check-am clean clean-generic \ distclean distclean-generic distclean-local distdir dvi dvi-am \ html html-am info info-am install install-am install-data \