I've got homework in Operating Systems course, in which I have to write some module. We use Red Hat 8.0 with customed linux kernel 2.4.18.14. I have a makefile for compiling the module, but I fail getting it to work. the module source code is in snake.c and the makefile is:
KERNELDIR = /usr/src/linux-2.4.18-14custom
include $(KERNELDIR)/.config
CFLAGS = -D__KERNEL__ -DMODULE –I$(KERNELDIR)/include -O -Wall
all: snake.o
The files are in directory /home/user/OS4. When I call make command in that directory it write error:
cc: cannot specify -o with -c or -S and multiple compilations
Can You help me with it? And I'll be glad if you'll explain how the modules compiling work. Thanks
make -nto get compiler command lines for each file and try to find invokation which has incorrect options (-owith-c, etc).