version 1.75, 2007/07/30 09:39:18 |
version 1.76, 2007/07/30 09:51:53 |
|
|
opt[0] = '-'; |
opt[0] = '-'; |
opt[1] = c; |
opt[1] = c; |
opt[2] = '\0'; |
opt[2] = '\0'; |
Var_Append(MAKEFLAGS, opt, VAR_GLOBAL); |
Var_Append(MAKEFLAGS, opt); |
if (arg != NULL) |
if (arg != NULL) |
Var_Append(MAKEFLAGS, arg, VAR_GLOBAL); |
Var_Append(MAKEFLAGS, arg); |
} |
} |
|
|
static void |
static void |
|
|
c = optend ? -1 : getopt(argc, argv, OPTFLAGS); |
c = optend ? -1 : getopt(argc, argv, OPTFLAGS); |
switch (c) { |
switch (c) { |
case 'D': |
case 'D': |
Var_Set(optarg, "1", VAR_GLOBAL); |
Var_Set(optarg, "1"); |
record_option(c, optarg); |
record_option(c, optarg); |
break; |
break; |
case 'I': |
case 'I': |
|
|
|
|
if (d.object != d.current) |
if (d.object != d.current) |
Dir_AddDir(dirSearchPath, d.current); |
Dir_AddDir(dirSearchPath, d.current); |
Var_Set(".CURDIR", d.current, VAR_GLOBAL); |
Var_Set(".CURDIR", d.current); |
Var_Set(".OBJDIR", d.object, VAR_GLOBAL); |
Var_Set(".OBJDIR", d.object); |
|
|
/* |
/* |
* Initialize various variables. |
* Initialize various variables. |
|
|
* .MAKEFLAGS gets set to the empty string just in case. |
* .MAKEFLAGS gets set to the empty string just in case. |
* MFLAGS also gets initialized empty, for compatibility. |
* MFLAGS also gets initialized empty, for compatibility. |
*/ |
*/ |
Var_Set("MAKE", argv[0], VAR_GLOBAL); |
Var_Set("MAKE", argv[0]); |
Var_Set(".MAKE", argv[0], VAR_GLOBAL); |
Var_Set(".MAKE", argv[0]); |
Var_Set(MAKEFLAGS, "", VAR_GLOBAL); |
Var_Set(MAKEFLAGS, ""); |
Var_Set("MFLAGS", "", VAR_GLOBAL); |
Var_Set("MFLAGS", ""); |
Var_Set("MACHINE", machine, VAR_GLOBAL); |
Var_Set("MACHINE", machine); |
Var_Set("MACHINE_ARCH", machine_arch, VAR_GLOBAL); |
Var_Set("MACHINE_ARCH", machine_arch); |
|
|
/* |
/* |
* First snag any flags out of the MAKEFLAGS environment variable. |
* First snag any flags out of the MAKEFLAGS environment variable. |
|
|
for (ln = Lst_First(create); ln != NULL; ln = Lst_Adv(ln)) { |
for (ln = Lst_First(create); ln != NULL; ln = Lst_Adv(ln)) { |
char *name = (char *)Lst_Datum(ln); |
char *name = (char *)Lst_Datum(ln); |
|
|
Var_Append(".TARGETS", name, VAR_GLOBAL); |
Var_Append(".TARGETS", name); |
} |
} |
} else |
} else |
Var_Set(".TARGETS", "", VAR_GLOBAL); |
Var_Set(".TARGETS", ""); |
|
|
|
|
/* |
/* |
|
|
|
|
read_all_make_rules(noBuiltins, &makefiles, &d); |
read_all_make_rules(noBuiltins, &makefiles, &d); |
|
|
Var_Append("MFLAGS", Var_Value(MAKEFLAGS), VAR_GLOBAL); |
Var_Append("MFLAGS", Var_Value(MAKEFLAGS)); |
|
|
/* Install all the flags into the MAKEFLAGS env variable. */ |
/* Install all the flags into the MAKEFLAGS env variable. */ |
if (((p = Var_Value(MAKEFLAGS)) != NULL) && *p) |
if (((p = Var_Value(MAKEFLAGS)) != NULL) && *p) |
|
|
char *name; |
char *name; |
|
|
if (!strcmp(fname, "-")) { |
if (!strcmp(fname, "-")) { |
Var_Set("MAKEFILE", "", VAR_GLOBAL); |
Var_Set("MAKEFILE", ""); |
Parse_File(estrdup("(stdin)"), stdin); |
Parse_File(estrdup("(stdin)"), stdin); |
} else { |
} else { |
if ((stream = fopen(fname, "r")) != NULL) |
if ((stream = fopen(fname, "r")) != NULL) |
|
|
* placement of the setting here means it gets set to the last |
* placement of the setting here means it gets set to the last |
* makefile specified, as it is set by SysV make. |
* makefile specified, as it is set by SysV make. |
*/ |
*/ |
found: Var_Set("MAKEFILE", fname, VAR_GLOBAL); |
found: Var_Set("MAKEFILE", fname); |
Parse_File(fname, stream); |
Parse_File(fname, stream); |
} |
} |
return true; |
return true; |