While reading thru gnu/usr.bin/cc, I couldn't figure out where DEPENDFILE
comes from.
Turns out it comes from FreeBSD, which currently defines it in bsd.own.mk.
The variable is empty on OpenBSD, thus yielding an always-false condition,
which was definitely not the intent.
This does put the right condition (probably not for long) and also fixes
make's parser to reject this kind of problem directly.
(currently running a src/xenocara make build/release to make sure this
doesn't affect other directories).
Once this is done, okay ?
Index: usr.bin/make/cond.c
===================================================================
RCS file: /cvs/src/usr.bin/make/cond.c,v
retrieving revision 1.51
diff -u -p -r1.51 cond.c
--- usr.bin/make/cond.c 21 Oct 2016 16:12:38 -0000 1.51
+++ usr.bin/make/cond.c 18 Jun 2017 10:13:32 -0000
@@ -292,6 +292,9 @@ CondDoExists(struct Name *arg)
bool result;
char *path;
+ if (arg->s == arg->e)
+ Parse_Error(PARSE_FATAL, "Empty file name in .if exists()");
+
path = Dir_FindFilei(arg->s, arg->e, defaultPath);
if (path != NULL) {
result = true;
Index: gnu/usr.bin/cc/cc_tools/Makefile
===================================================================
RCS file: /cvs/src/gnu/usr.bin/cc/cc_tools/Makefile,v
retrieving revision 1.14
diff -u -p -r1.14 Makefile
--- gnu/usr.bin/cc/cc_tools/Makefile 1 Sep 2016 11:03:09 -0000 1.14
+++ gnu/usr.bin/cc/cc_tools/Makefile 18 Jun 2017 10:13:32 -0000
@@ -533,7 +533,7 @@ CLEANFILES+= ${GENSRCS} ${GENONLY} ${GEN
#-----------------------------------------------------------------------
# Manual dependencies.
-.if !exists(${DEPENDFILE})
+.if !exists(.depend)
.include "Makefile.dep"
.endif