-2

I'm trying to write a basic kernel module for my Raspberry Pi V4 Model B.

I tried to follow the steps at puddleofcode.com and How compile a loadable kernel module without recompiling kernel.

obj-m := pix_mod.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

However, regardless of which version of the Makefile I'm using, I'm always getting this error:

Makefile:4: *** missing separator.  Stop.

I'm not a make user, so I have no idea what this error message means.

The only thing I'm suspecting is that the error is somewhere on line 4.

Marco
  • 121
  • 4

1 Answers1

-1

Turned out make isn't happy with 4 spaces as indentation (duh, I just copied the Makefile from these sites).

Anyway, replacing the 4 spaces with 1 tab fixed the issue.

(I can't post the correct Makefile syntax here, because it will get replaced with spaces)

Marco
  • 121
  • 4