version 1.57, 2002/03/02 00:23:14 |
version 1.58, 2002/12/30 02:29:24 |
|
|
int c; |
int c; |
int forceJobs = 0; |
int forceJobs = 0; |
|
|
|
#define OPTFLAGS "BD:I:PSV:d:ef:ij:km:nqrst" |
|
#define OPTLETTERS "BPSiknqrst" |
|
|
optind = 1; /* since we're called more than once */ |
optind = 1; /* since we're called more than once */ |
# define OPTFLAGS "BD:I:PSV:d:ef:ij:km:nqrst" |
optreset = 1; |
# define OPTLETTERS "BPSiknqrst" |
while (optind < argc) { |
rearg: while ((c = getopt(argc, argv, OPTFLAGS)) != -1) { |
switch (c = getopt(argc, argv, OPTFLAGS)) { |
switch (c) { |
|
case 'D': |
case 'D': |
Var_Set(optarg, "1", VAR_GLOBAL); |
Var_Set(optarg, "1", VAR_GLOBAL); |
record_option(c, optarg); |
record_option(c, optarg); |
|
|
Dir_AddDir(sysIncPath, optarg); |
Dir_AddDir(sysIncPath, optarg); |
record_option(c, optarg); |
record_option(c, optarg); |
break; |
break; |
|
case -1: |
|
/* Check for variable assignments and targets. */ |
|
if (!Parse_DoVar(argv[optind], VAR_CMD)) { |
|
if (!*argv[optind]) |
|
Punt("illegal (null) argument."); |
|
if (strcmp(argv[optind], "--") != 0) |
|
Lst_AtEnd(create, estrdup(argv[optind])); |
|
} |
|
optind++; /* skip over non-option */ |
|
break; |
default: |
default: |
posixParseOptLetter(c); |
posixParseOptLetter(c); |
} |
} |
|
|
compatMake = true; |
compatMake = true; |
|
|
oldVars = true; |
oldVars = true; |
|
|
/* |
|
* See if the rest of the arguments are variable assignments and |
|
* perform them if so. Else take them to be targets and stuff them |
|
* on the end of the "create" list. |
|
*/ |
|
for (argv += optind, argc -= optind; *argv; ++argv, --argc) |
|
if (!Parse_DoVar(*argv, VAR_CMD)) { |
|
if (!**argv) |
|
Punt("illegal (null) argument."); |
|
if (**argv == '-') { |
|
if ((*argv)[1]) |
|
optind = 0; /* -flag... */ |
|
else |
|
optind = 1; /* - */ |
|
goto rearg; |
|
} |
|
Lst_AtEnd(create, estrdup(*argv)); |
|
} |
|
} |
} |
|
|
/*- |
/*- |