Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jan 2006 18:08:39 +0100
From:      Hartmut Brandt <hartmut.brandt@dlr.de>
To:        Max Laier <max@love2party.net>
Cc:        freebsd-current@freebsd.org
Subject:   Re: make or kmod.mk broken
Message-ID:  <43C93017.3080305@dlr.de>
In-Reply-To: <200601140758.02019.max@love2party.net>
References:  <200601140758.02019.max@love2party.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43C93017.3080305>