I'm new to linux driver dev.
I'm writing helloworld driver.
here is the code:
#define MODULE
#define __KERNEL__
#include <module.h>
int init_module()
{
return 0;
}
void cleanup_module()
{
return;
}
and here is makefile:
CC=gcc
MODFLAGS:= -O3 -Wall -DLINUX
module.o: module.c
$(CC) $(MODFLAGS) -c module.c
But when I run make command I have the following: makefile:3: * “commands commence before first target” error
whats wrong?
Remove the leading tabs in the makefile, from every line that isn't a command:
CC=gcc
MODFLAGS:= -O3 -Wall -DLINUX
module.o: module.c
$(CC) $(MODFLAGS) -c module.c
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With