Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Jun 1999 11:14:08 +1000
From:      Peter Jeremy <jeremyp@gsmx07.alcatel.com.au>
To:        freebsd-current@FreeBSD.ORG
Subject:   Re: bsd.lib.mk "@"'s
Message-ID:  <99Jun8.105757est.40326@border.alcanet.com.au>

next in thread | raw e-mail | index | archive | help
Chuck Robey <chuckr@picnic.mat.net> wrote:
>On Mon, 7 Jun 1999, Colin Jensen wrote:
>
>> Why not just define a macro like SILENT_RUN=@ and replace
>> all the @ with ${SILENT}?  Then both sides of can get what they
>> want :-)
>
>A compromise.  I *love* compromises.  How about this, Nate?

I have an alternative compromise - add an option to make(1) so it
will ignore the `@' symbol.  The following adds a `-@' option (the
option letter could be easily changed).  I haven't updated make.1,
but will if the following is acceptable.

Index: compat.c
===================================================================
RCS file: /home/CVSROOT/./src/usr.bin/make/compat.c,v
retrieving revision 1.12
diff -u -r1.12 compat.c
--- compat.c	1998/09/09 05:15:38	1.12
+++ compat.c	1999/06/07 22:12:24
@@ -239,7 +239,8 @@
 
     while ((*cmd == '@') || (*cmd == '-')) {
 	if (*cmd == '@') {
-	    silent = TRUE;
+	    if (!notSilent)
+		silent = TRUE;
 	} else {
 	    errCheck = FALSE;
 	}
Index: job.c
===================================================================
RCS file: /home/CVSROOT/./src/usr.bin/make/job.c,v
retrieving revision 1.12
diff -u -r1.12 job.c
--- job.c	1999/02/14 22:22:42	1.12
+++ job.c	1999/06/07 22:11:41
@@ -483,7 +483,7 @@
  * JobPrintCommand  --
  *	Put out another command for the given job. If the command starts
  *	with an @ or a - we process it specially. In the former case,
- *	so long as the -s and -n flags weren't given to make, we stick
+ *	so long as the -@, -s and -n flags weren't given to make, we stick
  *	a shell-specific echoOff command in the script. In the latter,
  *	we ignore errors for the entire job, unless the shell has error
  *	control.
@@ -561,7 +561,8 @@
      */
     while (*cmd == '@' || *cmd == '-') {
 	if (*cmd == '@') {
-	    shutUp = TRUE;
+	    if (!notSilent)
+		shutUp = TRUE;
 	} else {
 	    errOff = TRUE;
 	}
Index: main.c
===================================================================
RCS file: /home/CVSROOT/./src/usr.bin/make/main.c,v
retrieving revision 1.30
diff -u -r1.30 main.c
--- main.c	1999/03/01 06:01:05	1.30
+++ main.c	1999/06/07 22:17:43
@@ -133,6 +133,7 @@
 Boolean			usePipes;	/* !-P flag */
 Boolean			ignoreErrors;	/* -i flag */
 Boolean			beSilent;	/* -s flag */
+Boolean			notSilent;    	/* -@ flag */
 Boolean			beVerbose;	/* -v flag */
 Boolean			oldVars;	/* variable substitution style */
 Boolean			checkEnvFirst;	/* -e flag */
@@ -172,12 +173,16 @@
 
 	optind = 1;	/* since we're called more than once */
 #ifdef REMOTE
-# define OPTFLAGS "BD:I:L:PSV:d:ef:ij:km:nqrstv"
+# define OPTFLAGS "@BD:I:L:PSV:d:ef:ij:km:nqrstv"
 #else
-# define OPTFLAGS "BD:I:PSV:d:ef:ij:km:nqrstv"
+# define OPTFLAGS "@BD:I:PSV:d:ef:ij:km:nqrstv"
 #endif
 rearg:	while((c = getopt(argc, argv, OPTFLAGS)) != -1) {
 		switch(c) {
+		case '@':
+			notSilent = TRUE;
+			Var_Append(MAKEFLAGS, "-@", VAR_GLOBAL);
+			break;
 		case 'D':
 			Var_Set(optarg, "1", VAR_GLOBAL);
 			Var_Append(MAKEFLAGS, "-D", VAR_GLOBAL);
@@ -1280,7 +1285,7 @@
 usage()
 {
 	(void)fprintf(stderr, "%s\n%s\n%s\n",
-"usage: make [-Beiknqrstv] [-D variable] [-d flags] [-f makefile]",
+"usage: make [-@Beiknqrstv] [-D variable] [-d flags] [-f makefile]",
 "            [-I directory] [-j max_jobs] [-m directory] [-V variable]",
 "            [variable=value] [target ...]");
 	exit(2);
Index: make.h
===================================================================
RCS file: /home/CVSROOT/./src/usr.bin/make/make.h,v
retrieving revision 1.8
diff -u -r1.8 make.h
--- make.h	1998/11/14 16:15:04	1.8
+++ make.h	1999/06/07 22:12:25
@@ -294,6 +294,7 @@
 extern Boolean	compatMake;	/* True if we are make compatible */
 extern Boolean	ignoreErrors;  	/* True if should ignore all errors */
 extern Boolean  beSilent;    	/* True if should print no commands */
+extern Boolean  notSilent;    	/* True if should print `@' commands */
 extern Boolean	beVerbose;	/* True if should print extra cruft */
 extern Boolean  noExecute;    	/* True if should execute nothing */
 extern Boolean  allPrecious;   	/* True if every target is precious */


Peter


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99Jun8.105757est.40326>