summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2009-01-03 10:14:01 +0000
committerobrien <obrien@FreeBSD.org>2009-01-03 10:14:01 +0000
commita3f555f083888fd170c838c4620b5f3355c05886 (patch)
tree8485f281917e9edc0e34919c38ef1f84e6c69514 /usr.bin
parentefe3f87721e5c915985776d2d88cb173737e8258 (diff)
downloadFreeBSD-src-a3f555f083888fd170c838c4620b5f3355c05886.zip
FreeBSD-src-a3f555f083888fd170c838c4620b5f3355c05886.tar.gz
+ Add the -Q be-quiet flag for parallel jobs.
- Enable -Q by default for the moment - there is something weird going on in the rescue build.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/globals.h1
-rw-r--r--usr.bin/make/job.c2
-rw-r--r--usr.bin/make/main.c8
-rw-r--r--usr.bin/make/make.15
-rw-r--r--usr.bin/make/var.c37
5 files changed, 29 insertions, 24 deletions
diff --git a/usr.bin/make/globals.h b/usr.bin/make/globals.h
index 5e42a4a..c2e1f11 100644
--- a/usr.bin/make/globals.h
+++ b/usr.bin/make/globals.h
@@ -76,6 +76,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 beVerbose; /* True if should print extra cruft */
+extern Boolean beQuiet; /* True if want quiet headers with -j */
extern Boolean noExecute; /* True if should execute nothing */
extern Boolean allPrecious; /* True if every target is precious */
extern Boolean is_posix; /* .POSIX target seen */
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index 5bd5456..04c7ce5 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -2363,7 +2363,7 @@ Job_Init(int maxproc)
lastNode = NULL;
- if (maxJobs == 1 && fifoFd < 0) {
+ if ((maxJobs == 1 && fifoFd < 0) || beQuiet || beVerbose == 0) {
/*
* If only one job can run at a time, there's no need for a
* banner, no is there?
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index d2aae55..af041bd 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -126,6 +126,7 @@ Boolean is_posix; /* .POSIX target seen */
Boolean mfAutoDeps; /* .MAKEFILEDEPS target seen */
Boolean beSilent; /* -s flag */
Boolean beVerbose; /* -v flag */
+Boolean beQuiet = TRUE; /* -Q flag */
Boolean compatMake; /* -B argument */
int debug; /* -d flag */
Boolean ignoreErrors; /* -i flag */
@@ -370,7 +371,7 @@ MainParseArgs(int argc, char **argv)
rearg:
optind = 1; /* since we're called more than once */
optreset = 1;
-#define OPTFLAGS "ABC:D:E:I:PSV:Xd:ef:ij:km:npqrstvx:"
+#define OPTFLAGS "ABC:D:E:I:PSV:Xd:ef:ij:km:nQpqrstvx:"
for (;;) {
if ((optind < argc) && strcmp(argv[optind], "--") == 0) {
found_dd = TRUE;
@@ -516,6 +517,10 @@ rearg:
printGraphOnly = TRUE;
debug |= DEBUG_GRAPH1;
break;
+ case 'Q':
+ beQuiet = TRUE;
+ MFLAGS_append("-Q", NULL);
+ break;
case 'q':
queryFlag = TRUE;
/* Kind of nonsensical, wot? */
@@ -535,6 +540,7 @@ rearg:
break;
case 'v':
beVerbose = TRUE;
+ beQuiet = FALSE;
MFLAGS_append("-v", NULL);
break;
case 'x':
diff --git a/usr.bin/make/make.1 b/usr.bin/make/make.1
index 27cbc9f..736f279 100644
--- a/usr.bin/make/make.1
+++ b/usr.bin/make/make.1
@@ -258,6 +258,9 @@ When combined with
only the builtin rules of
.Nm
are displayed.
+.It Fl Q
+Be extra quiet.
+For multi-job makes, this will cause file banners not to be generated.
.It Fl q
Do not execute any commands, but exit 0 if the specified targets are
up-to-date and 1, otherwise.
@@ -289,7 +292,7 @@ the variables will be printed one per line,
with a blank line for each null or undefined variable.
.It Fl v
Be extra verbose.
-For multi-job makes, this will cause file banners to be generated.
+Print any extra information.
.It Fl X
When using the
.Fl V
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c
index 259a672..952f3a3 100644
--- a/usr.bin/make/var.c
+++ b/usr.bin/make/var.c
@@ -946,12 +946,14 @@ VarFindAny(const char name[], GNode *ctxt)
* The name and val arguments are duplicated so they may
* safely be freed.
*/
-static void
+static Var *
VarAdd(const char *name, const char *val, GNode *ctxt)
{
+ Var *v;
- Lst_AtFront(&ctxt->context, VarCreate(name, val, 0));
+ Lst_AtFront(&ctxt->context, v = VarCreate(name, val, 0));
DEBUGF(VAR, ("%s:%s = %s\n", ctxt->name, name, val));
+ return (v);
}
/**
@@ -1004,30 +1006,22 @@ Var_Set(const char *name, const char *val, GNode *ctxt)
n = VarPossiblyExpand(name, ctxt);
v = VarFindOnly(n, ctxt);
if (v == NULL) {
- VarAdd(n, val, ctxt);
- if (ctxt == VAR_CMD) {
- /*
- * Any variables given on the command line
- * are automatically exported to the
- * environment (as per POSIX standard)
- */
- setenv(n, val, 1);
- }
+ v = VarAdd(n, val, ctxt);
} else {
Buf_Clear(v->val);
Buf_Append(v->val, val);
-
- if (ctxt == VAR_CMD || (v->flags & VAR_TO_ENV)) {
- /*
- * Any variables given on the command line
- * are automatically exported to the
- * environment (as per POSIX standard)
- */
- setenv(n, val, 1);
- }
DEBUGF(VAR, ("%s:%s = %s\n", ctxt->name, n, val));
}
+ if (ctxt == VAR_CMD || (v->flags & VAR_TO_ENV)) {
+ /*
+ * Any variables given on the command line
+ * are automatically exported to the
+ * environment (as per POSIX standard)
+ */
+ setenv(n, val, 1);
+ }
+
free(n);
}
@@ -2325,7 +2319,8 @@ match_var(const char str[], const char var[])
* None. The old string must be freed by the caller
*/
Buffer *
-Var_Subst(const char *str, GNode *ctxt, Boolean err)
+//Var_Subst(const char *var, const char *str, GNode *ctxt, Boolean undefErr)
+Var_Subst( const char *str, GNode *ctxt, Boolean err)
{
Boolean errorReported;
Buffer *buf; /* Buffer for forming things */
OpenPOWER on IntegriCloud