Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jan 2006 21:50:54 +0200
From:      Ruslan Ermilov <ru@freebsd.org>
To:        Max Laier <max@love2party.net>
Cc:        freebsd-current@freebsd.org, harti@freebsd.org
Subject:   Re: make or kmod.mk broken
Message-ID:  <20060114195054.GB4687@ip.net.ua>
In-Reply-To: <200601140758.02019.max@love2party.net>
References:  <200601140758.02019.max@love2party.net>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
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

If there are other instances such as the example you've given, they should
indeed be fixed.


Cheers,
-- 
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)

iD8DBQFDyVYeqRfpzJluFF4RAg8sAJ9HPm1zfUPhM5uOLfp0U6Ok16bMLwCfYLDU
tXtTjJ/byS3nhTclnpr2Q3w=
=fec3
-----END PGP SIGNATURE-----
help

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