LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Makefile problems/Simple kernel module (https://www.linuxquestions.org/questions/linux-kernel-70/makefile-problems-simple-kernel-module-496432/)

smoothdogg00 10-28-2006 03:18 PM

Makefile problems/Simple kernel module
 
I am creating a simple hello/goodbye kernel module and I am having problems with the Makefile. The Makefile is as follows:
Code:

ifneq ($(KERNELRELEASE),)
obj-m        := message.o

else
KDIR        := /lib/modules/2.6.17-10-generic
PWD        := $(shell pwd)

default:
        $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
endif

The error I am getting is:
Code:

bill@bill-i9400:~/message$ make
make -C /lib/modules/2.6.17-10-generic SUBDIRS=/home/bill/message modules
make[1]: Entering directory `/lib/modules/2.6.17-10-generic'
make[1]: *** No rule to make target `modules'.  Stop.
make[1]: Leaving directory `/lib/modules/2.6.17-10-generic'

I read somewhere that it may have something to do with not having a Makefile in the "2.6.17-10-generic" directory, but I am totally lost. Can anyone offer me a solution?

Thanks.

smoothdogg00 10-28-2006 04:16 PM

Solved! The problem was, my directory should have been '/lib/modules/2.6.17-10-generic/build' as opposed to '/lib/modules/2.6.17-10-generic'


All times are GMT -5. The time now is 06:52 AM.