Welcome to the Linux Foundation Forum!

Make error

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.

Comments

  • 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.

Categories

Upcoming Training