make is giving this error "command commence before target"
here is my make file
ifneq($(KERNELRELEASE),)
CC=gcc
MODCFLAGS := -Wall -DMODULE -D__KERNEL__ -DLINUX
obj-m := hello.o
$(CC) $(MODCFLAGS) -c hello.c
else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
endif
here iam trying to build kernel module hello.c which displays hello world frm kernel space.
can any body help me plz...
thanx in advance
hello..
my dog ate my keyboard
plz help
:)
Bad Makefile
I am not very familiar with makefiles but I can tell you what is causing the error. The following Makefile runs ok on my system.
Note the space after "ifneq". If you are not already doing so, reference http://lwn.net/images/pdf/LDD3/ch02.pdf