svn commit: r288179 - head/share/mk
Bryan Drewery
bdrewery at FreeBSD.org
Thu Sep 24 17:36:19 UTC 2015
Author: bdrewery
Date: Thu Sep 24 17:36:18 2015
New Revision: 288179
URL: https://svnweb.freebsd.org/changeset/base/288179
Log:
Fix running make in src directories without a Makefile giving confusing errors.
This fixes the following errors:
make: don't know how to make bsd.README. Stop
make: don't know how to make auto.obj.mk. Stop
This is easily seen in sys/dev/*.
The new behavior is now the expected output:
make: no target to make.
This would happen as MAKESYSPATH (.../share/mk) is auto added to the -I list.
Any directory where make is ran in the src tree that has no local Makefile
would then try executing the target in share/mk/Makefile, which by default
was to build the first entry in FILES. Of course, because bsd.README and
auto.obj.mk are not in the current directory the error is shown.
This check only works for bmake, but I will still MFC it with an extra
'!defined(.PARSEDIR) ||' guard for stable/10.
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Modified:
head/share/mk/Makefile
Modified: head/share/mk/Makefile
==============================================================================
--- head/share/mk/Makefile Thu Sep 24 17:23:41 2015 (r288178)
+++ head/share/mk/Makefile Thu Sep 24 17:36:18 2015 (r288179)
@@ -1,6 +1,11 @@
# $FreeBSD$
# @(#)Makefile 8.1 (Berkeley) 6/8/93
+# Only parse this if executing make in this directory, not in other places
+# in src that lack a Makefile, such as sys/dev/*. Otherwise the MAKESYSPATH
+# will read this Makefile since it auto includes it into -I.
+.if ${.CURDIR} == ${.PARSEDIR}
+
.include <src.opts.mk>
FILES= \
@@ -63,3 +68,4 @@ FILES+= tap.test.mk
.endif
.include <bsd.prog.mk>
+.endif # CURDIR == PARSEDIR
More information about the svn-src-all
mailing list