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.
Makefile:4: *** missing separator. Stop.
. The issue was that the indentation was wrong (spaces instead of tabs). – Marco Oct 15 '22 at 20:26make
could answer my question. – Marco Oct 15 '22 at 20:27I'm trying to get a kernel module working for the raspberry pi
... no ... you are trying to compile a kernel module for Linux – jsotola Oct 15 '22 at 20:53I'm not going to ''make'' research on an error message [...]
– Marco Oct 15 '22 at 20:53Makefile
files. Also, you never know what kind of crooked version of a tool you might have installed on your system. I don't trust the software installed on my pi, not to the level I would on a "normal" machine ; let me give you an example (even though this is totally out of scope): if you login into your raspi for the first time, you have to wait a couple seconds before it even accepts the valid default credentials. – Marco Oct 15 '22 at 22:40Makefile:4: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.
this is a much more useful error message, and it would have stopped me from asking that question here - butmake
decided to bail out with a cryptic error message instead.. – Marco Oct 15 '22 at 22:42