ifneq ($(KERNELRELEASE),) # after ifneq ,there is a space! or,will get an error
obj-m := hello.o
else
KERNELDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
clean:
rm -rf *.o *.ko *mod.c [mM]odule* .*.cmd *.o.d .tmp_versions
endif
obj-m := hello.o
else
KERNELDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
clean:
rm -rf *.o *.ko *mod.c [mM]odule* .*.cmd *.o.d .tmp_versions
endif