]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] cleanup: use .DEFAULT_GOAL to set the default rule
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 9 May 2012 09:55:38 +0000 (11:55 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 9 May 2012 11:12:45 +0000 (13:12 +0200)
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 <stefano.lattarini@gmail.com>
automake.in
lib/am/header-vars.am

index 483bb799c845d720a28f0b0f3ce8c53fdd964672..a47aedc007466594031a73aec5be633e0ecb58f7 100644 (file)
@@ -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.
index a0816398ae86ccb4fa7d1bbeb7429ba734abfce7..0d73850e61b44261bbbd8944ffd06ea1d3f9280f 100644 (file)
 
 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 = \