/usr/local/share/mk ?

Kris Kennaway kris at obsecurity.org
Thu Feb 1 19:44:30 UTC 2007


On Thu, Feb 01, 2007 at 11:37:20AM -0800, Luigi Rizzo wrote:
> On Thu, Feb 01, 2007 at 02:20:51PM -0500, Kris Kennaway wrote:
> > On Thu, Feb 01, 2007 at 11:17:27AM -0800, Luigi Rizzo wrote:
> > > I have a port (the one mentioned in my previous msg)
> > > which needs to install its own make's include file,
> > > bsd.linux_kmod.mk , and I thought that there was
> > > a system-wide place such as ${PREFIX}/share/mk
> > > where the port could install the file in the first place,
> > > and where make would look for it by default.
> > > 
> > > But apparently i was wrong on both things...
> > > Now maybe the extra search path can be set with some
> > > system-wide option in /etc/make.conf (through .PATH ?)
> > > but then the problem to settle on one a name
> > > for /usr/local/share/mk remains...
> > 
> > You're right that there is no support for this.  Can you explain why
> > you need it?
> 
> The thing i am working on is an adaptation layer to build linux
> device drivers on FreeBSD:
> 
> 	http://info.iet.unipi.it/~luigi/FreeBSD/linux_bsd_kld.html
> 
> When you want to adapt a linux driver, all you should do is grab the
> linux sources, write a suitable Makefile.kld like this (this is a
> real, working example!)
> 
> 	.PATH: ${.CURDIR} # useless in this case
> 	# sources for the linux driver
> 	SRCS= ov511.c
> 	KMOD=ov511	# module name
> 
> 	KLINPATH=../linux_compat
> 	.include <${KLINPATH}/bsd.linux_kmod.mk>
> 
> and just do 'make -f Makefile.kld depend all"
> 
> If bsd.linux_kmod.mk goes into a central place i'd rather not
> have to remember to set KLINPATH but just write
> 
> 	.include <bsd.linux_kmod.mk>
> 
> Now, this may well be a one-of-a-kind case calling for an ad-hoc
> solution, but if all we need is accept to use ${PREFIX}/share/mk
> for third-party .mk files, this seems a better way to handle
> the problem.

After >10 years you are apparently the first person to want such a
feature, so this suggests the application is limited :)

> In term of port's backward compatibilty, the extra .PATH or -I
> could be supplied by the files in /usr/ports/Mk which people
> are expected to update anyways, right ?

That Makefile.kld would be a fragment of a port makefile, right?  Your
bsd.linux_kmod.mk could go in /usr/ports/Mk although it seems to make
more sense as part of /usr/src.

Kris


More information about the freebsd-ports mailing list