0
obj-m += task.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

Makefile:3: *** missing separator. Stop.

1 Answers1

2

Check that you have the real tab character in front of the entry, e.g.

all:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

It has to be \t, the Tab character, not merely spaces.

To verify, you can run cat -T Makefile:

$ cat -T Makefile 
all:
^Iecho "foo"
foo:
^Iecho "bar"

^I indicates a tab character. Verify that all lines succeeding a target is tab-indented.

vidarlo
  • 22,691