.PATH-problem [was Re: make or kmod.mk broken]
Ruslan Ermilov
ru at freebsd.org
Sat Jan 14 12:42:37 PST 2006
On Sat, Jan 14, 2006 at 09:03:32PM +0100, Max Laier wrote:
> On Saturday 14 January 2006 18:08, Hartmut Brandt wrote:
> > Max Laier wrote:
> > >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.
>
> What I am trying to do is parse a list of "filename:shortname"-objects. This
> is to support easy building of firmware modules. If things work as I want
> them to you can build a firmware module with a two line Makefile:
>
> | KMOD=somefirmware
> | FIRMWS=firmfile1.fw:somename1 firmfile2.fw:somename2
>
> and it works if the firmfiles are in the same directory, but if they are
> in .PATH it fails. I was looking at .IMPSRC initially as well, but failed to
> understand the concept :-\ ... any help greatly appreciated. Thanks.
>
: $ cat makefile
: .PATH: /tmp
:
: FIRMWS=firmfile1.fw:somename1 firmfile2.fw:somename2
:
: all:
: .for _firmw in ${FIRMWS}
: all: ${_firmw:C/^.*://}
: ${_firmw:C/^.*://}: ${_firmw:C/:.*$//}
: @echo building ${.TARGET} from ${.ALLSRC}
: .endfor
: $ make
: building somename1 from firmfile1.fw
: building somename2 from /tmp/firmfile2.fw
Cheers,
--
Ruslan Ermilov
ru at FreeBSD.org
FreeBSD committer
-------------- 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/60a54013/attachment.bin
More information about the freebsd-current
mailing list