Problem with module spanning from multiple files

Philipp Ittershagen p.ittershagen at googlemail.com
Wed Jul 18 05:27:50 EDT 2012


On Wed, Jul 18, 2012 at 10:40 AM, aleksey <lexa at cfotr.com> wrote:
> obj-m = test.o
> test-objs = test_sub.o
> all:
>                 $(MAKE) -C $(KDIR) M=$(shell pwd) modules
>
>
> But the problem is stay. i don't receive any message on module load.

Apparently, the problem is the name of your obj-m target and the name
of the other object which should be build. This worked for me:


obj-m += mytest.o

mytest-objs += test.o test_sub.o


Your kernel module will then be called mytest.ko and consists of
test.o and test_sub.o

Greetings,

  Philipp



More information about the Kernelnewbies mailing list