From owner-freebsd-arch@FreeBSD.ORG Fri Feb 6 03:27:07 2015 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9630375 for ; Fri, 6 Feb 2015 03:27:07 +0000 (UTC) Received: from mail-ig0-f179.google.com (mail-ig0-f179.google.com [209.85.213.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91D1BA16 for ; Fri, 6 Feb 2015 03:27:07 +0000 (UTC) Received: by mail-ig0-f179.google.com with SMTP id l13so4840731iga.0 for ; Thu, 05 Feb 2015 19:27:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=fCwbwvlHXb4ahwpY9J38yD1EycYO0ixyRuOQmJSIYLc=; b=Y0Gj5R/bPUJnHYyYnvRNL9t58VB2/Kl7lgxbqwd2yg96HvRJjRDrg601MUUDNX0d5R 97SKcyb05Efnvpy/sdYKZs95tGOH0sGT6poxZ8FHI1voeSUs7WdrBoDE1VIcv9+AnPkd aVtiZ0C89G+WXQ3kpWLrgxylxXM38S0bo5YOzEGs/QkJTWTO888OW4/xY+764UjKHerV 16jLaJB+euF0iQB7Z2RFBqKGd0mSCqYD6oYEhYCj/u9U7L0nMmnnZSJpYSFZYOGY1k/+ QpVutFt1Vqcns1v/8tkHwHq8VC5xCr62czRgvVbr+zqPRuvCczT4HFCbQLIinZZHQbSO su8Q== X-Gm-Message-State: ALoCoQkfas5uoP4VkJf/Sm9+cZSo9mKkOt/BNvnoRuLSP8t+TBJ7RD7YclRqRqDO9RSFN9JTgY0F X-Received: by 10.42.64.193 with SMTP id h1mr11097453ici.32.1423193226560; Thu, 05 Feb 2015 19:27:06 -0800 (PST) Received: from netflix-mac-wired.bsdimp.com ([50.253.99.174]) by mx.google.com with ESMTPSA id m5sm603680ige.5.2015.02.05.19.27.05 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Feb 2015 19:27:06 -0800 (PST) Sender: Warner Losh Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: Better way to do conditional inclusion in make From: Warner Losh In-Reply-To: <6819.1423185743@chaos> Date: Thu, 5 Feb 2015 20:27:05 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <6B52B39B-EC45-4723-99AE-71EFC917B9A0@bsdimp.com> References: <39C20BA1-E6B1-4DAE-95BB-8011A0A64D54@bsdimp.com> <54D40DC4.9070907@freebsd.org> <6819.1423185743@chaos> To: "Simon J. Gerraty" X-Mailer: Apple Mail (2.2070.6) Cc: "freebsd-arch@freebsd.org" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2015 03:27:08 -0000 > On Feb 5, 2015, at 6:22 PM, Simon J. Gerraty wrote: >=20 > Julian Elischer 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.=