Date: Thu, 5 Feb 2015 20:27:05 -0700 From: Warner Losh <imp@bsdimp.com> To: "Simon J. Gerraty" <sjg@juniper.net> Cc: "freebsd-arch@freebsd.org" <arch@freebsd.org> Subject: Re: Better way to do conditional inclusion in make Message-ID: <6B52B39B-EC45-4723-99AE-71EFC917B9A0@bsdimp.com> In-Reply-To: <6819.1423185743@chaos> References: <39C20BA1-E6B1-4DAE-95BB-8011A0A64D54@bsdimp.com> <54D40DC4.9070907@freebsd.org> <6819.1423185743@chaos>
next in thread | previous in thread | raw e-mail | index | archive | help
> On Feb 5, 2015, at 6:22 PM, Simon J. Gerraty <sjg@juniper.net> wrote:
>=20
> Julian Elischer <julian@freebsd.org> 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
> If you accept the premise that order of the list shouldn't matter,
> one can simply apply :O:u to suppress dups.
The order of the list doesn=E2=80=99t matter. If it does, that=E2=80=99s =
a bug in the list and/or
the dependencies and that should be fixed. I=E2=80=99m not aware of any =
place in the
tree where this matters that doesn=E2=80=99t have some secondary =
ordering mechanism
(see the libraries for one such thing).
The phabricator review already has this construct to sort and suppress =
dups.
Where this conditional breaks down is when you have something predicated
on MACHINE_ARCH and MK_foo. Makes it very hard to have FILES.${MACHINE}
added as well. In user land this isn=E2=80=99t so common (it happens, =
but not so much
and most of it would disappear if we had some kind of always no flag for
options that flat out can=E2=80=99t work on a given arch)[*]. In the =
kernel though it happens
a lot with a lot of annoying duplication.
Warner
[*] Consider having something like
.if ${MACHINE} !=3D =E2=80=9Ci386=E2=80=9D && ${MACHINE} !=3D =
=E2=80=9Camd64=E2=80=9D
__ALWAYS_NO+=3D GERBILS PUPPIES WHALES
.endif
then MK_GERBILS would always be no (you aren=E2=80=99t allowed to set =
another value),
and you don=E2=80=99t have to check for architectures where it is used =
to exclude it. I
haven=E2=80=99t worked out all the details of this yet, which is why I =
haven=E2=80=99t posted it
for discussion.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6B52B39B-EC45-4723-99AE-71EFC917B9A0>
