From owner-freebsd-arch@FreeBSD.ORG Fri Feb 6 01:39:21 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 011E2EB3; Fri, 6 Feb 2015 01:39:20 +0000 (UTC) Received: from mail-ig0-x229.google.com (mail-ig0-x229.google.com [IPv6:2607:f8b0:4001:c05::229]) (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 BC38EC5A; Fri, 6 Feb 2015 01:39:20 +0000 (UTC) Received: by mail-ig0-f169.google.com with SMTP id hl2so10076570igb.0; Thu, 05 Feb 2015 17:39:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=no64lzN8SjqkjbgfM0zD9B2fN4wZWXBRtNlFfxVbYvc=; b=03GPjg2j1QmGG6ur0DdqJo8ICnMhkSfIDPdkVPPguNvKCL3PfxfDP/Iq0BYBYysCbD xlXq24RQb+rgF6PtHOhEA9HOXc2eZMpUVdpnoIrLUp70jQN7KSDVv+pdszXzrGZci25E EWCJ5C1Fe0wOBrEE3eUrZ+dDh27+kWRjuJCvPuYlR2pC+P6ka3RkEZtDNeVX//GJiD57 rYc7kfFf0bqroa2CiaS1BcG2sASEdgx5ICL1DxI/3a7iiBxttclpiOcdwDEJB5hSvbkn qcUcJeSQb4udShJ+3+g7TaceN2PZyMsv2YsRQ5RFucdoY846LlfwJgMIyw3lYB/NGVdx LVSg== MIME-Version: 1.0 X-Received: by 10.50.66.243 with SMTP id i19mr1550799igt.7.1423186760089; Thu, 05 Feb 2015 17:39:20 -0800 (PST) Received: by 10.50.182.233 with HTTP; Thu, 5 Feb 2015 17:39:20 -0800 (PST) In-Reply-To: <5180.1423185968@chaos> References: <39C20BA1-E6B1-4DAE-95BB-8011A0A64D54@bsdimp.com> <54D40DC4.9070907@freebsd.org> <5180.1423185968@chaos> Date: Thu, 5 Feb 2015 17:39:20 -0800 Message-ID: Subject: Re: Better way to do conditional inclusion in make From: NGie Cooper To: "Simon J. Gerraty" Content-Type: text/plain; charset=UTF-8 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 01:39:21 -0000 On Thu, Feb 5, 2015 at 5:26 PM, Simon J. Gerraty wrote: > NGie Cooper 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.. >> >> 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. > > FILES:= ${FILES:O:u} > > should cover that case. Yes, but not this: .if ${MK_BAR} != "no" && ${MK_FOO} != "no" FILES+= a_lot_of_bar_in_my_foo .endif >> 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 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. >> 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). > > Not necessarily eg. if you clean/simplify the list after building it. I'll delay my reply on this because my other replies might change my question.