Skip to content

Commit

Permalink
Do not hardcode "make:" in diagnostic messages.
Browse files Browse the repository at this point in the history
Define PROG_NAME, based on the value of PROG
in the Makefile.
  • Loading branch information
rodrigc committed Feb 12, 2010
1 parent da3c853 commit 1594bb4
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions usr.bin/jbuild/Buildfile
Expand Up @@ -32,6 +32,7 @@ NO_SHARED ?= YES

CFLAGS += -I${.CURDIR}
CFLAGS += -DMAKE_VERSION=\"5200408120\"
CFLAGS += -DPROG_NAME=\"${PROG}\"
CFLAGS += -DDEFSHELLNAME=\"sh\"
CFLAGS += -I${.CURDIR}/filemon

Expand Down
2 changes: 1 addition & 1 deletion usr.bin/jbuild/Makefile
Expand Up @@ -17,7 +17,7 @@ NO_MAN=
IGNORE_PRAGMA= YES
DEBUG_FLAGS+= -g

CFLAGS+= -DMAKE_VERSION=\"8000000000\"
CFLAGS+= -DMAKE_VERSION=\"8000000000\" -DPROG_NAME=\"${PROG}\"

# We're building 'build', not 'make' so the behaviour is different in
# some areas like defaulting to silent.
Expand Down
2 changes: 1 addition & 1 deletion usr.bin/make/Makefile
Expand Up @@ -11,7 +11,7 @@ SRCS= arch.c buf.c cond.c dir.c for.c hash.c hash_tables.c job.c \
WARNS?= 6
NO_SHARED?= YES

CFLAGS+=-DMAKE_VERSION=\"5200408120\"
CFLAGS+=-DMAKE_VERSION=\"5200408120\" -DPROG_NAME=\"${PROG}\"
# There is no obvious performance improvement currently.
# CFLAGS+=-DUSE_KQUEUE

Expand Down
2 changes: 1 addition & 1 deletion usr.bin/make/job.c
Expand Up @@ -1731,7 +1731,7 @@ Job_CheckCommands(GNode *gn, void (*abortProc)(const char *, ...))
* this node's parents so they never get examined.
*/
static const char msg[] =
"make: don't know how to make";
PROG_NAME ": don't know how to make";

if (gn->type & OP_OPTIONAL) {
fprintf(stdout, "%s %s(ignored)\n",
Expand Down
6 changes: 3 additions & 3 deletions usr.bin/make/main.c
Expand Up @@ -1502,13 +1502,13 @@ main(int argc, char **argv)

Path_Expand(defsysmk, &sysIncPath, &sysMkPath);
if (Lst_IsEmpty(&sysMkPath))
Fatal("make: no system rules (%s).", PATH_DEFSYSMK);
Fatal(PROG_NAME ": no system rules (%s).", PATH_DEFSYSMK);
LST_FOREACH(ln, &sysMkPath) {
if (!ReadMakefile(Lst_Datum(ln)))
break;
}
if (ln != NULL)
Fatal("make: cannot open %s.", (char *)Lst_Datum(ln));
Fatal(PROG_NAME ": cannot open %s.", (char *)Lst_Datum(ln));
Lst_Destroy(&sysMkPath, free);
}

Expand All @@ -1520,7 +1520,7 @@ main(int argc, char **argv)
break;
}
if (ln != NULL)
Fatal("make: cannot open %s.", (char *)Lst_Datum(ln));
Fatal(PROG_NAME ": cannot open %s.", (char *)Lst_Datum(ln));
#ifdef JBUILD
} else
TryReadMakefile("Buildfile");
Expand Down
2 changes: 1 addition & 1 deletion usr.bin/make/util.c
Expand Up @@ -181,7 +181,7 @@ Punt(const char *fmt, ...)
va_list ap;

va_start(ap, fmt);
fprintf(stderr, "make: ");
fprintf(stderr, PROG_NAME ": ");
vfprintf(stderr, fmt, ap);
va_end(ap);
fprintf(stderr, "\n");
Expand Down

0 comments on commit 1594bb4

Please sign in to comment.