summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/var.h
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2005-05-06 18:30:06 +0000
committerharti <harti@FreeBSD.org>2005-05-06 18:30:06 +0000
commit9e2faf2a2d1d132b64803f711bdc86494a945dea (patch)
tree63e1aad932422a7e009bf4546d317d2a3db92daf /usr.bin/make/var.h
parent491568ac84a241eb8ffe4266ddf975db8e546faa (diff)
downloadFreeBSD-src-9e2faf2a2d1d132b64803f711bdc86494a945dea.zip
FreeBSD-src-9e2faf2a2d1d132b64803f711bdc86494a945dea.tar.gz
Introduce a new pseudo-target .EXPORTVAR which allows to put a
make macro into the environment of programs executed by make. This has approximately the same function as gmake's export directive. The form of a pseudo target was deliberately choosen to minimize work for POSIX compatibility (Makefiles are not allowed to use any targets starting with a dot and consisting only of uppercase letters except those specified in the standard when they want POSIX compatible behaviour, so such a Makefile can never contain .EXPORTVAR.) Change the handling of macros coming from the environment: instead of asking the environment for each variable we could not find otherwise put all the environment variables in a special variable environment just at start up. This has been tested on the ports cluster by kris. Submitted by: Max Okumoto <okumoto@ucsd.edu>
Diffstat (limited to 'usr.bin/make/var.h')
-rw-r--r--usr.bin/make/var.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/make/var.h b/usr.bin/make/var.h
index 3128b2b..f5fb9c6 100644
--- a/usr.bin/make/var.h
+++ b/usr.bin/make/var.h
@@ -57,12 +57,12 @@ typedef struct Var {
#define VAR_IN_USE 1 /* Variable's value currently being used.
* Used to avoid recursion */
-#define VAR_FROM_ENV 2 /* Variable comes from the environment */
-
#define VAR_JUNK 4 /* Variable is a junk variable that
* should be destroyed when done with
* it. Used by Var_Parse for undefined,
* modified variables */
+
+#define VAR_TO_ENV 8 /* Place variable in environment */
} Var;
/* Var*Pattern flags */
@@ -95,10 +95,11 @@ void Var_Dump(const struct GNode *);
Boolean Var_Exists(const char *, struct GNode *);
char *Var_GetHead(char *);
char *Var_GetTail(char *);
-void Var_Init(void);
+void Var_Init(char **);
char *Var_Parse(const char *, struct GNode *, Boolean, size_t *, Boolean *);
char *Var_Quote(const char *);
void Var_Set(const char *, const char *, struct GNode *);
+void Var_SetEnv(const char *, struct GNode *);
struct Buffer *Var_Subst(const char *, const char *, struct GNode *, Boolean);
char *Var_Value(const char *, struct GNode *, char **);
OpenPOWER on IntegriCloud