From 9bb25e493a8debf31d3507ddf84c432c1bd5fd01 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 26 Feb 2001 09:30:01 +0000 Subject: [PATCH] * automake.in (&handle_merge_targets, &do_one_merge_target): Don't work on targets handled by %dependencies. (&handle_factored_dependencies): Do it. * install.am: Install install-exec, install-data and uninstall's suites. --- ChangeLog | 8 +++++ Makefile.in | 7 ++-- automake.in | 86 ++++++++++++++++++++++++----------------------- install.am | 22 ++++++++++++ lib/am/install.am | 22 ++++++++++++ m4/Makefile.in | 7 ++-- tests/Makefile.in | 18 +++++----- 7 files changed, 114 insertions(+), 56 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4178947a..b5a9960e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-02-26 Akim Demaille + + * automake.in (&handle_merge_targets, &do_one_merge_target): Don't + work on targets handled by %dependencies. + (&handle_factored_dependencies): Do it. + * install.am: Install install-exec, install-data and uninstall's + suites. + 2001-02-26 Akim Demaille * automake.in (&handle_merge_targets): Move `install-strip' from diff --git a/Makefile.in b/Makefile.in index f9c4853b..32db1067 100644 --- a/Makefile.in +++ b/Makefile.in @@ -502,18 +502,19 @@ check-am: all-am check: check-recursive installcheck-am: installcheck-local installcheck: installcheck-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive -uninstall: uninstall-recursive all-am: Makefile $(INFO_DEPS) $(SCRIPTS) $(DATA) installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(infodir) $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(scriptdir) +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install diff --git a/automake.in b/automake.in index c5aa6013..08fabd56 100755 --- a/automake.in +++ b/automake.in @@ -3605,23 +3605,6 @@ sub handle_merge_targets "\`install-info-local' target defined but \`no-installinfo' option not in use"); } - foreach my $utarg ('uninstall-data-local', 'uninstall-data-hook', - 'uninstall-exec-local', 'uninstall-exec-hook') - { - if (&target_defined ($utarg)) - { - my $x = $utarg; - $x =~ s/(data|exec)-//; - &am_line_error ($utarg, "use \`$x', not \`$utarg'"); - } - } - - if (&target_defined ('install-local')) - { - &am_line_error ('install-local', - "use \`install-data-local' or \`install-exec-local', not \`install-local'"); - } - if (@all || &variable_defined ('BUILT_SOURCES')) { my $local_headers = ''; @@ -3660,11 +3643,7 @@ sub handle_merge_targets $output_rules .= "install-binPROGRAMS: install-libLTLIBRARIES\n\n"; } # Print definitions users can use. - &do_one_merge_target ('install-exec'); - &do_one_merge_target ('install-data'); - &do_one_merge_target ('install', 'all-am'); - &do_one_merge_target ('uninstall'); &do_one_merge_target ('all', @all); } @@ -3706,20 +3685,6 @@ sub do_one_merge_target &pretty_print_rule ("\t\@\$(MAKE) \$(AM_MAKEFLAGS)", "\t ", 'install-exec-am', 'install-data-am'); } - elsif ($name eq 'install-exec' && &target_defined ('install-exec-hook')) - { - $actions{'install-exec-am'} .= - ("\t\@\$(NORMAL_INSTALL)\n" - . "\t" . '$(MAKE) $(AM_MAKEFLAGS) install-exec-hook' - . "\n"); - } - elsif ($name eq 'install-data' && &target_defined ('install-data-hook')) - { - $actions{'install-data-am'} .= - ("\t\@\$(NORMAL_INSTALL)\n" - . "\t" . '$(MAKE) $(AM_MAKEFLAGS) install-data-hook' - . "\n"); - } # To understand this special case, see handle_merge_targets. if ($name eq 'all') @@ -3816,12 +3781,6 @@ sub handle_clean $output_rules .= &file_contents ('clean', $xform); - foreach ('clean', 'distclean', 'mostlyclean', 'maintainer-clean') - { - &depend ("$_-am", "$_-local") - if &target_defined ("$_-local"); - } - # We special-case config.status here. If we do it as part of the # normal clean processing for this directory, then it might be # removed before some subdir is cleaned. However, that subdir's @@ -3863,9 +3822,52 @@ sub target_cmp ($$) # &handle_factored_dependencies () # -------------------------------- -# Handle .PHONY target. +# Handle everything related to gathered targets. sub handle_factored_dependencies { + # Reject bad hooks. + foreach my $utarg ('uninstall-data-local', 'uninstall-data-hook', + 'uninstall-exec-local', 'uninstall-exec-hook') + { + if (&target_defined ($utarg)) + { + my $x = $utarg; + $x =~ s/(data|exec)-//; + &am_line_error ($utarg, "use \`$x', not \`$utarg'"); + } + } + + if (&target_defined ('install-local')) + { + &am_line_error ('install-local', + "use \`install-data-local' or \`install-exec-local', not \`install-local'"); + } + + # Install the -local hooks. + foreach (keys %dependencies) + { + # Hooks are installed on the -am targets. + s/-am$// or next; + if (&target_defined ("$_-local")) + { + depend ("$_-am", "$_-local"); + &depend ('.PHONY', "$_-local"); + } + } + + # Install the -hook hooks. + # FIXME: Why not be as liberal as we are with -local hooks? + foreach ('install-exec', 'install-data') + { + if (&target_defined ("$_-hook")) + { + $actions{"$_-am"} .= + ("\t\@\$(NORMAL_INSTALL)\n" + . "\t" . '$(MAKE) $(AM_MAKEFLAGS) ' . "$_-hook\n"); + } + } + + # Actually output gathered targets. foreach (sort target_cmp keys %dependencies) { # If there is nothing about this guy, skip it. diff --git a/install.am b/install.am index e661f501..7b8da0af 100644 --- a/install.am +++ b/install.am @@ -16,6 +16,9 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. +## -------------------------- ## +## Creating the installdirs. ## +## -------------------------- ## ?SUBDIRS?.PHONY: installdirs installdirs-am installdirs-recursive ?SUBDIRS?installdirs: installdirs-recursive ?SUBDIRS?installdirs-am: @@ -25,6 +28,25 @@ ?!SUBDIRS?installdirs: ?!SUBDIRS??_am_installdirs? $(mkinstalldirs) @_am_installdirs@ + +## ----------------- ## +## Install targets. ## +## ----------------- ## + +.PHONY: install install-exec install-data uninstall + +?SUBDIRS?.PHONY: install-recursive install-exec-recursive install-data-recursive uninstall-recursive +## FIXME: not ready: ?SUBDIRS?install: install-recursive +?SUBDIRS?install-exec: install-exec-recursive +?SUBDIRS?install-data: install-data-recursive +?SUBDIRS?uninstall: uninstall-recursive + +.PHONY: install-am install-exec-am install-data-am uninstall-am +## FIXME: not ready: ?!SUBDIRS?install: install-am +?!SUBDIRS?install-exec: install-exec-am +?!SUBDIRS?install-data: install-data-am +?!SUBDIRS?uninstall: uninstall-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. diff --git a/lib/am/install.am b/lib/am/install.am index e661f501..7b8da0af 100644 --- a/lib/am/install.am +++ b/lib/am/install.am @@ -16,6 +16,9 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. +## -------------------------- ## +## Creating the installdirs. ## +## -------------------------- ## ?SUBDIRS?.PHONY: installdirs installdirs-am installdirs-recursive ?SUBDIRS?installdirs: installdirs-recursive ?SUBDIRS?installdirs-am: @@ -25,6 +28,25 @@ ?!SUBDIRS?installdirs: ?!SUBDIRS??_am_installdirs? $(mkinstalldirs) @_am_installdirs@ + +## ----------------- ## +## Install targets. ## +## ----------------- ## + +.PHONY: install install-exec install-data uninstall + +?SUBDIRS?.PHONY: install-recursive install-exec-recursive install-data-recursive uninstall-recursive +## FIXME: not ready: ?SUBDIRS?install: install-recursive +?SUBDIRS?install-exec: install-exec-recursive +?SUBDIRS?install-data: install-data-recursive +?SUBDIRS?uninstall: uninstall-recursive + +.PHONY: install-am install-exec-am install-data-am uninstall-am +## FIXME: not ready: ?!SUBDIRS?install: install-am +?!SUBDIRS?install-exec: install-exec-am +?!SUBDIRS?install-data: install-data-am +?!SUBDIRS?uninstall: uninstall-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. diff --git a/m4/Makefile.in b/m4/Makefile.in index af62a557..04c64cf9 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -151,17 +151,18 @@ check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am -install-exec: install-exec-am -install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am -uninstall: uninstall-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(m4datadir) +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install diff --git a/tests/Makefile.in b/tests/Makefile.in index 53c42084..51a332f2 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -456,16 +456,17 @@ check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am -install-exec: install-exec-am -install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am -uninstall: uninstall-am all-am: Makefile installdirs: +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_PROGRAM_ENV='$(INSTALL_STRIP_PROGRAM_ENV)' install @@ -485,11 +486,12 @@ maintainer-clean-generic: maintainer-clean-am: distclean-am maintainer-clean-generic .PHONY: all all-am check check-TESTS check-am clean clean-generic \ - distclean distclean-generic distdir dvi dvi-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic uninstall uninstall-am + distclean distclean-generic distclean-local distdir dvi dvi-am \ + info info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + uninstall uninstall-am install-man: -- 2.43.5