A message for Linux.com registered users: We are in the process of making changes to the Linux forums. Starting Monday, 8/13/18 at 6:00 PM PT, you will be unable to access the forums. They will re-launch as soon as possible on Wednesday, 8/15/18 with new features and improved functionality. Thank you for your patience and stay tuned for the new improved forums.

September 9, 2009

Make error


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/ SUBDIRS=/home/room/Desktop/net modules
make[1]: Entering directory `/usr/src/linux-'
make[1]: *** No rule to make target `modules'. Stop.
make[1]: Leaving directory `/usr/src/linux-'
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

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

Can you please help me on this.

Click Here!