Re: ANN: LKMB (Linux Kernel Module Builder) version 0.1.16

David Woodhouse
2003-01-17T13:03:31Z

> print MAKEFILE "CFLAGS = -I/usr/src/linux/include -O2 -Wall -DMODULE -D__KERNEL__ -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2\n\n";

That's broken. you need to get the proper kernel CFLAGS, and you shouldn't
assume there's anything useful in /usr/src/linux.

Use "/lib/modules/`uname -r`/build" as a default kernel directory, but
allow it to be overridden somehow from the command line. Then do something
like...

make -C $(LINUXDIR) SUBDIRS=`pwd` modules

... to build your module. That way, all the kernel build stuff will be
correct; it'll be just as if you were in a normal subdirectory of the
kernel tree during a 'make modules' run.

--
dwmw2