Formerly main.c.~70~

This commit is contained in:
Roland McGrath 1993-01-25 22:16:33 +00:00
parent cf197b7550
commit c316ab7609

38
main.c
View file

@ -903,14 +903,14 @@ main (argc, argv, envp)
register unsigned int i, j = 0; register unsigned int i, j = 0;
for (i = 1; i < argc; ++i) for (i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-f")) if (!strcmp (argv[i], "-f"))
{ {
char *p = &argv[i][2]; char *p = &argv[i][2];
if (*p == '\0') if (*p == '\0')
argv[++i] = makefiles->list[j]; argv[++i] = makefiles->list[j];
else else
argv[i] = concat ("-f", makefiles->list[j], ""); argv[i] = concat ("-f", makefiles->list[j], "");
++j; ++j;
} }
} }
if (directories != 0 && directories->idx > 0) if (directories != 0 && directories->idx > 0)
{ {
@ -992,8 +992,7 @@ main (argc, argv, envp)
abort (); abort ();
} }
} }
else
if (goals == 0)
{ {
if (read_makefiles == 0) if (read_makefiles == 0)
fatal ("No targets specified and no makefile found"); fatal ("No targets specified and no makefile found");
@ -1430,7 +1429,7 @@ define_makeflags (all, makefile)
else if (cs->noarg_value != 0 else if (cs->noarg_value != 0
&& (*(unsigned int *) cs->value_ptr == && (*(unsigned int *) cs->value_ptr ==
*(unsigned int *) cs->noarg_value)) *(unsigned int *) cs->noarg_value))
ADD_FLAG (0, 0); ADD_FLAG ("", 0); /* Optional value omitted; see below. */
else if (cs->c == 'j') else if (cs->c == 'j')
/* Special case for `-j'. */ /* Special case for `-j'. */
ADD_FLAG ("1", 1); ADD_FLAG ("1", 1);
@ -1453,7 +1452,7 @@ define_makeflags (all, makefile)
else if (cs->noarg_value != 0 else if (cs->noarg_value != 0
&& (*(double *) cs->value_ptr && (*(double *) cs->value_ptr
== *(double *) cs->noarg_value)) == *(double *) cs->noarg_value))
ADD_FLAG (0, 0); ADD_FLAG ("", 0); /* Optional value omitted; see below. */
else else
{ {
char *buf = (char *) alloca (100); char *buf = (char *) alloca (100);
@ -1494,10 +1493,17 @@ define_makeflags (all, makefile)
*p++ = flags->c; *p++ = flags->c;
if (flags->arg != 0) if (flags->arg != 0)
{ {
/* Add its argument too. */ /* A flag that takes an optional argument which in this case
*p++ = ' '; is omitted is specified by ARG being "" and ARGLEN being 0.
bcopy (flags->arg, p, flags->arglen); We must distinguish because a following flag appended without
p += flags->arglen; an intervening " -" is considered the arg for the first. */
if (flags->arglen > 0)
{
/* Add its argument too. */
*p++ = ' ';
bcopy (flags->arg, p, flags->arglen);
p += flags->arglen;
}
/* Write a following space and dash, for the next flag. */ /* Write a following space and dash, for the next flag. */
*p++ = ' '; *p++ = ' ';
*p++ = '-'; *p++ = '-';