Code cleanup after removal of option `--output-directory'.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 18 Nov 2010 17:09:14 +0000 (18:09 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 20 Nov 2010 11:05:12 +0000 (12:05 +0100)
* automake.in ($output_directory): Remove, it's unconditionally
defined to `.' and used only ...
(generate_makefile): ... in this subroutine, which now has been
edited and simplified accordingly.

ChangeLog
automake.in

index dd49a05..a45b4bf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2010-11-20  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       Code cleanup after removal of option `--output-directory'.
+       * automake.in ($output_directory): Remove, it's unconditionally
+       defined to `.' and used only ...
+       (generate_makefile): ... in this subroutine, which now has been
+       edited and simplified accordingly.
+
        Remove obsolete automake option `--output-directory'.
        This option has been deprecated since version 1.7 (2002/2003).
        * automake.in ($output_directory): Define to `.' unconditionally.
index 609e100..5c44767 100644 (file)
@@ -330,10 +330,6 @@ my @config_headers = ();
 # Names used in AC_CONFIG_LINKS call.
 my @config_links = ();
 
-# Directory where output files go.  Actually, output files are
-# relative to this directory.
-my $output_directory = '.';
-
 # List of Makefile.am's to process, and their corresponding outputs.
 my @input_files = ();
 my %output_files = ();
@@ -8280,18 +8276,13 @@ sub generate_makefile ($$)
 
   check_typos;
 
-  my ($out_file) = $output_directory . '/' . $makefile_in;
-
   if ($exit_code != 0)
     {
-      verb "not writing $out_file because of earlier errors";
+      verb "not writing $makefile_in because of earlier errors";
       return;
     }
 
-  if (! -d ($output_directory . '/' . $am_relative_dir))
-    {
-      mkdir ($output_directory . '/' . $am_relative_dir, 0755);
-    }
+  mkdir ($am_relative_dir, 0755) if ! -d $am_relative_dir;
 
   # We make sure that `all:' is the first target.
   my $output =
@@ -8310,25 +8301,25 @@ sub generate_makefile ($$)
   #  * other dependencies, specific to the Makefile.am being processed
   #    (such as the Makefile.am itself, or any Makefile fragment
   #    it includes).
-  my $timestamp = mtime $out_file;
+  my $timestamp = mtime $makefile_in;
   if (! $force_generation
       && $configure_deps_greatest_timestamp < $timestamp
       && $output_deps_greatest_timestamp < $timestamp
-      && $output eq contents ($out_file))
+      && $output eq contents ($makefile_in))
     {
-      verb "$out_file unchanged";
+      verb "$makefile_in unchanged";
       # No need to update.
       return;
     }
 
-  if (-e $out_file)
+  if (-e $makefile_in)
     {
-      unlink ($out_file)
-       or fatal "cannot remove $out_file: $!";
+      unlink ($makefile_in)
+       or fatal "cannot remove $makefile_in: $!";
     }
 
-  my $gm_file = new Automake::XFile "> $out_file";
-  verb "creating $out_file";
+  my $gm_file = new Automake::XFile "> $makefile_in";
+  verb "creating $makefile_in";
   print $gm_file $output;
 }