make or kmod.mk broken
Max Laier
max at love2party.net
Sat Jan 14 12:12:59 PST 2006
On Saturday 14 January 2006 20:50, Ruslan Ermilov wrote:
> On Sat, Jan 14, 2006 at 07:57:55AM +0100, 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.
> >
> > In any case we have to fix either kmod.mk or 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.
>
> This OTOH works since FOO variable is special (it's evaluated at parse
> time):
>
> STUFF= foo bar foobar
>
> mtest:
> .for FOO in foo
> @echo ${STUFF:M${FOO}}
> .endfor
Okay, I knew there was a catch. So this can be worked around, thanks for the
hint.
> If there are other instances such as the example you've given, they should
> indeed be fixed.
I don't see any, sorry for the noise.
--
/"\ Best regards, | mlaier at freebsd.org
\ / Max Laier | ICQ #67774661
X http://pf4freebsd.love2party.net/ | mlaier at EFnet
/ \ ASCII Ribbon Campaign | Against HTML Mail and News
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20060114/476a8cae/attachment.bin
More information about the freebsd-current
mailing list