From: Stefano Lattarini Date: Wed, 9 May 2012 09:55:38 +0000 (+0200) Subject: [ng] cleanup: use .DEFAULT_GOAL to set the default rule X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b8c7705ccca9e8bf0cef0a6a4cfa0e6dc24bf9a;p=thirdparty%2Fautomake.git [ng] cleanup: use .DEFAULT_GOAL to set the default rule This change should introduce no semantic change, but allows a minor simplification in automake.in. * automake.in ($output_all): Don't define nor use anymore, its role and function merged with '$output_rules'. * lib/am/header-vars.am (.DEFAULT_GOAL): Define to 'all'. Signed-off-by: Stefano Lattarini --- diff --git a/automake.in b/automake.in index 483bb799c..a47aedc00 100644 --- a/automake.in +++ b/automake.in @@ -496,7 +496,6 @@ my $output_deps_greatest_timestamp; # These variables are used when generating each Makefile.in. # They hold the Makefile.in until it is ready to be printed. my $output_vars; -my $output_all; my $output_header; my $output_rules; my $output_trailer; @@ -647,7 +646,6 @@ sub initialize_per_input () $output_deps_greatest_timestamp = 0; $output_vars = ''; - $output_all = ''; $output_header = ''; $output_rules = ''; $output_trailer = ''; @@ -4476,15 +4474,15 @@ sub handle_all ($) # by changing the order of dependencies to the "all" because # that breaks when using parallel makes. Instead we handle # things explicitly. - $output_all .= ("all: @local_headers" - . "\n\t\$(MAKE) " - . (var ('SUBDIRS') ? 'all-recursive' : 'all-am') - . "\n\n"); + $output_rules .= ("all: @local_headers" + . "\n\t\$(MAKE) " + . (var ('SUBDIRS') ? 'all-recursive' : 'all-am') + . "\n\n"); } else { - $output_all .= "all: " . (var ('SUBDIRS') - ? 'all-recursive' : 'all-am') . "\n\n"; + $output_rules .= "all: " . (var ('SUBDIRS') + ? 'all-recursive' : 'all-am') . "\n\n"; } } @@ -7988,7 +7986,7 @@ sub generate_makefile ($$) # We make sure that 'all:' is the first target. my $output = - "$output_vars$output_all$output_header$output_rules$output_trailer"; + "$output_vars$output_header$output_rules$output_trailer"; # Decide whether we must update the output file or not. # We have to update in the following situations. diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am index a0816398a..0d73850e6 100644 --- a/lib/am/header-vars.am +++ b/lib/am/header-vars.am @@ -16,6 +16,10 @@ VPATH = @srcdir@ +## The 'all' target must be the default one, independently from the +## position it is declared in the output Makefile. +.DEFAULT_GOAL := all + ## Emulate VPATH rewrites. This uses only GNU make primitives, which ## allows us to avoid extra forks. am__vpath_rewrite = \