[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: do not write Makefile.in on error
From: |
Alexandre Duret-Lutz |
Subject: |
FYI: do not write Makefile.in on error |
Date: |
Fri, 14 May 2004 00:02:22 +0200 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) |
This will probably unveil a lot of errors that should be warnings.
That's why I'm not installing it on branch-1-8.
2004-05-13 Alexandre Duret-Lutz <address@hidden>
* automake.in (generate_makefile): Do not output Makefile.in on
errors.
* tests/werror2.test: New file.
* tests/Makefile.am (TESTS): Add werror2.test.
* tests/substtarg.test, tests/cond36.test, tests/backsl4.test:
Adjust to run automake with -Wno-error when the output is expected
in spite of the error.
Report from Harlan Stenn.
Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.270
diff -u -r1.270 NEWS
--- NEWS 24 Apr 2004 14:18:50 -0000 1.270
+++ NEWS 13 May 2004 21:59:52 -0000
@@ -61,6 +61,11 @@
Non-augmented variables are still output as they are defined in
the Makefile.am.
+
+* Automake stops writing Makefile.ins as soons as it encounters an error.
+ (Warnings will not prevent output, but remember they can be turned into
+ errors with -Werror.)
+
New in 1.8:
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1556
diff -u -r1.1556 automake.in
--- automake.in 13 May 2004 20:38:18 -0000 1.1556
+++ automake.in 13 May 2004 21:59:56 -0000
@@ -7131,13 +7131,19 @@
check_typos;
+ my ($out_file) = $output_directory . '/' . $makefile_in;
+
+ if ($exit_code != 0)
+ {
+ verb "not writing $out_file because of earlier errors";
+ return;
+ }
+
if (! -d ($output_directory . '/' . $am_relative_dir))
{
mkdir ($output_directory . '/' . $am_relative_dir, 0755);
}
- my ($out_file) = $output_directory . '/' . $makefile_in;
-
# We make sure that `all:' is the first target.
my $output =
"$output_vars$output_all$output_header$output_rules$output_trailer";
@@ -7160,7 +7166,7 @@
&& $configure_deps_greatest_timestamp < $timestamp
&& $output_deps_greatest_timestamp < $timestamp
&& $output eq contents ($out_file))
- {
+ {
verb "$out_file unchanged";
# No need to update.
return;
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.559
diff -u -r1.559 Makefile.am
--- tests/Makefile.am 24 Apr 2004 14:18:52 -0000 1.559
+++ tests/Makefile.am 13 May 2004 21:59:56 -0000
@@ -532,6 +532,7 @@
vtexi2.test \
warnopts.test \
werror.test \
+werror2.test \
whoami.test \
xsource.test \
yacc.test \
Index: tests/Makefile.in
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.in,v
retrieving revision 1.721
diff -u -r1.721 Makefile.in
--- tests/Makefile.in 13 May 2004 20:14:08 -0000 1.721
+++ tests/Makefile.in 13 May 2004 21:59:57 -0000
@@ -649,6 +649,7 @@
vtexi2.test \
warnopts.test \
werror.test \
+werror2.test \
whoami.test \
xsource.test \
yacc.test \
Index: tests/backsl4.test
===================================================================
RCS file: /cvs/automake/automake/tests/backsl4.test,v
retrieving revision 1.3
diff -u -r1.3 backsl4.test
--- tests/backsl4.test 6 Sep 2003 05:36:57 -0000 1.3
+++ tests/backsl4.test 13 May 2004 21:59:57 -0000
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -45,6 +45,7 @@
AUTOMAKE_fails
grep ':1:.*whitespace' stderr
grep ':5:.*whitespace' stderr
+$AUTOMAKE -Wno-error
./configure
# Older versions of Automake used to produce invalid Makefiles such input.
$MAKE ok
Index: tests/cond36.test
===================================================================
RCS file: /cvs/automake/automake/tests/cond36.test,v
retrieving revision 1.1
diff -u -r1.1 cond36.test
--- tests/cond36.test 29 Feb 2004 19:10:21 -0000 1.1
+++ tests/cond36.test 13 May 2004 21:59:57 -0000
@@ -57,6 +57,7 @@
# and should complain.
AUTOMAKE_fails --add-missing
grep 'tparse.h.*already defined' stderr
+$AUTOMAKE -Wno-error
# Still and all, it should generate two rules.
test `grep tparse.h: Makefile.in | wc -l` = 2
Index: tests/substtarg.test
===================================================================
RCS file: /cvs/automake/automake/tests/substtarg.test,v
retrieving revision 1.4
diff -u -r1.4 substtarg.test
--- tests/substtarg.test 3 Jul 2003 18:58:50 -0000 1.4
+++ tests/substtarg.test 13 May 2004 21:59:57 -0000
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -49,6 +49,6 @@
$ACLOCAL
AUTOMAKE_fails
grep 'address@hidden@.a' stderr
+$AUTOMAKE -Wno-override
num=`grep 'address@hidden@.a:' Makefile.in | wc -l`
test $num -eq 1
-$AUTOMAKE -Wno-override
Index: tests/werror2.test
===================================================================
RCS file: tests/werror2.test
diff -N tests/werror2.test
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/werror2.test 13 May 2004 21:59:57 -0000
@@ -0,0 +1,52 @@
+#! /bin/sh
+# Copyright (C) 2004 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.
+
+# Make sure that Makefile.in is not overwritten on error. Otherwise
+# although the rebuilding rules would fail on error, they would
+# succeed if make is run a second time immediately afterwards.
+# Report from Harlan Stenn.
+
+required=GNUmake
+. ./defs || exit 1
+
+set -e
+
+echo AC_OUTPUT>>configure.in
+
+: > Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE
+
+cat >Makefile.am <<END
+AUTOMAKE_OPTIONS = -Werror
+INCLUDES = -Ifoo
+foo_SOURCES = unused
+END
+
+$MAKE && exit 1
+
+$MAKE && exit 1
+
+:
--
Alexandre Duret-Lutz
- FYI: do not write Makefile.in on error,
Alexandre Duret-Lutz <=