summaryrefslogtreecommitdiff
path: root/usr.bin/make/main.c
diff options
context:
space:
mode:
authorsjg <sjg@NetBSD.org>2001-06-10 02:31:00 +0000
committersjg <sjg@NetBSD.org>2001-06-10 02:31:00 +0000
commitfc0df160d89195b37f5832075656d06bd0a024af (patch)
tree9fbca62fb8f65f8a8656ebf184fa9ec5e84b096e /usr.bin/make/main.c
parenta2b115fa4cb9b51c7e0f8a242a9bd644ff6eabe6 (diff)
Simplify the exporting of VAR_CMD's via MAKEFLAGS.
We now just list the names of such variables in .MAKEOVERRIDES. When we come to export MAKEFLAGS we quote the value of each exported variable using :Q, using: ${.MAKEOVERRIDES:O:u:@v@$v=${$v:Q}@} The :O:u suppresses duplicate names. Also modifed Parse_DoVar to re-export MAKEFLAGS whenever .MAKEOVERRIDES is assigned to so .MAKEOVERRIDES+= PATH will export PATH=${PATH:Q} to the environment, while .MAKEOVERRIDES= will disable export of VAR_CMD's.
Diffstat (limited to 'usr.bin/make/main.c')
-rw-r--r--usr.bin/make/main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index bd7ba945ee2..8d911efdd37 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.69 2001/06/09 05:57:31 sjg Exp $ */
+/* $NetBSD: main.c,v 1.70 2001/06/10 02:31:00 sjg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -39,7 +39,7 @@
*/
#ifdef MAKE_BOOTSTRAP
-static char rcsid[] = "$NetBSD: main.c,v 1.69 2001/06/09 05:57:31 sjg Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.70 2001/06/10 02:31:00 sjg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
@@ -51,7 +51,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\n\
#if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: main.c,v 1.69 2001/06/09 05:57:31 sjg Exp $");
+__RCSID("$NetBSD: main.c,v 1.70 2001/06/10 02:31:00 sjg Exp $");
#endif
#endif /* not lint */
#endif
@@ -1665,8 +1665,9 @@ ExportMAKEFLAGS(first)
return;
once = 0;
- strncpy(tmp, "${.MAKEFLAGS} ${.MAKEOVERRIDES}", sizeof(tmp));
- s = Var_Subst(NULL, tmp, VAR_GLOBAL, 0);
+ strncpy(tmp, "${.MAKEFLAGS} ${.MAKEOVERRIDES:O:u:@v@$v=${$v:Q}@}",
+ sizeof(tmp));
+ s = Var_Subst(NULL, tmp, VAR_CMD, 0);
if (s && *s) {
#ifdef POSIX
setenv("MAKEFLAGS", s, 1);