]> sourceware.org Git - automake.git/commitdiff
Declare recursive install targets as dependencies of `.MAKE', so
authorAlexandre Duret-Lutz <adl@gnu.org>
Mon, 27 Dec 2004 20:38:18 +0000 (20:38 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Mon, 27 Dec 2004 20:38:18 +0000 (20:38 +0000)
that `make -n install' works with BSD Make too.

14 files changed:
ChangeLog
Makefile.in
automake.in
doc/Makefile.in
lib/Automake/Makefile.in
lib/Automake/Rule.pm
lib/Automake/tests/Makefile.in
lib/Makefile.in
lib/am/Makefile.in
lib/am/install.am
lib/am/multilib.am
lib/am/subdirs.am
m4/Makefile.in
tests/Makefile.in

index 4a211520429d7af89e951993ec92ea1042cc094f..99c1d8db28db0f669a508330993fa1b503baba69 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2004-12-27  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       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  <adl@gnu.org>
 
        * lib/config-ml.in, lib/config.guess, lib/config.sub,
index d59bf7c175aea928d7a1c9bec13fb7d56adb1814..6c67948490f98e731d1ea6bda7f2865458c6998d 100644 (file)
@@ -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
 
index 2ac77c54eac6d50767307b2a2d516aaae1e3d703..b9eca7c66aac5d05847c1cf8b94db3738d7667ce 100755 (executable)
@@ -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',
index 050c131e3adc17486597b8036979f38a06be266b..3ca7f750763319f91f178ff42436b12cf5301d2c 100644 (file)
@@ -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 \
index bcfc3b85f87c8f672d67870a8de1095c352c7e3b..352e732274f81155f3593e6cc9b84d9f337752ab 100644 (file)
@@ -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
index 1dd3ce8683fd94a79e6880bea767a89951875b86..25372e5cf6097bed6e27975a0310aa2081b44a6c 100644 (file)
@@ -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 = ();
 }
index fd74b802de527efcc2106a98f46dccc71f1363d8..dd2c8fe4a3d853c24952847f311450d8da513420 100644 (file)
@@ -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 \
index e44c29c6296508bcba093913710514d117f8f900..4ffb9fb868a27fcc820898cde7eee38a75318627 100644 (file)
@@ -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
index 77e4d3051a996e0eb33a13701b3204bc432ea8d8..63a06d6ca53d82234eab6531b5318a8770e17892 100644 (file)
@@ -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 \
index 487ff28a74e41490b5ebe294a15aef0564e46425..7864e1af76c84b003c31f5d3b869e04affadfa13 100644 (file)
@@ -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
index e483a91867f8bab34d2bb5f299711dbb10993c95..245f8bf6e5aea378920d410c466d5f3fa6e722ee 100644 (file)
@@ -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?
index c1150e724f50a068817a2f948a2d3ef353a4c48b..19bcafbfd8df3e832234995f4fc57f1e94f06a17 100644 (file)
@@ -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
 ## 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
index a21814a6354de85b95084c4c33843cdebd718464..6552d965d4c611ff4b3b866830fbd6bc38d6a0fb 100644 (file)
@@ -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 \
index da127626d07a08432d2d8b2266b75781cf1ef57f..fc6dd218011b69d9c2bbe52ca7429ad49da33ab4 100644 (file)
@@ -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 \
This page took 0.052471 seconds and 5 git commands to generate.