Muthu Kumar wrote:
I've test module that spans two files. sillymod.c and sillymod_test.c.
I use the following Makefile to compile the module under 2.6 kernel.
---------------------------------------------------
ifeq ($(KSRC),)
KSRC=/lib/modules/2.6.5-1.358custom/build
endif
obj-m := sillymod.o
sillymod-objs := sillymod_test.o
To start with add sillymod.o the line above like:
sillymod-objs := sillymod_test.o sillymod.o
build:
make -C $(KSRC) SUBDIRS=`pwd` modules
install:
@# completely broken ATM - removes the whole dir
@#make -C $(KSRC) SUBDIRS=`pwd` modules_install
@echo "Install it yourself ..."
clean:
@# kbuild can't handle this (yet ?)
@#make -C $(KSRC) SUBDIRS=`pwd` clean
rm -f *.o *.ko *.mod.o *.mod.c .*.{cmd,flags}
rm -rf config.status config.log autom4te*.cache
----------------------------------
When I insmod sillymod.ko, I get "module license 'unspecified' taints kernel
error. And, printk didnt work.
If I comment out sillymod-objs line from the Makefile, then I don't get the
above error and printk works!
The MODULE_LICENSE macro is in sillymod.c.
Whats up with this Makefile?
Thanks
/kmk
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/
--
kr
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/