/usr/local/share/mk ?

Luigi Rizzo rizzo at icir.org
Thu Feb 1 19:37:22 UTC 2007

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:


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

	.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.

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 ?


More information about the freebsd-ports mailing list