Skip to main content

Makefile error: empty variable name

I am writing a simple Hello World kernel module. The Makefile I wrote is giving me such an error:

esp@ubuntu:~/task1-2$ make all

make -C /usr/src/linux-headers-3.13.0-35-generic SUBDIRS = /home/esp/task1-2 modules
make: ****** empty variable name.  Stop.
make: ** [all] Error 2

How do I rectify it?

My Makefile:

obj-m += task1-2.o

KDIR = /usr/src/linux-headers-3.13.0-35-generic


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

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