build Kyuafile.auto during buildworld, not installworld

Garrett Cooper yaneurabeya at gmail.com
Fri Jun 13 01:01:47 UTC 2014


On Sat, May 17, 2014 at 6:26 AM, Jilles Tjoelker <jilles at stack.nl> wrote:
> 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

I would probably just remove the .if !target(buildfiles) part. I'd
make sure to do an -exp run with this though.

>  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

    I would just check for `!empty(FILES)` personally. I find it more
annoying how with some versions of make/versions of share/mk it would
install FILES multiple times (probably needs a sentinel somewhere,
like bsd.progs.mk...).
Thanks!
-Garrett


More information about the freebsd-testing mailing list