Date: Thu, 17 Apr 2014 11:11:59 -0700 From: "Simon J. Gerraty" <sjg@juniper.net> To: Warner Losh <imp@bsdimp.com> Cc: Baptiste Daroussin <bapt@freebsd.org>, freebsd-arch@freebsd.org, sjg@juniper.net Subject: Re: make WITH[OUT]_* more useful? Message-ID: <20140417181159.0EFEA5809E@chaos.jnpr.net> In-Reply-To: <06CC1B46-2BF2-439C-8F97-16EA8DD7805C@bsdimp.com> References: <20140401051327.F20F958097@chaos.jnpr.net> <20140401064316.GQ99393@ivaldir.etoilebsd.net> <766EFF76-7B41-423F-B447-DBA25BD14470@bsdimp.com> <20140401162912.7A9D058097@chaos.jnpr.net> <DBA8EC5A-0C9A-4EED-94CC-178BBAFA29DB@bsdimp.com> <20140401195249.8752258097@chaos.jnpr.net> <2349B38E-F6F2-4911-92F2-3D62FCBD73DA@bsdimp.com> <20140402212328.7CE8958097@chaos.jnpr.net> <5D9BD168-D7E5-477E-AEA3-47B24445C89F@bsdimp.com> <20140410034645.C058658097@chaos.jnpr.net> <DC1B53C9-AF5F-4CF7-A369-5881C71E7F77@bsdimp.com> <20140417063437.3BBF85809E@chaos.jnpr.net> <06CC1B46-2BF2-439C-8F97-16EA8DD7805C@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 17 Apr 2014 10:30:58 -0600, Warner Losh writes: >This was step one: separate out the options processing from the = >bsd.own.mk stuff. >Having a few lines that are generic would be nice to include. I=92d like = >to go ahead and >commit step 1, even if we refine things a bit later to keep the change = >sets manageable >and under control=85 Is that reasonable? It will help other areas and we = >don=92t need to >do much more than settle on filenames. :) Sure. Naming stuff is hard, and warrants early attention. On that front it occurred to me that (since it sets MK_*) bsd.mkopts.mk might be a good name for the pure mechanism makefile. So in the 3 level setup I mentioned you'd have: bsd.own.mk -> bsd.srcopts.mk -> bsd.mkopts.mk If that sounds ok, I think we can proceed to next step. >> Sorry, which file are you talking about?=20 > >My bsd.srcopts.mk was what I was talking about here needing to be added = >to share/mk/Makefile. Ah right. This is why I think separating the mechanism is good. The mechanism should definitely be installed - because it is very handy (assuming some of the restrictions are removed). The /usr/src "policy" is another matter (possibly bikeshed material ;-) >> FWIW I think all bsd.*.mk should get installed. >> but I think it perfectly reasonable to declare that anything matching = >the >> pattern local.* or src.* doesn't get installed. >> Hopefully that shouldn't surprise anyone either. > >IF we can achieve that separation, then great. Yep. >> To restate that slightly differently, you can think of these things as = >a >> hierarchy: >>=20 >> bsd.* mechanism for building stuff (not just /usr/src) >> src.* stuff just for building /usr/src >> local.* local tweaks to all the above > >Yes, as long as the MK_FOO variables that are really src building stuff = >don=92t >infect the bsd.foo.mk files, this could work out. Exactly. MK_* which are meaningful to bsd.*.mk need an option list in bsd.*.mk - bsd.own.mk being perhaps a natural location? For MK_* which are only actioned in makefiles like *bin/Makefile they can be configured via a src.* file since they do not need to be installed. By providing guidance and "obvious" places to list the two classes of knobs we can limit the infection risk. >Would we do a wholesale change of bsd.foo.mk to src.foo.mk for all the = >Makefiles I'm not sure that would be necessary. Having to support lots of active branches makes me leery of gratuitous changes ;-) If we had sys.mk do .-include "src.sys.mk" .-include "local.sys.mk" that would be sufficient to enable all sorts of cool stuff. Similarly, bsd.init.mk doing .-include "src.init.mk" .-include "local.init.mk" would allow for customization of things to be done after Makefile has been read. The above would be sufficient to allow src.* to influence bin/Makefile and lib/Makefile etc without the need to touch them. Other customization hooks would be cool too, bsd.sys.mk is a somewhat unfortunate name, but it would be handy to have another point for including {src,local}.*.mk at the end of the normal lib,prog,* mk files. Note that even though we don't install src.*.mk or local.*.mk, those hook points are still very useful to anyone building their own stuff with bsd.*.mk, since now they can customize their own builds without the need to hack bsd.*.mk Thanks --sjg
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140417181159.0EFEA5809E>