freebsd-skq/share/mk/Makefile
Bryan Drewery a00dbfa82b 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
2015-09-24 17:36:18 +00:00

72 lines
1.3 KiB
Makefile

# $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= \
auto.obj.mk \
bsd.README \
bsd.arch.inc.mk \
bsd.compiler.mk \
bsd.cpu.mk \
bsd.crunchgen.mk \
bsd.dep.mk \
bsd.doc.mk \
bsd.dtb.mk \
bsd.endian.mk \
bsd.files.mk \
bsd.incs.mk \
bsd.info.mk \
bsd.init.mk \
bsd.kmod.mk \
bsd.lib.mk \
bsd.libnames.mk \
bsd.links.mk \
bsd.man.mk \
bsd.mkopt.mk \
bsd.nls.mk \
bsd.obj.mk \
bsd.opts.mk \
bsd.own.mk \
bsd.port.mk \
bsd.port.options.mk \
bsd.port.post.mk \
bsd.port.pre.mk \
bsd.port.subdir.mk \
bsd.prog.mk \
bsd.progs.mk \
bsd.snmpmod.mk \
bsd.subdir.mk \
bsd.symver.mk \
bsd.sys.mk \
bsd.test.mk \
dirdeps.mk \
gendirdeps.mk \
install-new.mk \
meta.autodep.mk \
meta.stage.mk \
meta.subdir.mk \
meta.sys.mk \
stage-install.sh \
sys.mk \
sys.dependfile.mk \
version_gen.awk
NO_OBJ=
FILESDIR= ${BINDIR}/mk
.if ${MK_TESTS} != "no"
FILES+= atf.test.mk
FILES+= plain.test.mk
FILES+= suite.test.mk
FILES+= tap.test.mk
.endif
.include <bsd.prog.mk>
.endif # CURDIR == PARSEDIR