aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2015-09-24 17:36:18 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2015-09-24 17:36:18 +0000
commita00dbfa82bdb95288b85b282d0d147d53c640cad (patch)
tree6e70947afbff43096a64e52855b42064516a4ac1 /share
parent1ff8129a59113358694c40a897c3f81b18a9d7e7 (diff)
downloadsrc-a00dbfa82bdb95288b85b282d0d147d53c640cad.tar.gz
src-a00dbfa82bdb95288b85b282d0d147d53c640cad.zip
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
Notes
Notes: svn path=/head/; revision=288179
Diffstat (limited to 'share')
-rw-r--r--share/mk/Makefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/share/mk/Makefile b/share/mk/Makefile
index d8aea5c5547e..eaa8e0f82867 100644
--- a/share/mk/Makefile
+++ b/share/mk/Makefile
@@ -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