From ff4faf0a215a32ae9139a81f564fa48a173e5fac Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Wed, 7 Mar 2001 18:39:10 +0000 Subject: [PATCH] * automake.in (&handle_merge_targets): Ventilate its non `all' related content into... (&generate_makefile): here. (&handle_merge_targets): Rename as... (&handle_all): this. Remove a useless `if': `@all' is obviously not empty, since it contains at least the `basename ($makefile)' which has just been unshifted. --- ChangeLog | 12 ++++++ automake.in | 103 +++++++++++++++++++++++++--------------------------- 2 files changed, 62 insertions(+), 53 deletions(-) diff --git a/ChangeLog b/ChangeLog index fc80460c3..720c81d17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2001-03-07 Akim Demaille + + * automake.in (&handle_merge_targets): Ventilate its non `all' + related content into... + (&generate_makefile): here. + (&handle_merge_targets): Rename as... + (&handle_all): this. + Remove a useless `if': `@all' is obviously not empty, since it + contains at least the `basename ($makefile)' which has just been + unshifted. + + 2001-03-07 Akim Demaille * automake.in, aclocal.in: Backquote is inert in double quotes. diff --git a/automake.in b/automake.in index 2d4bf6a0f..c3fe5813e 100755 --- a/automake.in +++ b/automake.in @@ -1034,6 +1034,15 @@ sub generate_makefile return; } + # There are a few install-related variables that you should not define. + foreach my $var ('PRE_INSTALL', 'POST_INSTALL', 'NORMAL_INSTALL') + { + if (&variable_defined ($var)) + { + &am_line_error ($var, "`$var' should not be defined"); + } + } + # If OBJEXT/EXEEXT were not set in configure.in, do it, it # simplifies our task, and anyway starting with Autoconf 2.50, it # will always be defined, and this code will be dead. @@ -1085,7 +1094,16 @@ sub generate_makefile &handle_dist ($makefile); &handle_footer; - &handle_merge_targets ($output); + &do_check_merge_target; + &handle_all ($output); + + # FIXME: Gross! + if (&variable_defined('lib_LTLIBRARIES') && + &variable_defined('bin_PROGRAMS')) + { + $output_rules .= "install-binPROGRAMS: install-libLTLIBRARIES\n\n"; + } + &handle_installdirs; &handle_clean; &handle_factored_dependencies; @@ -3802,29 +3820,19 @@ sub handle_footer } # Deal with installdirs target. -sub handle_installdirs +sub handle_installdirs () { $output_rules .= &file_contents ('install', ('_am_installdirs' => $am_var_defs{'_am_installdirs'})); } -# There are several targets which need to be merged. This is because -# their complete definition is compiled from many parts. Note that we -# avoid double colon rules, otherwise we'd use them instead. -sub handle_merge_targets + +# Deal with all and all-am. +sub handle_all ($) { my ($makefile) = @_; - # There are a few install-related variables that you should not define. - foreach my $var ('PRE_INSTALL', 'POST_INSTALL', 'NORMAL_INSTALL') - { - if (&variable_defined ($var)) - { - &am_line_error ($var, "`$var' should not be defined"); - } - } - # Put this at the beginning for the sake of non-GNU makes. This # is still wrong if these makes can run parallel jobs. But it is # right enough. @@ -3836,44 +3844,33 @@ sub handle_merge_targets if dirname ($one_name) eq $relative_dir; } - &do_check_merge_target; - - if (@all || &variable_defined ('BUILT_SOURCES')) - { - my $local_headers = ''; - $local_headers = '$(BUILT_SOURCES)' - if &variable_defined ('BUILT_SOURCES'); - foreach my $one_name (@config_names) - { - if (dirname ($one_name) eq $relative_dir) - { - $local_headers .= ' ' if $local_headers; - $local_headers .= basename ($one_name); - } - } - if ($local_headers) - { - # We need to make sure config.h is built before we - # recurse. We also want to make sure that built sources - # are built before any ordinary `all' targets are run. We - # can't do this by changing the order of dependencies to - # the "all" because that breaks when using parallel makes. - # Instead we handle things explicitly. - $output_rules .= ("all-redirect: ${local_headers}" - . "\n\t" - . '$(MAKE) $(AM_MAKEFLAGS) ' - . (&variable_defined ('SUBDIRS') - ? 'all-recursive' : 'all-am') - . "\n\n"); - $all_target = 'all-redirect'; - &depend ('.PHONY', 'all-redirect'); - } - } - - if (&variable_defined('lib_LTLIBRARIES') && - &variable_defined('bin_PROGRAMS')) - { - $output_rules .= "install-binPROGRAMS: install-libLTLIBRARIES\n\n"; + my $local_headers = ''; + $local_headers = '$(BUILT_SOURCES)' + if &variable_defined ('BUILT_SOURCES'); + foreach my $one_name (@config_names) + { + if (dirname ($one_name) eq $relative_dir) + { + $local_headers .= ' ' if $local_headers; + $local_headers .= basename ($one_name); + } + } + if ($local_headers) + { + # We need to make sure config.h is built before we + # recurse. We also want to make sure that built sources + # are built before any ordinary `all' targets are run. We + # can't do this by changing the order of dependencies to + # the "all" because that breaks when using parallel makes. + # Instead we handle things explicitly. + $output_rules .= ("all-redirect: ${local_headers}" + . "\n\t" + . '$(MAKE) $(AM_MAKEFLAGS) ' + . (&variable_defined ('SUBDIRS') + ? 'all-recursive' : 'all-am') + . "\n\n"); + $all_target = 'all-redirect'; + &depend ('.PHONY', 'all-redirect'); } # Install `all' hooks. -- 2.47.2