Building a module from outside the kernel tree
Matthias Saou
thias at spam.spam.spam.spam.spam.spam.spam.egg.and.spam.freshrpms.net
Mon Oct 9 10:53:59 UTC 2006
Denis Leroy wrote :
> > I'd be interested in doing the same for the acx100 module, or
> > preferably the cleaned up and softmac based tiacx module from here :
> >
> > http://www.kernel.org/pub/linux/kernel/people/linville/
> >
> > But the files, especially the included Makefile, are meant for the
> > module to be built at the same time as the kernel. The usual "make
> > -C /lib/modules.../build -M `pwd`" doesn't work, and I'm really not
> > familiar enough with makefiles, nor with the special makefile kernel
> > magic to understand how to adapt this :
> >
> > acx-common-y := wlan.o ioctl.o common.o
> > acx-usb-y := usb.o
> > acx-pci-y := pci.o
> >
> > obj-$(CONFIG_ACX_PCI) += acx-common.o acx-pci.o
> > obj-$(CONFIG_ACX_USB) += acx-common.o acx-usb.o
> >
> > If anyone knows what needs to be changed to get both modules built,
> > please let me know. Too bad this modules hasn't made it into 2.6.18 :-(
>
> Was able to build with makefile below. also, remove all occurrences of
> '#include <linux/config.h>', and add '#include <linux/utsrelease.h> to
> the file pci.c
>
> ----------------------------
>
> acx-common-y := wlan.o ioctl.o common.o
> acx-usb-y := usb.o
> acx-pci-y := pci.o
>
> obj-m += acx-common.o acx-pci.o
> obj-m += acx-common.o acx-usb.o
>
> KERNEL:= $(shell uname -r)
> KDIR:= /lib/modules/$(KERNEL)/build
> PWD:= $(shell pwd)
>
> all:
> $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
>
Thanks a lot, and to Ralf too, as I think I've understood a little more
how those "obj-m" lines work now ;-)
Matthias
--
Clean custom Red Hat Linux rpm packages : http://freshrpms.net/
Fedora Core release 5.92 (FC6 Test3) - Linux kernel 2.6.18-1.2726.fc6
Load : 0.29 0.32 0.23
More information about the fedora-devel-list
mailing list