From owner-freebsd-current@FreeBSD.ORG Sat Jan 14 17:07:19 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0FA8C16A41F for ; Sat, 14 Jan 2006 17:07:19 +0000 (GMT) (envelope-from hartmut.brandt@dlr.de) Received: from mail.cs.tu-berlin.de (mail.cs.tu-berlin.de [130.149.17.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF85D43D6B for ; Sat, 14 Jan 2006 17:07:03 +0000 (GMT) (envelope-from hartmut.brandt@dlr.de) Received: from mailhost.cs.tu-berlin.de (postfix@mail.cs.tu-berlin.de [130.149.17.13]) by mail.cs.tu-berlin.de (8.9.3p2/8.9.3) with ESMTP id SAA25457; Sat, 14 Jan 2006 18:07:01 +0100 (MET) Received: from localhost (localhost [127.0.0.1]) by mailhost.cs.tu-berlin.de (Postfix) with ESMTP id 56B64FC61; Sat, 14 Jan 2006 18:07:01 +0100 (MET) Received: from mailhost.cs.tu-berlin.de ([127.0.0.1]) by localhost (bueno [127.0.0.1]) (amavisd-new, port 10224) with ESMTP id 23608-28; Sat, 14 Jan 2006 18:06:59 +0100 (MET) 11253 Received: from dlr.de (pD9F9DE7E.dip.t-dialin.net [217.249.222.126]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: novo) by mailhost.cs.tu-berlin.de (Postfix) with ESMTP; Sat, 14 Jan 2006 18:06:59 +0100 (MET) Message-ID: <43C93017.3080305@dlr.de> Date: Sat, 14 Jan 2006 18:08:39 +0100 From: Hartmut Brandt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7b) Gecko/20040316 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Max Laier References: <200601140758.02019.max@love2party.net> In-Reply-To: <200601140758.02019.max@love2party.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at cs.tu-berlin.de X-Mailman-Approved-At: Tue, 17 Jan 2006 12:44:38 +0000 Cc: freebsd-current@freebsd.org Subject: Re: make or kmod.mk broken X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2006 17:07:19 -0000 Max Laier wrote: >Hi, > >in kmod.mk (and I believe in other places as well) we have constructs in the >form of this: ${SOMEARRAY:M${SOMEVAR}} However, make doesn't seem to >understand this. I don't see any traces that it ever did and I have no clue >if it should. > >I might well misunderstand things (not a make guru) so here is my testcase: > >| STUFF= foo bar foobar >| FOO=foo >| >| mtest: >| echo ${STUFF:M${FOO}} > >and "$make mtest" gives: >| echo } >| } > >this clearly suggests that make is not equipped to handle the variable >expansion here. > > Looks so. I suppose that we should use VarGetPattern() in modifier_M() in var.c to get the pattern instead of doing it by hand, though VarGetPattern() may need to know that we're getting a shell instead of a regexp pattern (special handling for '$' before ':'). >In any case we have to fix either kmod.mk or make. > > I would prefer to fix make. >On a related question: How can I get the actual location of a file that is >in .PATH? All I could come up with was ${.ALLSRC:M*${MY_FILE}} which doesn't >work as I am explaining here. > > > M*$(MY_FILE) would also match 'foobar' if MY_FILE is 'bar' which is probably not what you want. .IMPSRC might be what you want if you talk about an implicite rule. harti