]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* Makefile.am (maintainer-check): Changed code to be acceptable to
authorTom Tromey <tromey@redhat.com>
Wed, 28 Oct 1998 00:47:35 +0000 (00:47 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 28 Oct 1998 00:47:35 +0000 (00:47 +0000)
bash 2.01.1.
* automake.in (do_one_clean_target): Special-case config.status.
Report from Jeff Garzik.

ChangeLog
Makefile.am
Makefile.in
TODO
automake.in
lib/am/Makefile.am

index 3d75a2ae6238bf48776cd8acaffc54f198b2570a..b4635944368a3811ddbb6524212ffd43c9d92fce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 1998-10-28  Tom Tromey  <tromey@cygnus.com>
 
+       * Makefile.am (maintainer-check): Changed code to be acceptable to
+       bash 2.01.1.
+
+       * automake.in (do_one_clean_target): Special-case config.status.
+       Report from Jeff Garzik.
+
        * m4/Makefile.am (m4data_DATA): Don't mention f77.m4.
        * m4/f77.m4: Removed; macro now in autoconf proper.
 
index 954ee739e9bc547d3783561d8081d32c3472119e..e0414c69c317990e934c7e5af6490474802e3fd7 100644 (file)
@@ -66,7 +66,8 @@ maintainer-check: automake aclocal
        $(PERL) -c -w aclocal
 ## expect no instances of '${...}'.  However, $${...} is ok, since that
 ## is a shell construct, not a Makefile construct.
-       @if test `fgrep '$${' $(srcdir)/[a-z]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \
+## The backslash in `$${' is needed for some versions of bash.
+       @if test `fgrep '\$${' $(srcdir)/[a-z]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \
          echo "found too many uses of '\$${'" 1>&2; \
          exit 1;                               \
        else :; fi
index 6719a63107946de322d0a41fc940633e8dc8b8d5..5b22f371501c9124d9d57df22549ff38658d6b09 100644 (file)
@@ -593,7 +593,7 @@ maintainer-check: automake aclocal
        fi
        $(PERL) -c -w automake
        $(PERL) -c -w aclocal
-       @if test `fgrep '$${' $(srcdir)/[a-z]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \
+       @if test `fgrep '\$${' $(srcdir)/[a-z]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \
          echo "found too many uses of '\$${'" 1>&2; \
          exit 1;                               \
        else :; fi
diff --git a/TODO b/TODO
index 53aeb35b39649c04c1bd95a71a24315c539b9ede..0dae1702769ecbea2a2a60f68b94e49e7a9ba366 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,3 +1,11 @@
+* distclean must remove config.status
+  can't this cause problems for maintainer-clean?
+  shouldn't maintainer-clean print the message before running
+  any part of the make?  (just to slow things down long enough
+  for the user to stop it)
+  (maybe doesn't matter since people who even know about
+  maintainer-clean already have a clue)
+
 * There are probably more bugs in variable_conditions_sub along
   the lines of the one that caused cond4.test to fail.
 
index f8d6e0e7fa53dc7a7afb5eaefa072956587def0e..de651fa34872c6d218badf2c29133c96e216e739 100755 (executable)
@@ -339,14 +339,14 @@ die "automake: no \`Makefile.am' found or specified\n"
 if ($generate_deps)
 {
     die "automake: Must specify --include-deps (or -i) when generating\n"
-      if ($use_dependencies);
+       if $use_dependencies;
     die "automake: Must provide --build-dir when generating\n"
-      if (!$build_directory);
+       if ! $build_directory;
     die "automake: Must provide --srcdir-name when generating\n"
-      if (!$srcdir_name);
+       if ! $srcdir_name;
 
     open (GDEP, ">$output_directory/.dep_segment")
-      || die "automake: Could not open `$output_directory/.dep_segment': $!\n";
+       || die "automake: Could not open `$output_directory/.dep_segment': $!\n";
 
     &handle_dependencies;
     print GDEP $output_rules;
@@ -3598,19 +3598,29 @@ sub do_one_clean_target
            ("\t\@echo \"This command is intended for maintainers to use;\"\n"
             . "\t\@echo \"it deletes files that may require special "
             . "tools to rebuild.\"\n");
-
-       $output_rules .= "\t-rm -f config.status\n"
-           if $relative_dir eq '.';
     }
     elsif ($name . $target eq 'distclean')
     {
-       $output_rules .= "\t-rm -f config.status\n";
        $output_rules .= "\t-rm -f libtool\n" if $seen_libtool;
     }
     $output_rules .= "\n";
+
+    # Now generate the actual clean target.
     $output_rules .= ($name . $target . ": " . $name . $target
                      . ($recursive_install ? '-recursive' : '-am')
-                     . "\n\n");
+                     . "\n");
+
+    # We special-case config.status here.  If we do it as part of the
+    # normal clean processing for this directory, then it might be
+    # removed before some subdir is cleaned.  However, that subdir's
+    # Makefile depends on config.status.
+    if (($name . $target eq 'maintainer-clean'
+        || $name . $target eq 'distclean')
+       && $relative_dir eq '.')
+    {
+       $output_rules .= "\t-rm -f config.status\n";
+    }
+    $output_rules .= "\n";
 }
 
 # Handle .PHONY target.
index 954ee739e9bc547d3783561d8081d32c3472119e..e0414c69c317990e934c7e5af6490474802e3fd7 100644 (file)
@@ -66,7 +66,8 @@ maintainer-check: automake aclocal
        $(PERL) -c -w aclocal
 ## expect no instances of '${...}'.  However, $${...} is ok, since that
 ## is a shell construct, not a Makefile construct.
-       @if test `fgrep '$${' $(srcdir)/[a-z]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \
+## The backslash in `$${' is needed for some versions of bash.
+       @if test `fgrep '\$${' $(srcdir)/[a-z]*.am | fgrep -v '$$$$' | wc -l` -ne 0; then \
          echo "found too many uses of '\$${'" 1>&2; \
          exit 1;                               \
        else :; fi