SRCPATH := $(shell pwd)
ARCH = arm
CROSS_COMPILE ?= /opt/toolchain/bin/arm-linux-gnueabihf-
KDIR ?= /home/xxx/linux-3.10/
obj-m += hello_world.o
all:
@echo "build modules ..."
@$(MAKE) -C $(KDIR) M=$(SRCPATH) CROSS_COMPILE=$(CROSS_COMPILE) ARCH=$(ARCH) modules --no-print-directory
clean:
@echo "clean modules ..."
@rm -rf .*.cmd *.o *.mod.c *.ko .tmp_versions Module.symvers .Makefile.swp modules.order
.PHONY: modules clean
标签:modules,CROSS,COMPILE,编译,clean,Linux,ARCH,内核模块 From: https://www.cnblogs.com/riveruns/p/17657218.html