]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Bump the version to 3.82.90.
authorPaul Smith <psmith@gnu.org>
Sun, 29 Aug 2010 23:05:26 +0000 (23:05 +0000)
committerPaul Smith <psmith@gnu.org>
Sun, 29 Aug 2010 23:05:26 +0000 (23:05 +0000)
Fix some doc bugs.
Implement the --trace flag.
Show filename/linenumber on error.

16 files changed:
ChangeLog
NEWS
configure.in
doc/make.texi
job.c
main.c
make.1
make.h
tests/ChangeLog
tests/scripts/features/errors
tests/scripts/features/parallelism
tests/scripts/features/patternrules
tests/scripts/features/vpathplus
tests/scripts/options/dash-k
tests/scripts/targets/POSIX
tests/scripts/variables/SHELL

index 233be1a32e5da7726487eecffb3b14e9f3a8b0ad..0766522631c55e72fabfb962754833324581b3c2 100644 (file)
--- 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 24698dcbe5130873ce35f2818d610db9bb77a37c..36bae59d874e9806682b5ddfc6b458988088c67e 100644 (file)
--- 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.
 
@@ -8,6 +8,22 @@ All changes mentioned here are more fully described in the GNU make
 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.
+\f
+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.
+
 \f
 Version 3.82
 
index f33cb34934b47da0a07be77126eb6821d0c32b35..a1e720b396e40fa7e0ea9569cc5a28f5903a8aa9 100644 (file)
@@ -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$]])
index b7c54bfb105619e0b258f9391b271bdfc577c08c..6f59f86c9db46b119a9ea497f10e630f041208a9 100644 (file)
@@ -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 eab91a1babc90e478f13cd204b53817b0bbdbd95..f4e6fa463b9ad32f2d5926664948f4cbf6712228 100644 (file)
--- 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 */
 }
 \f
@@ -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 782b0de072bea9706551a34e987d55170bc330c4..51764dddd12f42f7fa4cef977f4ebbaf67878437 100644 (file)
--- 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 c76ce25dd26e73194f0bded6476726236c3d4abe..e8db82899e854927e3349a1a9d305ea5d642d0e4 100644 (file)
--- 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 60ade4c16361c772bd92dbaf63f1f1cfbae153ef..e563da479e7258d72902ccf1c37dceae3431db5e 100644 (file)
--- 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;
index 5d6293099bd67ba29b09ff0d1ec0fb2a9e2f4da1..527ecd80adb4dec9d09d9b17ce63c0122f243cab 100644 (file)
@@ -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
index e372fe05eee0fa1e8eaa6754a7c31f5d4b4d5562..1e4be4615063bcd7e6088b2656726080a1f41347 100644 (file)
@@ -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);
 
index cc0f84f6645c32d44a686336f3c4883688352316..22e4aebe8434678a855cf14637256e24fbcf12e8 100644 (file)
@@ -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);
 
 
index eebe7c0af4f47c663b90b994cc7aea2a430b5ec5..5cc6b94d86a2dd937b714ffc9904682e9b169000 100644 (file)
@@ -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");
index a37fbedd479f5233a99d2e85fb75a4dfd8eb1b75..c95c8abc30cb75fa2511de3a44009f83e2bcbb1c 100644 (file)
@@ -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
 ";
 
index d87a7861aecf32bf423f9a5368d0773fb28da2c9..40d9b97346192ef905d1ee4fcf819ea55201260a 100644 (file)
@@ -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";
 
index 9c30e1817cc74a47e8cf156be96a2480d54b92f7..5f854be51f42ca4867ece43c0d3c4a79fa2757a7 100644 (file)
@@ -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';
index 7b7e7feff91c56f05f085f14b1f5a2771c64475e..4416ce13aa6eab8e36369689ab6b9028682be84a 100644 (file)
@@ -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;