From: Alexandre Duret-Lutz Date: Mon, 29 Sep 2003 20:21:19 +0000 (+0000) Subject: * automake.in (handle_clean): Take $makefile as argument, and X-Git-Tag: Release-1-7b~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b872f6db55938c742c1c2100bd36af2cb60ddc9;p=thirdparty%2Fautomake.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 3a6cfaf8e..e9bddd3af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2003-09-29 Alexandre Duret-Lutz + + * 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 * doc/automake.texi (Scripts): Update the example about automake. diff --git a/NEWS b/NEWS index 69a5b7132..81d0f8a7b 100644 --- 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. diff --git a/automake.in b/automake.in index f241b7422..c1577c574 100755 --- a/automake.in +++ b/automake.in @@ -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 diff --git a/lib/am/clean.am b/lib/am/clean.am index b344e1460..04f90c9b5 100644 --- a/lib/am/clean.am +++ b/lib/am/clean.am @@ -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 diff --git a/tests/Makefile.am b/tests/Makefile.am index 9b972521e..4ccdcd2f3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -216,6 +216,7 @@ gcj5.test \ getopt.test \ gettext.test \ gettext2.test \ +gnumake.test \ gnuwarn.test \ gnuwarn2.test \ gnits.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index b69b1aa1f..fe674dc73 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 index 000000000..41701c86e --- /dev/null +++ b/tests/gnumake.test @@ -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