Date: Thu, 5 Feb 2015 20:30:44 -0700 From: Warner Losh <imp@bsdimp.com> To: NGie Cooper <yaneurabeya@gmail.com> Cc: "freebsd-arch@freebsd.org" <arch@freebsd.org>, "Simon J. Gerraty" <sjg@juniper.net> Subject: Re: Better way to do conditional inclusion in make Message-ID: <4B573F3A-B1BA-4D6E-B2DB-5EA56ECF0321@bsdimp.com> In-Reply-To: <CAGHfRMCNMoisdn=Xheg-V5SnJhvB1yfk2s_RJc%2BSHYLwt4eekA@mail.gmail.com> References: <39C20BA1-E6B1-4DAE-95BB-8011A0A64D54@bsdimp.com> <54D40DC4.9070907@freebsd.org> <CAGHfRMAdOTUQZvU5D_1KYEyZdoaD4RJ2BTTOgUjrm3sK31U0kw@mail.gmail.com> <5180.1423185968@chaos> <CAGHfRMCNMoisdn=Xheg-V5SnJhvB1yfk2s_RJc%2BSHYLwt4eekA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> On Feb 5, 2015, at 6:39 PM, NGie Cooper <yaneurabeya@gmail.com> wrote: >=20 > On Thu, Feb 5, 2015 at 5:26 PM, Simon J. Gerraty <sjg@juniper.net> = wrote: >> NGie Cooper <yaneurabeya@gmail.com> wrote: >>>> how does it cope with the case where a single file is dependent on = either of >>>> two options. >>>> (we have this in our tree.. not sure if it occurs in the FreeBSD = tree.) >>>> file could occur in both lists or twice in one list.. >>>=20 >>> This is a good, valid point. I think that Warner's proposal will fix >>> the simple case (using one knob), but not the more complex case. >>=20 >> FILES:=3D ${FILES:O:u} >>=20 >> should cover that case. >=20 > Yes, but not this: >=20 > .if ${MK_BAR} !=3D "no" && ${MK_FOO} !=3D "no" > FILES+=3D a_lot_of_bar_in_my_foo > .endif There=E2=80=99s very few cases of this in the tree, so who cares :) You = just add the old school .if. >>> What concerns me about the short description of the implementation, >>> (and something that I'm going to add to the phabricator review) is >>> that this will: >>>=20 >>> 1. Break using FILESGROUPS >>=20 >> Why? >=20 > The same reason why bsd.progs.mk didn't work with bsd.prog.mk on > FreeBSD out of the box originally -- defaults: bsd.progs.mk is evil and should die :) I tried to leave this line out, = but couldn=E2=80=99t :) > 10 FILESGROUPS?=3D FILES > 11 > 12 .for group in ${FILESGROUPS} > 13 buildfiles: ${${group}} > 14 .endfor > 15 >=20 > Warner's change (based on what I understand, again I haven't looked at > the review yet=E2=80=A6) You should, it would answer why this isn=E2=80=99t an issue. > would require setting FILESGROUPS explicitly. So if > you had a Makefile snippet that defines the non-default FILESGROUPS > already, it will break that usecase. Why? I don=E2=80=99t set why it matters at all. This wouldn=E2=80=99t = affect the FILES variable expansion in line 13 at all. How would it break? >>> 2. Requires creating snippets for dealing with magic in bsd.*.mk (I >>> wouldn't want this magic going into the general purpose snippets >>> because it would probably break backwards compatibility). >>=20 >> Not necessarily eg. if you clean/simplify the list after building it. >=20 > I'll delay my reply on this because my other replies might change my = question. OK. Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B573F3A-B1BA-4D6E-B2DB-5EA56ECF0321>