[BACK]Return to cond_int.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / make

File: [local] / src / usr.bin / make / cond_int.h (download)

Revision 1.4, Sun Jul 8 17:44:20 2007 UTC (16 years, 10 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.3: +2 -1 lines

A set of big related changes. okay millert@, tested further by kettenis@
and matthieu@

This all revolves around putting ALL global variables into one single big
hash, and using flags. This removes some impossible to understand stuff,
like old varfind, and allows for some nice stuff.
- each time we reference a global variable, we create it, possibly as a dummy
variable.
- each time we go to the environment, we remember it, thus we no longer go
back to it.

Lists of dependant changes:
- isolate changes to oldVars and checkEnvFirst.
- remove VAR_CMD and VAR_GLOBAL contexts. The only distinction is in parsevar.
Split Parse_DoVar into Parse_DoVar and Parse_CmdlineVar
- rework var modules around obtain_global_var, observe flags in various
functions like Var_Value and Var_Seti.
- Var_Seti/Var_Appendi are almost the same code, use that internally.
- add magic to handle the very special SHELL variable.
- introduce Var_Definedi for the cases where we don't want the actual
value, to simplify tests.
- add keyword .poison, parse it and set global flags accordingly.
- do poison_checks where needed.
- document poison.
- in for loops, set variable temporarily, so that Var_SubstVar will also
substitute it in varmodifiers expressions.

/* $OpenPackages$ */
/* $OpenBSD: cond_int.h,v 1.4 2007/07/08 17:44:20 espie Exp $ */

/* List of all keywords recognized by the make parser */
#define COND_IF		"if"
#define COND_IFDEF	"ifdef"
#define COND_IFNDEF	"ifndef"
#define COND_IFMAKE	"ifmake"
#define COND_IFNMAKE	"ifnmake"
#define COND_ELSE	"else"
#define COND_ELIF	"elif"
#define COND_ELIFDEF	"elifdef"
#define COND_ELIFNDEF	"elifndef"
#define COND_ELIFMAKE	"elifmake"
#define COND_ELIFNMAKE	"elifnmake"
#define COND_ENDIF	"endif"
#define COND_FOR	"for"
#define COND_ENDFOR	"endfor"
#define COND_INCLUDE	"include"
#define COND_UNDEF	"undef"
#define COND_POISON	"poison"