🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #492

GNU Make 3.56: Feature: command prefix

#492
From: Chip Salzenberg
Date: Wed, 11 Oct 1989 15:56
85 lines
2357 bytes
[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);
      }
Technical Details
Message-ID: <m0gElK3-0002SKC@ateng.ateng.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!ateng.ateng.com!chip

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!ateng.ateng.com!chip
From: chip@ateng.ateng.com (Chip Salzenberg)
Newsgroups: gnu.utils.bug
Subject: GNU Make 3.56: Feature: command prefix
Message-ID: <m0gElK3-0002SKC@ateng.ateng.com>
Date: 11 Oct 89 15:56:54 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 85