Re: compiling external kernel modules (comedi.org)

From: David Woodhouse
Date: Mon Aug 11 2003 - 09:00:08 EST


On Sun, 2003-08-03 at 00:05, Sam Ravnborg wrote:
> EXTRA_CFLAGS := -I$(obj)/../include
> in the Makefile should do the trick.

Be careful -- in the case where you're building a newer driver than one
which is already in the kernel, you may need to ensure your own include
directory supersedes the kernel's. In that case 'CC=$(CROSS_COMPILE)gcc
-I$(obj)/../include' may be useful.

An example which is currently working for 2.4 and 2.6 kernels, and which
used to work for 2.2 too until quite recently, is at
http://cvs.infradead.org/cgi-bin/cvsweb.cgi/mtd/drivers/mtd/

Some people seem to think that the 'SUBDIRS=' trick is a new thing for
2.6. It's not -- it's worked for ever, and was _always_ the only
reliable way of building modules to match the kernel.


--
dwmw2

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