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-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.
- 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.
. "\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');
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,
+ );
}
}
handle_install;
- handle_clean;
+ handle_clean ($makefile);
handle_factored_dependencies;
# Comes last, because all the above procedures may have
## 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:
## 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
getopt.test \
gettext.test \
gettext2.test \
+gnumake.test \
gnuwarn.test \
gnuwarn2.test \
gnits.test \
getopt.test \
gettext.test \
gettext2.test \
+gnumake.test \
gnuwarn.test \
gnuwarn2.test \
gnits.test \
--- /dev/null
+#! /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