Re: .PATH-problem [was Re: make or kmod.mk broken]

From: Ruslan Ermilov <ru_at_freebsd.org>
Date: Sat, 14 Jan 2006 22:36:31 +0200
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/:.*$//}
: 	_at_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

Received on Sat Jan 14 2006 - 19:42:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:50 UTC