]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* automake.in (handle_clean): Take $makefile as argument, and
authorAlexandre Duret-Lutz <adl@gnu.org>
Mon, 29 Sep 2003 20:21:19 +0000 (20:21 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Mon, 29 Sep 2003 20:21:19 +0000 (20:21 +0000)
define %MAKEFILE% while processing clean.am.
(generate_makefile): Pass $makefile to handle_clean.
* lib/am/clean.am (distclean, maintainer-clean): Erase %MAKEFILE%,
not Makefile.
* tests/gnumake.test: New file.
* tests/Makefile.am (TESTS): Add gnumake.test.
Report from Braden N. McDaniel.

ChangeLog
NEWS
automake.in
lib/am/clean.am
tests/Makefile.am
tests/Makefile.in
tests/gnumake.test [new file with mode: 0755]

index 3a6cfaf8e2281a621309b97ce83279d61c3dcc47..e9bddd3af3678b58bec539a519b3f13e4782a4fb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2003-09-29  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * automake.in (handle_clean): Take $makefile as argument, and
+       define %MAKEFILE% while processing clean.am.
+       (generate_makefile): Pass $makefile to handle_clean.
+       * lib/am/clean.am (distclean, maintainer-clean): Erase %MAKEFILE%,
+       not Makefile.
+       * tests/gnumake.test: New file.
+       * tests/Makefile.am (TESTS): Add gnumake.test.
+       Report from Braden N. McDaniel.
+
 2003-09-26  Alexandre Duret-Lutz  <adl@gnu.org>
 
        * doc/automake.texi (Scripts): Update the example about automake.
diff --git a/NEWS b/NEWS
index 69a5b713212a4084da5185942218c0f35b2a8622..81d0f8a7b5764c1c691abbe0050bb99f5da39fd8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -166,6 +166,8 @@ New in 1.7a:
   - The --no-force option now correctly checks the Makefile.in's
     dependencies before deciding not to update it.
 
+  - Do not assume that make files are called Makefile in cleaning rules.
+
 * Miscellaneous
 
   - The Automake manual is now distributed under the terms of the GNU FDL.
index f241b7422fc682b26265ca7afc0608f406f9d65b..c1577c57447f150e9bfa3ccd504b15561ebe63e6 100755 (executable)
@@ -3879,9 +3879,13 @@ sub do_check_merge_target ()
                    . "\n");
 }
 
+# handle_clean ($MAKEFILE)
+# ------------------------
 # Handle all 'clean' targets.
-sub handle_clean
+sub handle_clean ($)
 {
+  my ($makefile) = @_;
+
   # Clean the files listed in user variables if they exist.
   $clean_files{'$(MOSTLYCLEANFILES)'} = MOSTLY_CLEAN
     if var ('MOSTLYCLEANFILES');
@@ -3922,7 +3926,9 @@ sub handle_clean
      MOSTLYCLEAN_RMS      => join ('', @{$rms{&MOSTLY_CLEAN}}),
      CLEAN_RMS            => join ('', @{$rms{&CLEAN}}),
      DISTCLEAN_RMS        => join ('', @{$rms{&DIST_CLEAN}}),
-     MAINTAINER_CLEAN_RMS => join ('', @{$rms{&MAINTAINER_CLEAN}}));
+     MAINTAINER_CLEAN_RMS => join ('', @{$rms{&MAINTAINER_CLEAN}}),
+     MAKEFILE             => basename $makefile,
+     );
 }
 
 
@@ -6638,7 +6644,7 @@ sub generate_makefile ($$)
     }
 
   handle_install;
-  handle_clean;
+  handle_clean ($makefile);
   handle_factored_dependencies;
 
   # Comes last, because all the above procedures may have
index b344e1460648b25790a8b7a8bb6db019cc168744..04f90c9b52b5c65572b70c1b992f29b37ee7e761 100644 (file)
@@ -41,7 +41,7 @@ distclean-generic:
 ## If you change distclean here, you probably also want to change
 ## maintainer-clean below.
 distclean:
-       -rm -f Makefile
+       -rm -f %MAKEFILE%
 
 maintainer-clean-am: maintainer-clean-generic distclean-am
 maintainer-clean-generic:
@@ -53,7 +53,7 @@ maintainer-clean-generic:
 
 ## See comment for distclean.
 maintainer-clean:
-       -rm -f Makefile
+       -rm -f %MAKEFILE%
 
 .PHONY: clean mostlyclean distclean maintainer-clean \
 clean-generic mostlyclean-generic distclean-generic maintainer-clean-generic
index 9b972521e886de32e0e86d0a6f5e48374370e49f..4ccdcd2f3bf2d1a00e7ead39f1e3facc080d479d 100644 (file)
@@ -216,6 +216,7 @@ gcj5.test \
 getopt.test \
 gettext.test \
 gettext2.test \
+gnumake.test \
 gnuwarn.test \
 gnuwarn2.test \
 gnits.test \
index b69b1aa1f9abe8bc3f40ab6099d67fe47a8554a0..fe674dc73b32dae9ae1ad7a7729c9197a89652d3 100644 (file)
@@ -326,6 +326,7 @@ gcj5.test \
 getopt.test \
 gettext.test \
 gettext2.test \
+gnumake.test \
 gnuwarn.test \
 gnuwarn2.test \
 gnits.test \
diff --git a/tests/gnumake.test b/tests/gnumake.test
new file mode 100755 (executable)
index 0000000..41701c8
--- /dev/null
@@ -0,0 +1,49 @@
+#! /bin/sh
+# Copyright (C) 2003  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Automake should not assume that make files are called Makefile.
+# Report from Braden McDaniel.
+
+required=GNUmake
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/GNUmakefile])
+AC_OUTPUT
+END
+
+mkdir sub
+
+echo SUBDIRS = sub > Makefile.am
+
+cat > sub/GNUmakefile.am <<'EOF'
+# In this project, the Makefile is an installed data file.
+dist_data_DATA = Makefile
+EOF
+
+echo 'this should not cause any problem' > sub/Makefile
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE distcheck