模块编译Makefile模板

PWD := $(shell pwd)
MOD_DIR ?= /lib/modules/`uname -r`/build

obj-m += hello.o 

modules:
    make -C $(MOD_DIR) M=$(PWD) modules

modules_install:
    make -C $(MOD_DIR) M=$(PWD) modules_install

clean:
    rm -rf *.o *.ko *.cmd *.mod.* Module.symvers modules.order

.PHONY: modules modules_install clean

 

posted @ 2015-01-04 19:55  brep  阅读(169)  评论(0编辑  收藏  举报