[gnu.utils.bug] GNU Make 3.56: Feature: command prefix

chip@ateng.ateng.com (Chip Salzenberg) (10/11/89)

[FEATURE]

Support a command prefix, printed before each command to be executed.
    As I've coded it, the default is "\t" unless -n flag specified.
    However, you may want to default it to "", the current behavior.

Index: make.h
***************
*** 151,154 ****
--- 146,150 ----
  
  extern char *program;
+ extern char *command_prefix;
  
  extern unsigned int makelevel;

Index: main.c
***************
*** 247,250 ****
--- 247,254 ----
  char *program;
  
+ /* The string to print before each command. */
+ 
+ char *command_prefix = "\t";
+ 
  /* Value of the MAKELEVEL variable at startup (or 0).  */
  
***************
*** 376,379 ****
--- 392,400 ----
      print_version ();
  
+   /* If we're just printing commands, then we omit the prefix. */
+ 
+   if (just_print_flag)
+     command_prefix = "";
+ 
    /* Construct the list of include directories to search.  */
  
Index: file.c
***************
*** 225,228 ****
--- 225,229 ----
  	      else if (!silent_flag && !just_print_flag)
  		{
+ 		  fputs (command_prefix, stdout);
  		  if (!doneany)
  		    {

Index: job.c
***************
*** 489,493 ****
  
    if (just_print_flag || (!noprint && !silent_flag))
!     puts (p);
  
    /* If -n was given, recurse to get the next line in the sequence.  */
--- 489,496 ----
  
    if (just_print_flag || (!noprint && !silent_flag))
!     {
!       fputs (command_prefix, stdout);
!       puts (p);
!     }
  
    /* If -n was given, recurse to get the next line in the sequence.  */

Index: remake.c
***************
*** 578,582 ****
    if (!silent_flag)
      {
!       printf ("touch %s\n", file->name);
        fflush (stdout);
      }
--- 578,585 ----
    if (!silent_flag)
      {
!       fputs (command_prefix, stdout);
!       fputs ("touch ", stdout);
!       fputs (file->name, stdout);
!       fputc ('\n', stdout);
        fflush (stdout);
      }