Re: Can't build external module against 2.6.0-test6 kernel

From: Mark Hounschell
Date: Tue Oct 14 2003 - 13:32:01 EST


Sam Ravnborg wrote:
>
> On Tue, Oct 14, 2003 at 07:28:37AM -0400, Mark Hounschell wrote:
> > Ok, I can now build it but I have to hardcode _my_ include directories in the
> > Makefile like:
> >
> > /home/markh/work2/pcirtom_tst/driver/Makefile:
> >
> > EXTRA_CFLAGS = -I/home/markh/work2/pcirtom_tst/include/linux/sys
> > -I/home/markh/work2/pcirtom_tst/include/linux
> > -I/home/markh/work2/pcirtom_tst/include
> Use:
> EXTRA_CFLAGS := -I$(src)/include/linux/sys
> EXTRA_CFLAGS += -I$(src)/include/linux
> EXTRA_CFLAGS += -I$(src)/include
>
> [Sidenote - you should only need the second line. Files in include/sys
> should be included as:
> #include <sys/file.h>
>
> And there should be no .h files in the linux directory].
>
> > ifneq ($(KERNELRELEASE),)
> > obj-m += rtom.o
> > else
> > KDIR := /lib/modules/$(shell uname -r)/build
> > PWD := $(shell pwd)
> > default:
> > $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
> > endif
> >
> > My driver tree looks like
> >
> > driver/
> > include/
> > diags/
> > samples/
> > library/
> >
> > I've also tried setting the EXTRA_CFLAGS var in the top makefile but it
> > doesn't seem to get passed down when the driver is compiled??
> EXTRA_CFLAGS are only relevant for the current kbuild Makefile - so
> it does not make sense to add it to the top-level Makefile.
>
> Sam

Thanks, defining the EXTRA-CFLAGS how and where you indicated did the trick.
Is there also now special tricks for getting a library that goes with the driver
to work? None of my IOCTLS are making it into the driver.

Ragards
Mark
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/