#AR = ar
ARCH = arm
CC = /opt/gcc-linaro-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
#DEBFLAGS=-O2
obj-m:=simple.o
KERNELDIR?=/opt/workspace/zz/linux-nand-3.2.0
PWD :=$(shell pwd)
modules:
$(MAKE) -C $(KERNELDIR) M=$(PWD) LDDINC=$(PWD)/../include modules
clean:
ARCH = arm
CC = /opt/gcc-linaro-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
#DEBFLAGS=-O2
obj-m:=simple.o
KERNELDIR?=/opt/workspace/zz/linux-nand-3.2.0
PWD :=$(shell pwd)
modules:
$(MAKE) -C $(KERNELDIR) M=$(PWD) LDDINC=$(PWD)/../include modules
clean:
rm -rf *.o *.ko
例子2
obj-m:=hello.o
KERNELDIR:=/opt/workspace/zz/linux-nand-3.2.0
PWD:=$(shell pwd)
modules:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
modules_install:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
clean:
rm -rf *.o *.ko
~
ifneq ($(KERNELRELEASE),) # call from kernel build system scull-objs := main.o pipe.o access.o obj-m := scull.o else KERNELDIR ?= /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) modules: $(MAKE) -C $(KERNELDIR) M=$(PWD) LDDINC=$(PWD)/../include modules endif |