automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

09-handle-all.patch


From: Akim Demaille
Subject: 09-handle-all.patch
Date: Tue, 06 Mar 2001 08:35:09 +0100

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * 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': address@hidden' is obviously not empty, since it
        contains at least the `basename ($makefile)' which has just been
        unshifted.
        
        
Index: automake.in
--- automake.in Tue, 06 Mar 2001 00:51:06 +0100 akim (am/f/39_automake.i 1.117 
755)
+++ automake.in Tue, 06 Mar 2001 01:11:43 +0100 akim (am/f/39_automake.i 1.117 
755)
@@ -1036,6 +1036,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.
@@ -1087,7 +1096,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;
@@ -3804,7 +3822,7 @@ sub handle_footer
 }
 
 # Deal with installdirs target.
-sub handle_installdirs
+sub handle_installdirs ()
 {
     $output_rules .=
       &file_contents ('install',
@@ -3812,22 +3830,12 @@ sub handle_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.
@@ -3839,44 +3847,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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]