Fix running make in src directories without a Makefile giving confusing errors.
authorbdrewery <bdrewery@FreeBSD.org>
Thu, 24 Sep 2015 17:36:18 +0000 (17:36 +0000)
committerbdrewery <bdrewery@FreeBSD.org>
Thu, 24 Sep 2015 17:36:18 +0000 (17:36 +0000)
commitf21426aa3bc79685fc19251ab453697f6da621a3
tree6e70947afbff43096a64e52855b42064516a4ac1
parentd0fe87995fc6b70f4b9ea699678c3801105f3004
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
share/mk/Makefile