Linux 2.6 module Makefile 模板代码


Linux 2.6 module Makefile 模板代码:
 
# Makefile2.6
ifneq ($(KERNELRELEASE),)
#kbuild syntax. dependency relationshsip of files and target modules are listed here.
#mymodule-objs := file1.o file2.o
#obj-m := mymodule.o
obj-m := chardev_test_waitqueue.o
else
PWD  := $(shell pwd)
KVER ?= $(shell uname -r)
KDIR := /lib/modules/$(KVER)/build
all:
        $(MAKE) -C $(KDIR) M=$(PWD)
clean:
        rm -rf .*.cmd *.o *.mod.c *.ko .tmp_versions
endif

相关内容