Ensure files are created during the build when using bsd.subdir.mk.

When FILES is defined in a Makefile that _also_ includes bsd.subdir.mk, the
build of the files (if any) was not properly triggered during the build
stage.  This was because bsd.files.mk did not define the buildfiles target
if it was already defined... and bsd.subdir.mk defined this target on its
own, thus causing a conflict.

Fix this by unconditionally defining buildfiles from bsd.files.mk; this is
safe because nothing else in the tree needs to redefine this and because the
target itself contains no commands: all it does is define dependencies.
Also ensure that bsd.files.mk is always pulled in by bsd.test.mk regardless
of what bsd.prog.mk does.

These fixes allow "make installworld" to run cleanly on a system with
read-only src and obj trees.

This is "make tinderbox" clean.

Reviewed by:	imp
Obtained from:	jilles
This commit is contained in:
Julio Merino 2014-06-09 14:36:49 +00:00
parent 74ddec2b18
commit ada17d7bde
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=267276
2 changed files with 6 additions and 4 deletions

View File

@ -4,13 +4,14 @@
.error bsd.files.mk cannot be included directly.
.endif
.if !target(__<bsd.files.mk>__)
__<bsd.files.mk>__:
FILESGROUPS?= FILES
.if !target(buildfiles)
.for group in ${FILESGROUPS}
buildfiles: ${${group}}
.endfor
.endif
all: buildfiles
@ -65,3 +66,5 @@ _${group}INS: ${_${group}FILES}
realinstall: installfiles
.ORDER: beforeinstall installfiles
.endif # !target(__<bsd.files.mk>__)

View File

@ -82,8 +82,7 @@ test: aftertest
.if !empty(PROGS) || !empty(PROGS_CXX) || !empty(SCRIPTS)
.include <bsd.progs.mk>
.elif !empty(FILES)
.include <bsd.files.mk>
.endif
.include <bsd.files.mk>
.include <bsd.obj.mk>