summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2010-08-29 23:05:26 +0000
committerPaul Smith <psmith@gnu.org>2010-08-29 23:05:26 +0000
commita86d1693bac05e04f90a2ee3c4fa3547c788377c (patch)
treee26687d523ee3e243ca9f0b0dc6a2f4d57321919
parent3b1432d86aebdc48aaa52efa06fad1ad662b38d7 (diff)
downloadgunmake-a86d1693bac05e04f90a2ee3c4fa3547c788377c.tar.gz
Bump the version to 3.82.90.
Fix some doc bugs. Implement the --trace flag. Show filename/linenumber on error.
-rw-r--r--ChangeLog22
-rw-r--r--NEWS18
-rw-r--r--configure.in2
-rw-r--r--doc/make.texi47
-rw-r--r--job.c85
-rw-r--r--main.c11
-rw-r--r--make.110
-rw-r--r--make.h6
-rw-r--r--tests/ChangeLog10
-rw-r--r--tests/scripts/features/errors19
-rw-r--r--tests/scripts/features/parallelism7
-rw-r--r--tests/scripts/features/patternrules3
-rw-r--r--tests/scripts/features/vpathplus1
-rw-r--r--tests/scripts/options/dash-k1
-rw-r--r--tests/scripts/targets/POSIX3
-rw-r--r--tests/scripts/variables/SHELL3
16 files changed, 183 insertions, 65 deletions
diff --git a/ChangeLog b/ChangeLog
index 233be1a..0766522 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,27 @@
2010-08-29 Paul Smith <psmith@gnu.org>
+ * doc/make.texi (Implicit Variables): Document LDLIBS and LOADLIBES.
+ Fixes Savannah bug #30807.
+ (Instead of Execution): Mention that included makefiles are still
+ rebuilt even with -n. Fixes Savannah bug #30762.
+
+ * configure.in: Bump to 3.82.90.
+
+ * make.h: Add trace_flag variable.
+ * main.c (switches): Add --trace option.
+ (trace_flag): Declare variable.
+ * job.c (start_job_command): Show recipe if trace_flag is set.
+ (new_job): Show trace messages if trace_flag is set.
+ * doc/make.texi (Options Summary): Document the new --trace option.
+ * make.1: Add --trace documentation.
+ * NEWS: Mention --trace.
+
+ * job.c (child_error): Show recipe filename/linenumber on error.
+ Also show "(ignored)" when appropriate even for signals/coredumps.
+ * NEWS: Mention file/linenumber change.
+
+ * main.c (main): Print version info when DB_BASIC is set.
+
* job.c (construct_command_argv_internal): If shellflags is not
set, choose an appropriate default value. Fixes Savannah bug #30748.
diff --git a/NEWS b/NEWS
index 24698dc..36bae59 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
GNU make NEWS -*-indented-text-*-
History of user-visible changes.
- 28 July 2010
+ 29 August 2010
See the end of this file for copyrights and conditions.
@@ -9,6 +9,22 @@ manual, which is contained in this distribution as the file doc/make.texi.
See the README file and the GNU make manual for instructions for
reporting bugs.
+Version 3.82.90
+
+A complete list of bugs fixed in this version is available here:
+
+http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set=custom
+
+* New command line option: --trace enables tracing of targets. When enabled
+ the recipe to be invoked is printed even if it would otherwise be suppressed
+ by .SILENT or a "@" prefix character. Also before each recipe is run the
+ makefile name and linenumber where it was defined are shown as well as the
+ prerequisites that caused the target to be considered out of date.
+
+* On failure, the makefile name and linenumber of the recipe that failed are
+ shown.
+
+
Version 3.82
A complete list of bugs fixed in this version is available here:
diff --git a/configure.in b/configure.in
index f33cb34..a1e720b 100644
--- a/configure.in
+++ b/configure.in
@@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
-AC_INIT([GNU make],[3.82],[bug-make@gnu.org])
+AC_INIT([GNU make],[3.82.90],[bug-make@gnu.org])
AC_PREREQ(2.59)
AC_REVISION([[$Id$]])
diff --git a/doc/make.texi b/doc/make.texi
index b7c54bf..6f59f86 100644
--- a/doc/make.texi
+++ b/doc/make.texi
@@ -3286,10 +3286,11 @@ main.o : main.c defs.h
Thus you no longer have to write all those rules yourself.
The compiler will do it for you.
-Note that such a prerequisite constitutes mentioning @file{main.o} in a
-makefile, so it can never be considered an intermediate file by implicit
-rule search. This means that @code{make} won't ever remove the file
-after using it; @pxref{Chained Rules, ,Chains of Implicit Rules}.
+Note that such a rule constitutes mentioning @file{main.o} in a
+makefile, so it can never be considered an intermediate file by
+implicit rule search. This means that @code{make} won't ever remove
+the file after using it; @pxref{Chained Rules, ,Chains of Implicit
+Rules}.
@cindex @code{make depend}
With old @code{make} programs, it was traditional practice to use this
@@ -7918,9 +7919,12 @@ what you want. Certain options specify other activities for @code{make}.
@cindex @code{--recon}
@cindex @code{-n}
-``No-op''. The activity is to print what recipe would be used to make
-the targets up to date, but not actually execute it. Some recipes are
-still executed, even with this flag (@pxref{MAKE Variable, ,How the @code{MAKE} Variable Works}).
+``No-op''. Causes @code{make} to print the recipes that are needed to
+make the targets up to date, but not actually execute them. Note that
+some recipes are still executed, even with this flag (@pxref{MAKE
+Variable, ,How the @code{MAKE} Variable Works}). Also any recipes
+needed to update included makefiles are still executed
+(@pxref{Remaking Makefiles, ,How Makefiles Are Remade}).
@item -t
@itemx --touch
@@ -7929,9 +7933,10 @@ still executed, even with this flag (@pxref{MAKE Variable, ,How the @code{MAKE}
@cindex target, touching
@cindex @code{-t}
-``Touch''. The activity is to mark the targets as up to date without
-actually changing them. In other words, @code{make} pretends to compile
-the targets but does not really change their contents.
+``Touch''. Marks targets as up to date without actually changing
+them. In other words, @code{make} pretends to update the targets but
+does not really change their contents; instead only their modified
+times are updated.
@item -q
@itemx --question
@@ -7939,9 +7944,9 @@ the targets but does not really change their contents.
@cindex @code{-q}
@cindex question mode
-``Question''. The activity is to find out silently whether the targets
-are up to date already; but execute no recipe in either case. In other
-words, neither compilation nor output will occur.
+``Question''. Silently check whether the targets are up to date, but
+do not execute recipes; the exit code shows whether any updates are
+needed.
@item -W @var{file}
@itemx --what-if=@var{file}
@@ -8454,6 +8459,14 @@ instead of running their recipes. This is used to pretend that the
recipes were done, in order to fool future invocations of
@code{make}. @xref{Instead of Execution, ,Instead of Executing Recipes}.
+@item --trace
+@cindex @code{--trace}
+@c Extra blank line here makes the table look better.
+
+Print the entire recipe to be executed, even for recipes that are
+normally silent (due to @code{.SILENT} or @samp{@@}). Also print the
+makefile name and linenumber where the recipe was defined.
+
@item -v
@cindex @code{-v}
@itemx --version
@@ -8986,7 +8999,6 @@ can run @samp{make -p} in a directory with no makefiles.
Here is a table of some of the more common variables used as names of
programs in built-in rules:
-makefiles.
@table @code
@item AR
@@ -9143,6 +9155,13 @@ Extra flags to give to the SCCS @code{get} program.
Extra flags to give to compilers when they are supposed to invoke the linker,
@samp{ld}.
+@item LDLIBS
+@vindex LDLIBS
+@vindex LOADLIBES
+Library flags or names given to compilers when they are supposed to
+invoke the linker, @samp{ld}. @code{LOADLIBES} is a deprecated (but
+still supported) alternative to @code{LDLIBS}.
+
@item LFLAGS
@vindex LFLAGS
Extra flags to give to Lex.
diff --git a/job.c b/job.c
index eab91a1..f4e6fa4 100644
--- a/job.c
+++ b/job.c
@@ -437,27 +437,46 @@ is_bourne_compatible_shell (const char *path)
Append "(ignored)" if IGNORED is nonzero. */
static void
-child_error (const char *target_name,
+child_error (const struct file *file,
int exit_code, int exit_sig, int coredump, int ignored)
{
+ const char *nm;
+ const char *pre = "*** ";
+ const char *post = "";
+ const char *dump = "";
+ struct floc *flocp = &file->cmds->fileinfo;
+
if (ignored && silent_flag)
return;
+ if (exit_sig && coredump)
+ dump = _(" (core dumped)");
+
+ if (ignored)
+ {
+ pre = "";
+ post = _(" (ignored)");
+ }
+
+ if (! flocp->filenm)
+ nm = _("<builtin>");
+ else
+ {
+ char *a = alloca (strlen (flocp->filenm) + 1 + 11 + 1);
+ sprintf (a, "%s:%lu", flocp->filenm, flocp->lineno);
+ nm = a;
+ }
+ message (0, _("%s: recipe for target `%s' failed"), nm, file->name);
+
#ifdef VMS
if (!(exit_code & 1))
- error (NILF,
- (ignored ? _("*** [%s] Error 0x%x (ignored)")
- : _("*** [%s] Error 0x%x")),
- target_name, exit_code);
+ error (NILF, _("%s[%s] Error 0x%x%s"), pre, file->name, exit_code, post);
#else
if (exit_sig == 0)
- error (NILF, ignored ? _("[%s] Error %d (ignored)") :
- _("*** [%s] Error %d"),
- target_name, exit_code);
+ error (NILF, _("%s[%s] Error %d%s"), pre, file->name, exit_code, post);
else
- error (NILF, "*** [%s] %s%s",
- target_name, strsignal (exit_sig),
- coredump ? _(" (core dumped)") : "");
+ error (NILF, _("%s[%s] %s%s%s"),
+ pre, file->name, strsignal (exit_sig), dump, post);
#endif /* VMS */
}
@@ -533,7 +552,7 @@ reap_children (int block, int err)
int remote = 0;
pid_t pid;
int exit_code, exit_sig, coredump;
- register struct child *lastc, *c;
+ struct child *lastc, *c;
int child_failed;
int any_remote, any_local;
int dontcare;
@@ -784,7 +803,7 @@ reap_children (int block, int err)
static int delete_on_error = -1;
if (!dontcare)
- child_error (c->file->name, exit_code, exit_sig, coredump, 0);
+ child_error (c->file, exit_code, exit_sig, coredump, 0);
c->file->update_status = 2;
if (delete_on_error == -1)
@@ -800,8 +819,7 @@ reap_children (int block, int err)
if (child_failed)
{
/* The commands failed, but we don't care. */
- child_error (c->file->name,
- exit_code, exit_sig, coredump, 1);
+ child_error (c->file, exit_code, exit_sig, coredump, 1);
child_failed = 0;
}
@@ -1143,7 +1161,8 @@ start_job_command (struct child *child)
can log the working directory before the command's own error messages
appear. */
- message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
+ message (0, (just_print_flag || trace_flag
+ || (!(flags & COMMANDS_SILENT) && !silent_flag))
? "%s" : (char *) 0, p);
/* Tell update_goal_chain that a command has been started on behalf of
@@ -1792,17 +1811,33 @@ new_job (struct file *file)
++jobserver_tokens;
- /* The job is now primed. Start it running.
- (This will notice if there is in fact no recipe.) */
- if (cmds->fileinfo.filenm)
- DB (DB_BASIC, (_("Invoking recipe from %s:%lu to update target `%s'.\n"),
- cmds->fileinfo.filenm, cmds->fileinfo.lineno,
- c->file->name));
- else
- DB (DB_BASIC, (_("Invoking builtin recipe to update target `%s'.\n"),
- c->file->name));
+ /* Trace the build.
+ Use message here so that changes to working directories are logged. */
+ if (trace_flag)
+ {
+ char *newer = allocated_variable_expand_for_file ("$?", c->file);
+ char *nm;
+
+ if (! cmds->fileinfo.filenm)
+ nm = _("<builtin>");
+ else
+ {
+ nm = alloca (strlen (cmds->fileinfo.filenm) + 1 + 11 + 1);
+ sprintf (nm, "%s:%lu", cmds->fileinfo.filenm, cmds->fileinfo.lineno);
+ }
+ if (newer[0] == '\0')
+ message (0, _("%s: target `%s' does not exist"), nm, c->file->name);
+ else
+ message (0, _("%s: update target `%s' due to: %s"), nm,
+ c->file->name, newer);
+ free (newer);
+ }
+
+
+ /* The job is now primed. Start it running.
+ (This will notice if there is in fact no recipe.) */
start_waiting_job (c);
if (job_slots == 1 || not_parallel)
diff --git a/main.c b/main.c
index 782b0de..51764dd 100644
--- a/main.c
+++ b/main.c
@@ -151,9 +151,9 @@ static int debug_flag = 0;
int db_level = 0;
-/* Output level (--verbosity). */
+/* Tracing (--trace). */
-static struct stringlist *verbosity_flags;
+int trace_flag = 0;
#ifdef WINDOWS32
/* Suspend make in main for a short time to allow debugger to attach */
@@ -358,6 +358,8 @@ static const char *const usage[] =
N_("\
-t, --touch Touch targets instead of remaking them.\n"),
N_("\
+ --trace Print tracing information.\n"),
+ N_("\
-v, --version Print the version number of make and exit.\n"),
N_("\
-w, --print-directory Print the current directory.\n"),
@@ -414,9 +416,8 @@ static const struct command_switch switches[] =
{ 'S', flag_off, &keep_going_flag, 1, 1, 0, 0, &default_keep_going_flag,
"no-keep-going" },
{ 't', flag, &touch_flag, 1, 1, 1, 0, 0, "touch" },
+ { CHAR_MAX+3, flag, &trace_flag, 1, 1, 0, 0, 0, "trace" },
{ 'v', flag, &print_version_flag, 1, 1, 0, 0, 0, "version" },
- { CHAR_MAX+3, string, &verbosity_flags, 1, 1, 0, 0, 0,
- "verbosity" },
{ 'w', flag, &print_directory_flag, 1, 1, 0, 0, 0, "print-directory" },
{ CHAR_MAX+4, flag, &inhibit_print_directory_flag, 1, 1, 0, 0, 0,
"no-print-directory" },
@@ -1282,7 +1283,7 @@ main (int argc, char **argv, char **envp)
always_make_flag = always_make_set && (restarts == 0);
/* Print version information. */
- if (print_version_flag || print_data_base_flag || db_level)
+ if (print_version_flag || print_data_base_flag || ISDB (DB_BASIC))
{
print_version ();
diff --git a/make.1 b/make.1
index c76ce25..e8db828 100644
--- a/make.1
+++ b/make.1
@@ -283,6 +283,10 @@ This is used to pretend that the commands were done, in order to fool
future invocations of
.IR make .
.TP 0.5i
+.B \-\-trace
+Print information about the commands invoked by
+.IR make.
+.TP 0.5i
.BR \-v , " \-\-version"
Print the version of the
.I make
@@ -338,10 +342,10 @@ See the chapter `Problems and Bugs' in
.IR "The GNU Make Manual" .
.SH AUTHOR
This manual page contributed by Dennis Morse of Stanford University.
-It has been reworked by Roland McGrath. Further updates contributed by
-Mike Frysinger.
+Further updates contributed by Mike Frysinger. It has been reworked by Roland
+McGrath. Maintained by Paul Smith.
.SH "COPYRIGHT"
-Copyright (C) 1992, 1993, 1996, 1999, 2007 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1996, 1999, 2007, 2010 Free Software Foundation, Inc.
This file is part of GNU
.IR make .
.LP
diff --git a/make.h b/make.h
index 60ade4c..e563da4 100644
--- a/make.h
+++ b/make.h
@@ -511,9 +511,9 @@ extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag;
extern int print_data_base_flag, question_flag, touch_flag, always_make_flag;
extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag;
extern int print_version_flag, print_directory_flag, check_symlink_flag;
-extern int warn_undefined_variables_flag, posix_pedantic, not_parallel;
-extern int second_expansion, clock_skew_detected, rebuilding_makefiles;
-extern int one_shell;
+extern int warn_undefined_variables_flag, trace_flag, posix_pedantic;
+extern int not_parallel, second_expansion, clock_skew_detected;
+extern int rebuilding_makefiles, one_shell;
/* can we run commands via 'sh -c xxx' or must we use batch files? */
extern int batch_mode_shell;
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 5d62930..527ecd8 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,13 @@
+2010-08-29 Paul Smith <psmith@gnu.org>
+
+ * scripts/features/errors: Add new error message to output text.
+ * scripts/variables/SHELL: Ditto.
+ * scripts/targets/POSIX: Ditto.
+ * scripts/options/dash-k: Ditto.
+ * scripts/features/vpathplus: Ditto.
+ * scripts/features/patternrules: Ditto.
+ * scripts/features/parallelism: Ditto.
+
2010-08-13 Paul Smith <psmith@gnu.org>
* scripts/features/archives: New regression tests for archive
diff --git a/tests/scripts/features/errors b/tests/scripts/features/errors
index e372fe0..1e4be46 100644
--- a/tests/scripts/features/errors
+++ b/tests/scripts/features/errors
@@ -42,15 +42,17 @@ close(MAKEFILE);
unlink("cleanit");
$cleanit_error = `sh -c "$rm_command cleanit 2>&1"`;
+chomp $cleanit_error;
$delete_error_code = $? >> 8;
# TEST #1
# -------
-$answer = "$rm_command cleanit\n"
- . $cleanit_error
- ."$make_name: [clean] Error $delete_error_code (ignored)\n"
- ."$rm_command foo\n";
+$answer = "$rm_command cleanit
+$cleanit_error
+$makefile:2: recipe for target `clean' failed
+$make_name: [clean] Error $delete_error_code (ignored)
+$rm_command foo\n";
&run_make_with_options($makefile,"",&get_logfile);
@@ -74,10 +76,11 @@ if (!$vos)
# TEST #2
# -------
-$answer = "$rm_command cleanit\n"
- . $cleanit_error
- ."$make_name: [clean2] Error $delete_error_code (ignored)\n"
- ."$rm_command foo\n";
+$answer = "$rm_command cleanit
+$cleanit_error
+$makefile:5: recipe for target `clean2' failed
+$make_name: [clean2] Error $delete_error_code (ignored)
+$rm_command foo\n";
&run_make_with_options($makefile,"clean2 -i",&get_logfile);
diff --git a/tests/scripts/features/parallelism b/tests/scripts/features/parallelism
index cc0f84f..22e4aeb 100644
--- a/tests/scripts/features/parallelism
+++ b/tests/scripts/features/parallelism
@@ -98,14 +98,17 @@ fail.1 fail.2 fail.3:
ok:
\@sleep 4
\@echo Ok done",
- '-rR -j5', 'Fail
+ '-rR -j5', "Fail
+#MAKEFILE#:6: recipe for target `fail.1' failed
#MAKE#: *** [fail.1] Error 1
#MAKE#: *** Waiting for unfinished jobs....
Fail
+#MAKEFILE#:6: recipe for target `fail.2' failed
#MAKE#: *** [fail.2] Error 1
Fail
+#MAKEFILE#:6: recipe for target `fail.3' failed
#MAKE#: *** [fail.3] Error 1
-Ok done',
+Ok done",
512);
diff --git a/tests/scripts/features/patternrules b/tests/scripts/features/patternrules
index eebe7c0..5cc6b94 100644
--- a/tests/scripts/features/patternrules
+++ b/tests/scripts/features/patternrules
@@ -110,7 +110,8 @@ $(dir)/foo.bar:
',
"dir=$dir",
-"#MAKE#: *** [$dir/foo.bar] Error 1",
+"#MAKEFILE#:6: recipe for target `$dir/foo.bar' failed
+#MAKE#: *** [$dir/foo.bar] Error 1",
512);
unlink("$dir/foo.bar");
diff --git a/tests/scripts/features/vpathplus b/tests/scripts/features/vpathplus
index a37fbed..c95c8ab 100644
--- a/tests/scripts/features/vpathplus
+++ b/tests/scripts/features/vpathplus
@@ -86,6 +86,7 @@ cat ${VP}foo.c bar.c > foo.b 2>/dev/null || exit 1
$answer = "not creating notarget.c from notarget.d
cat notarget.c > notarget.b 2>/dev/null || exit 1
+$makefile:16: recipe for target `notarget.b' failed
$make_name: *** [notarget.b] Error 1
";
diff --git a/tests/scripts/options/dash-k b/tests/scripts/options/dash-k
index d87a786..40d9b97 100644
--- a/tests/scripts/options/dash-k
+++ b/tests/scripts/options/dash-k
@@ -92,6 +92,7 @@ close(MAKEFILE);
&run_make_with_options($makefile2, "-k", &get_logfile, $error_code);
$answer = "exit 1
+$makefile2:9: recipe for target `foo.o' failed
$make_name: *** [foo.o] Error 1
$make_name: Target `all' not remade because of errors.\n";
diff --git a/tests/scripts/targets/POSIX b/tests/scripts/targets/POSIX
index 9c30e18..5f854be 100644
--- a/tests/scripts/targets/POSIX
+++ b/tests/scripts/targets/POSIX
@@ -17,7 +17,8 @@ run_make_test(qq!
.POSIX:
all: ; \@$script
!,
- '', "#MAKE#: *** [all] Error $err\n", 512);
+ '', "#MAKEFILE#:3: recipe for target `all' failed
+#MAKE#: *** [all] Error $err\n", 512);
# User settings must override .POSIX
$flags = '-xc';
diff --git a/tests/scripts/variables/SHELL b/tests/scripts/variables/SHELL
index 7b7e7fe..4416ce1 100644
--- a/tests/scripts/variables/SHELL
+++ b/tests/scripts/variables/SHELL
@@ -81,6 +81,7 @@ run_make_test(qq!
.SHELLFLAGS = $flags
all: ; \@$script
!,
- '', "$out#MAKE#: *** [all] Error $err\n", 512);
+ '', "$out#MAKEFILE#:3: recipe for target `all' failed
+#MAKE#: *** [all] Error $err\n", 512);
1;