build Kyuafile.auto during buildworld, not installworld

Jilles Tjoelker jilles at stack.nl
Sat May 17 13:26:18 UTC 2014


For some time, I have needed local hacks to make installworld work with
a read-only /usr/obj (over NFS). It is also philosophically wrong to
build things during installworld.

I found two bugs that cause FILES not to be built during buildworld:

* bsd.files.mk does not create its buildfiles target when a buildfiles
  target already exists from bsd.subdir.mk.

* bsd.progs.mk does not include bsd.files.mk if an install target
  already exists (otherwise it does).

The below patch appears to fix both problems in a somewhat ugly way.

Index: share/mk/bsd.files.mk
===================================================================
--- share/mk/bsd.files.mk	(revision 266086)
+++ share/mk/bsd.files.mk	(working copy)
@@ -6,11 +6,10 @@
 
 FILESGROUPS?=	FILES
 
-.if !target(buildfiles)
+buildfiles: buildfiles0
 .for group in ${FILESGROUPS}
-buildfiles: ${${group}}
+buildfiles0: ${${group}}
 .endfor
-.endif
 
 all: buildfiles
 
Index: share/mk/bsd.test.mk
===================================================================
--- share/mk/bsd.test.mk	(revision 266086)
+++ share/mk/bsd.test.mk	(working copy)
@@ -82,7 +82,9 @@
 
 .if !empty(PROGS) || !empty(PROGS_CXX) || !empty(SCRIPTS)
 .include <bsd.progs.mk>
-.elif !empty(FILES)
+.endif
+# <bsd.progs.mk> may or may not include <bsd.files.mk>.
+.if !empty(FILES) && !target(buildfiles0)
 .include <bsd.files.mk>
 .endif
 

-- 
Jilles Tjoelker


More information about the freebsd-testing mailing list