Linux.com

Make error

Link to this post 09 Sep 09

Hi,

I got an error "No rule to make target " while running the make. Please see the make output below.

Room:/home/room/Desktop/net # make
make -C /lib/modules/2.6.16.21-0.8-smp/build SUBDIRS=/home/room/Desktop/net modules
make[1]: Entering directory `/usr/src/linux-2.6.16.21-0.8-obj/i386/smp'
make[1]: *** No rule to make target `modules'. Stop.
make[1]: Leaving directory `/usr/src/linux-2.6.16.21-0.8-obj/i386/smp'
make: *** [all] Error 2
Room:/home/room/Desktop/net #


The Makefile having the below lines.

obj-m :=lin_net_device.o
obj-m +=lin_net1.o
obj-m +=lin_net2.o

KDIR= /lib/modules/$(shell uname -r)/build

all:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
rm -rf *.o *.mod.* .c* .t*
clear:
rm -rf *.o *.mod.* .c* .t* *.ko

Can you please help me on this.

Link to this post 20 Sep 09

Looks like the line
>all:
>$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
is being interpreted out so $PWD modules is not coming out the way you want. Change it to

$(MAKE) -C $(KDIR) SUBDIRS=$(PWD)/modules (ie get rid of the space, and replace it with a /) and you should be OK.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board