[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
make -k doesn't notice failures to remake makefiles
From: |
Bob Byrnes |
Subject: |
make -k doesn't notice failures to remake makefiles |
Date: |
Wed, 21 Apr 2004 21:57:02 -0400 |
Here's a suggested patch for a problem that I reported earlier.
I'll append a copy of the original bug report, below.
2004-04-21 Bob Byrnes <address@hidden>
* main.c (main): Notice failures to remake makefiles.
--- main.c.orig 2004-04-13 16:07:17.000000000 -0400
+++ main.c 2004-04-21 15:30:54.000000000 -0400
@@ -1773,10 +1773,11 @@ main (int argc, char **argv, char **envp
error (NILF, _("Failed to remake makefile `%s'."),
d->file->name);
mtime = file_mtime_no_search (d->file);
any_remade |= (mtime != NONEXISTENT_MTIME
&& mtime != makefile_mtimes[i]);
+ any_failed = 1;
}
}
else
/* This makefile was not found at all. */
if (! (d->changed & RM_DONTCARE))
--
Bob Byrnes e-mail: address@hidden
Curl Corporation phone: 617-761-1238
1 Cambridge Center, 10th Floor fax: 617-761-1201
Cambridge, MA 02142-1612
========================================
From: "Bob Byrnes" <address@hidden>
Date: Sun, 1 Feb 2004 22:42:37 -0500
To: address@hidden
Subject: make -k returns zero exit status even for included Makefile failures
Consider the following ...
----------------------------------------
shell> uname -a
Linux wildcard.curl.com 2.4.20-18.9 #1 Thu May 29 07:08:16 EDT 2003 i686 i686
i386 GNU/Linux
shell> make --version
GNU Make 3.80
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
shell> cat Makefile
all:
nonexistent: /no-such-file
false
include nonexistent
----------------------------------------
If I run GNU make without any options, it fails and returns a nonzero
exit status:
----------------------------------------
shell> make ; echo "make exit status = $?"
Makefile:13: nonexistent: No such file or directory
make: *** No rule to make target `/no-such-file', needed by `nonexistent'.
Stop.
make exit status = 2
----------------------------------------
I think this behavior is correct.
However, if I use make -k, it returns a zero exit status:
----------------------------------------
shell> make -k ; echo "make exit status = $?"
Makefile:13: nonexistent: No such file or directory
make: *** No rule to make target `/no-such-file', needed by `nonexistent'.
make: Failed to remake makefile `nonexistent'.
make: Nothing to be done for `all'.
make exit status = 0
----------------------------------------
This seems like a bug. IMO, make -k should only allow extra work to be
done, but should never alter the exit status, and it seems wrong for the
last example to have apparently "succeeded."
--
Bob Byrnes e-mail: address@hidden
Curl Corporation phone: 617-761-1238
1 Cambridge Center, 10th Floor fax: 617-761-1201
Cambridge, MA 02142-1612
- make -k doesn't notice failures to remake makefiles,
Bob Byrnes <=