From owner-freebsd-arch@FreeBSD.ORG Fri Feb 6 06:10:22 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 384E3506; Fri, 6 Feb 2015 06:10:22 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0130.outbound.protection.outlook.com [157.56.110.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92C27C06; Fri, 6 Feb 2015 06:10:20 +0000 (UTC) Received: from CO2PR05CA047.namprd05.prod.outlook.com (10.141.241.175) by DM2PR05MB448.namprd05.prod.outlook.com (10.141.104.152) with Microsoft SMTP Server (TLS) id 15.1.75.20; Fri, 6 Feb 2015 06:10:12 +0000 Received: from BN1BFFO11FD027.protection.gbl (2a01:111:f400:7c10::1:187) by CO2PR05CA047.outlook.office365.com (2a01:111:e400:1429::47) with Microsoft SMTP Server (TLS) id 15.1.81.19 via Frontend Transport; Fri, 6 Feb 2015 06:10:12 +0000 Received: from P-EMF02-SAC.jnpr.net (66.129.239.16) by BN1BFFO11FD027.mail.protection.outlook.com (10.58.144.90) with Microsoft SMTP Server (TLS) id 15.1.87.10 via Frontend Transport; Fri, 6 Feb 2015 06:10:11 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMF02-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.146.0; Thu, 5 Feb 2015 22:10:10 -0800 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id t166AAW98868; Thu, 5 Feb 2015 22:10:10 -0800 (PST) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id CB73C580A3; Thu, 5 Feb 2015 22:10:09 -0800 (PST) To: NGie Cooper Subject: Re: Better way to do conditional inclusion in make In-Reply-To: References: <39C20BA1-E6B1-4DAE-95BB-8011A0A64D54@bsdimp.com> <54D40DC4.9070907@freebsd.org> <5180.1423185968@chaos> Comments: In-reply-to: NGie Cooper message dated "Thu, 05 Feb 2015 17:39:20 -0800." From: "Simon J. Gerraty" X-Mailer: MH-E 8.0.3; nmh 1.3; GNU Emacs 22.3.1 Date: Thu, 5 Feb 2015 22:10:09 -0800 Message-ID: <11865.1423203009@chaos> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.16 as permitted sender) Authentication-Results: spf=softfail (sender IP is 66.129.239.16) smtp.mailfrom=sjg@juniper.net; freebsd.org; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:66.129.239.16; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(24454002)(51704005)(50466002)(48376002)(62966003)(46102003)(93886004)(50986999)(19580395003)(117636001)(87936001)(19580405001)(86362001)(47776003)(33716001)(2950100001)(6806004)(1411001)(77156002)(106466001)(105596002)(110136001)(77096005)(50226001)(57986006)(76506005)(92566002)(76176999)(43043002)(62816006)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR05MB448; H:P-EMF02-SAC.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:DM2PR05MB448; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:DM2PR05MB448; X-Forefront-PRVS: 047999FF16 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:DM2PR05MB448; X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2015 06:10:11.5582 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.16] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR05MB448 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 06:10:22 -0000 NGie Cooper wrote: > .if ${MK_BAR} != "no" && ${MK_FOO} != "no" > FILES+= a_lot_of_bar_in_my_foo > .endif > Actually the same idea can handle that: FILES+= ${FILES.yesyes} FILES.${MK_BAR}${MK_FOO}+= a_lot_of_bar_in_my_foo extend as far as you like > >> 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: > >> > >> 1. Break using FILESGROUPS > > > > Why? > > The same reason why bsd.progs.mk didn't work with bsd.prog.mk on > FreeBSD out of the box originally -- defaults: > > 10 FILESGROUPS?= FILES > 11 > 12 .for group in ${FILESGROUPS} > 13 buildfiles: ${${group}} > 14 .endfor > 15 If you do FILES:= ${FILES} prior to the above and even if you don't I don't think the behavior would change - at least for the snippet quoted. ${${group}} would still expand to the same thing, and dependency rules don't care if something is listed more than once FILES:= ${FILES} would probably be a good idea anyway though. > Warner's change (based on what I understand, again I haven't looked at > the review yet...) would require setting FILESGROUPS explicitly. So if > you had a Makefile snippet that defines the non-default FILESGROUPS > already, it will break that usecase. I don't think Warners change - per the brief description makes no difference to FILESGROUPS?= FILES