hello.c kernel Makefile

来源:互联网 发布:程序员充电 编辑:程序博客网 时间:2024/06/06 11:35
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 
原创粉丝点击