basic driver build environment

M. Warner Losh imp at bsdimp.com
Sat Sep 17 12:57:01 PDT 2005


In message: <20050917183132.GK6440 at eyore.cobbled.net>
            n0g0013 <ttw at cobbled.net> writes:
: On 17.09-12:00, M. Warner Losh wrote:
: [ ... ]
: > : 	a.      cleaner config for building modules in random
: > : 	directory (thought '-I' to make would work but it doesn't)
: [ ... ]
: > When I'm developing a new module, I do the following:
: > 
: > setenv SYSDIR /path/to/freebsd/src/sys
: > make
: > 
: > The Makefile looks like
: > 
: > # Maybe have a .PATH here
: > 
: > KMOD=	     foo
: > SRCS=	     foo_a foo_b
: > 
: > .include <bsd.kmod.mk>
: > 
: > At work, we wrap setting SYSDIR in an include file, since our build
: > system knows about it.
: 
: i get the following (plus more similar) error/s
: 
: 	@/sys/bus.h:456:23: device_if.h: No such file or directory
: 
: even when setting the SYSDIR to "/usr/src/sys".  perhaps i'm missing
: something about the "wrap setting SYSDIR in an include file" to make
: it work???
: 
: if i understand correctly it's looking for the kernel architecture
: files from the kernel build (i.e in the 'obj' directory).
: 
: apologies if i'm being braindamaged here.

Add bus_if.h and device_if.h to your SRCS line.  They are generated.
If it is a pci device, you'll also need pci_if.h

Warner


More information about the freebsd-drivers mailing list