AvinashK
AvinashK

Reputation: 3423

makefile not working

I am learning Linux module programming. I work on Ubuntu 12.04. I made a module, namely start.c, and saved it in home/documents/module_prog.

Then I made the following makefile (I am not acquainted with makefiles so I just did what the tutorial told me to):

obj-m += start.o

KDIR = /usr/src/linux-headers-3.2.0-31-generic-pae

all:
    make -C $(KDIR) SUBDIRS=$(PWD) modules

clean:
    rm -rf *.o *.ko *.mod.* *.symvers *.order

But, now when I type make in the terminal, a message is displayed which says

  make: Nothing to be done for `all'.

Please tell me what is wrong?

Upvotes: 0

Views: 7235

Answers (1)

dseifert
dseifert

Reputation: 1348

Make sure that the commands for a make target are intended with a tab, not spaces. I.e.

all:
<tab>make -C $(KDIR) SUBDIRS=$(PWD) modules

Otherwise the all target will be empty, and thus nothing is to be done.

Upvotes: 3

Related Questions