SCCS-vsn: usr.bin/make/main.c 5.11
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 5.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c 5.11 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
static int printGraph; /* -p flag */
static Boolean noBuiltins; /* -r flag */
static int printGraph; /* -p flag */
static Boolean noBuiltins; /* -r flag */
-static Lst makefiles; /* List of makefiles to read (in
- * order) */
+static Lst makefiles; /* ordered list of makefiles to read */
int maxJobs; /* -J argument */
static int maxLocal; /* -L argument */
Boolean debug; /* -d flag */
int maxJobs; /* -J argument */
static int maxLocal; /* -L argument */
Boolean debug; /* -d flag */
return;
for (; *line == ' '; ++line);
return;
for (; *line == ' '; ++line);
- argv = Str_BreakString (line, " \t", "\n", &argc);
+ argv = Str_BreakString(line, " \t", "\n", &argc);
MainParseArgs(argc, argv);
Str_FreeVec(argc, argv);
}
MainParseArgs(argc, argv);
Str_FreeVec(argc, argv);
}
Lst targs; /* target nodes to create -- passed to Make_Init */
Boolean outOfDate; /* FALSE if all targets up to date */
Lst targs; /* target nodes to create -- passed to Make_Init */
Boolean outOfDate; /* FALSE if all targets up to date */
- create = Lst_Init (FALSE);
+ create = Lst_Init(FALSE);
makefiles = Lst_Init(FALSE);
beSilent = FALSE; /* Print commands as executed */
ignoreErrors = FALSE; /* Pay attention to non-zero returns */
makefiles = Lst_Init(FALSE);
beSilent = FALSE; /* Print commands as executed */
ignoreErrors = FALSE; /* Pay attention to non-zero returns */
* if it was (makefile != (char *) NULL), or the default Makefile and
* makefile, in that order, if it wasn't.
*/
* if it was (makefile != (char *) NULL), or the default Makefile and
* makefile, in that order, if it wasn't.
*/
- if (!noBuiltins && !ReadMakefile (DEFSYSMK))
- Fatal ("Could not open system rules (%s)", DEFSYSMK);
+ if (!noBuiltins && !ReadMakefile(DEFSYSMK))
+ Fatal("make: no system rules (%s).", DEFSYSMK);
if (!Lst_IsEmpty(makefiles)) {
LstNode ln;
ln = Lst_Find(makefiles, (ClientData)NULL, ReadMakefile);
if (ln != NILLNODE)
if (!Lst_IsEmpty(makefiles)) {
LstNode ln;
ln = Lst_Find(makefiles, (ClientData)NULL, ReadMakefile);
if (ln != NILLNODE)
- Fatal ("Cannot open %s", (char *)Lst_Datum(ln));
+ Fatal("make: cannot open %s.", (char *)Lst_Datum(ln));
} else if (!ReadMakefile("makefile"))
(void)ReadMakefile("Makefile");
} else if (!ReadMakefile("makefile"))
(void)ReadMakefile("Makefile");
- Var_Append ("MFLAGS", Var_Value(MAKEFLAGS, VAR_GLOBAL), VAR_GLOBAL);
+ Var_Append("MFLAGS", Var_Value(MAKEFLAGS, VAR_GLOBAL), VAR_GLOBAL);
/* Install all the flags into the PMAKE envariable. */
#ifdef POSIX
/* Install all the flags into the PMAKE envariable. */
#ifdef POSIX
* variable's value is in the same format as the PATH envariable, i.e.
* <directory>:<directory>:<directory>...
*/
* variable's value is in the same format as the PATH envariable, i.e.
* <directory>:<directory>:<directory>...
*/
- if (Var_Exists ("VPATH", VAR_CMD)) {
+ if (Var_Exists("VPATH", VAR_CMD)) {
char *vpath, *path, *cp, savec;
/*
* GCC stores string constants in read-only memory, but
char *vpath, *path, *cp, savec;
/*
* GCC stores string constants in read-only memory, but
*/
static char VPATH[] = "${VPATH}";
*/
static char VPATH[] = "${VPATH}";
- vpath = Var_Subst (VPATH, VAR_CMD, FALSE);
+ vpath = Var_Subst(VPATH, VAR_CMD, FALSE);
path = vpath;
do {
/* skip to end of directory */
path = vpath;
do {
/* skip to end of directory */
- for (cp = path; *cp != ':' && *cp != '\0'; cp++) {
- continue;
- }
+ for (cp = path; *cp != ':' && *cp != '\0'; cp++);
/* Save terminator character so know when to stop */
savec = *cp;
*cp = '\0';
/* Save terminator character so know when to stop */
savec = *cp;
*cp = '\0';
if (Lst_IsEmpty(create))
targs = Parse_MainName();
else
if (Lst_IsEmpty(create))
targs = Parse_MainName();
else
- targs = Targ_FindList (create, TARG_CREATE);
+ targs = Targ_FindList(create, TARG_CREATE);
/*
* this was original amMake -- want to allow parallelism, so put this
/*
* this was original amMake -- want to allow parallelism, so put this
if (!queryFlag) {
if (maxLocal == -1)
maxLocal = maxJobs;
if (!queryFlag) {
if (maxLocal == -1)
maxLocal = maxJobs;
- Job_Init (maxJobs, maxLocal);
+ Job_Init(maxJobs, maxLocal);
Targ_PrintGraph(2);
if (queryFlag && outOfDate)
Targ_PrintGraph(2);
if (queryFlag && outOfDate)
ReadMakefile(fname)
char *fname; /* makefile to read */
{
ReadMakefile(fname)
char *fname; /* makefile to read */
{
- if (!strcmp (fname, "-")) {
+ if (!strcmp(fname, "-")) {
Parse_File("(stdin)", stdin);
Var_Set("MAKEFILE", "", VAR_GLOBAL);
} else {
Parse_File("(stdin)", stdin);
Var_Set("MAKEFILE", "", VAR_GLOBAL);
} else {
+ va_list ap;
+ char *fmt;
+
if (jobsRunning)
Job_Wait();
if (jobsRunning)
Job_Wait();
+
+ va_start(ap);
+ fmt = va_arg(ap, char *);
+ (void)vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ (void)fprintf(stderr, "\n");
+ (void)fflush(stderr);
if (printGraph & 2)
Targ_PrintGraph(2);
if (printGraph & 2)
Targ_PrintGraph(2);
+ va_list ap;
+ char *fmt;
+
+ va_start(ap);
+ fmt = va_arg(ap, char *);
+ (void)vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ (void)fprintf(stderr, "\n");
+ (void)fflush(stderr);
+