From owner-freebsd-arch@FreeBSD.ORG Fri Feb 6 00:41:51 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 87E09580 for ; Fri, 6 Feb 2015 00:41:51 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 583F07F3 for ; Fri, 6 Feb 2015 00:41:50 +0000 (UTC) Received: from Julian-MBP3.local (ppp121-45-238-204.lns20.per1.internode.on.net [121.45.238.204]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id t160fjfX051238 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 5 Feb 2015 16:41:47 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <54D40DC4.9070907@freebsd.org> Date: Fri, 06 Feb 2015 08:41:40 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Warner Losh , "freebsd-arch@freebsd.org" Subject: Re: Better way to do conditional inclusion in make References: <39C20BA1-E6B1-4DAE-95BB-8011A0A64D54@bsdimp.com> In-Reply-To: <39C20BA1-E6B1-4DAE-95BB-8011A0A64D54@bsdimp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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 00:41:51 -0000 On 2/6/15 1:56 AM, Warner Losh wrote: > Greetings, > > I’ve started a pass through the tree to cleanup how we do conditional inclusion in our build system. > > https://reviews.freebsd.org/D1781 > > It moves away from > > .if ${MK_foo} != “no” > FILES+= files > .endif > > and > > SUBDIRS= … ${_foo} … > ... > .if ${MK_foo} != “no” > _foo+= foo > .endif > > and instead more directly assigns things. We know that MK_foo is always going to be yes or no > for build options. We can leverage that fact, and the fact that bmake is so much better at variable > expansion than fmake was (especially in the early days) to instead move to something like: > > FILES=list of unconditional files here ${FILES.yes} > FILES.${MK_foo}+=foo bar biz > FILES.${MK_baz}+=baz bing boo > > which eliminates a whole lot of needless .if / .endif lines, lots of extra blank lines, etc. > > Comments? 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.. > Warner > > > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" > > >