ERROR **No rule to make target `modules` Stop

I am trying to make my kernel space program (I am using suse linux 11.0)

Here is my Makefile

obj -m:= new.o

default:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=pwd modules

I am getting following Error

make[1]: Entering directory /usr/src/linux-2.6.25.5-1.1-obj/x86_64/default' make[1]: *** No rule to make target modules’. Stop.
make[1]: Leaving directory `/usr/src/linux-2.6.25.5-1.1-obj/x86_64/default’
make: *** [default] Error 2

please help me out.

Your path is wrong. It is not /lib/modules/$(shell uname -r)/build. In my system, what my wrote down is /usr/src/linux-obj/i586/debug. It works. Of course, you should make sure the kernel source and kernel objs are installed.

My Makefile is as fellow: (openSUSE 11.1)

Makefile

obj-m := new.o

all:
make -C /usr/src/linux-obj/i586/debug M=pwd modules

clean:
make -C /usr/src/linux-obj/i586/debug M=pwd clean

I think it should work for you.

Makefile

obj-m := new.o

all:
<------->make -C /usr/src/linux-obj/i586/debug M=pwd modules

clean:
<------->make -C /usr/src/linux-obj/i586/debug M=pwd clean

Give tab space before the make command and Check your path where you kept source tree.

On 2012-07-07 18:46, manickaraj wrote:

> Give tab space before the make command and Check your path where you
> kept source tree.

Please notice that this is a thread abandoned in 2009.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)