I find it useful to  see the commands during failing builds
(it started with samba, I also used this with proprietary products
at work).

I added an -E flag which overrides .SILENT and @<command>
to always echo the commands being done -- much better than running
strace or hacking up the makefiles...

It was so easy, I should have done it much sooner!!
(I've had this problem for more than a decade)!!

The patch is wrt 3.80, attached below:


Marty Leisner
[EMAIL PROTECTED]

--- make.h      2002/10/15 05:10:52     1.1
+++ make.h      2002/10/15 05:11:28
@@ -491,6 +491,7 @@
 extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag;
 extern int print_version_flag, print_directory_flag;
 extern int warn_undefined_variables_flag, posix_pedantic, not_parallel;
+extern int always_echo_flag;
 extern int clock_skew_detected;
 
 /* can we run commands via 'sh -c xxx' or must we use batch files? */
--- main.c      2002/10/15 05:10:52     1.1
+++ main.c      2002/10/15 05:11:29
@@ -138,6 +138,12 @@
 
 int just_print_flag;
 
+/* Nonzero means ignore the @ in front of a command or .SILENT:
+ * target...this is to ALWAYS see the commands being executed, even
+ * though clever makefile designers want to hide the magic.
+ */
+int always_echo_flag = 0;
+
 /* Print debugging info (--debug).  */
 
 static struct stringlist *db_flags;
@@ -291,6 +297,7 @@
     N_("\
   -k, --keep-going            Keep going when some targets can't be made.\n"),
     N_("\
+  -E, --always-echo           Ignore .SILENT and @, always echo commands\n\"),
   -l [N], --load-average[=N], --max-load[=N]\n\
                               Don't start multiple jobs unless load is below N.\n"),
     N_("\
@@ -342,6 +349,7 @@
 #endif
     { 'e', flag, (char *) &env_overrides, 1, 1, 0, 0, 0,
         "environment-overrides", },
+    { 'E', flag, (char *) &always_echo_flag, 1, 1, 0, 0, "always-echo" },
     { 'f', string, (char *) &makefiles, 0, 0, 0, 0, 0, "file" },
     { 'h', flag, (char *) &print_usage_flag, 0, 0, 0, 0, 0, "help" },
     { 'i', flag, (char *) &ignore_errors_flag, 1, 1, 0, 0, 0,
--- job.c       2002/10/15 05:10:52     1.1
+++ job.c       2002/10/15 05:11:29
@@ -986,7 +986,8 @@
      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 || always_echo_flag  
+                       || (!(flags & COMMANDS_SILENT) && !silent_flag))
           ? "%s" : (char *) 0, p);
 
   /* Tell update_goal_chain that a command has been started on behalf of
_______________________________________________
Bug-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-make

Reply via email to