Re: Module building oddities with -objs under Kernel 2.6.8.1

Sam Ravnborg
2004-10-02T07:03:22Z

On Sat, Oct 02, 2004 at 01:13:54AM -0400, Andre Bonin wrote:
> Here is the Makefile.

It is preferred to guard the kbuild specific stuff inside
ifeq ($(KERNELRELEASE),)
Normal stuff
else
kbuild stuff
endif

> ----------------------------------------------------
> KDIR := /usr/src/linux
> PWD := $(shell pwd)
>
> obj-m += datasim.o
> datasim-objs := status.o
This is wrong, you cannot use same name for a .o file and the final module.

Name your .c file datasim_core.c or similar and use:
obj-m := datasim.o
datasim-objs := datasim_core.o status.o

Sam