- 论坛徽章:
- 0
|
This makefile is modified from the makefile in LDDv3.
# If KERNELRELEASE is defined, we've been invoked from the
# kernel build system and can use its language.
#
ifeq ($(KERNELRELEASE),)
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
VPATH += $(PWD)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
clean:
$(MAKE) -C $(KERNELDIR) M=$(PWD) clean
@-rm *.symvers
endif
An example to use it,
obj-m := chardev.o
chardev-objs := main.o subr.o
include lkm.mk
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/10543/showart_269496.html |
|