生成arm架构
ARCH?=arm
NAME?=demo
ifeq ($(ARCH),arm)
KERNEDIR=/home/ubuntu/linux-5.10.61
endif
KERNEDIR?=/lib/modules/$(shell uname -r)/build
PWD:=$(shell pwd)
all:
make -C $(KERNEDIR) M=$(PWD) modules
clean:
make -C $(KERNEDIR) M=$(PWD) clean
obj-m:=$(NAME).o
生成x86架构
ARCH?=arm
NAME?=demo
ifeq ($(ARCH),arm)
KERNEDIR=/home/ubuntu/linux-5.10.61
endif
KERNEDIR?=/lib/modules/$(shell uname -r)/build
PWD:=$(shell pwd)
all:
make -C $(KERNEDIR) M=$(PWD) modules
clean:
make -C $(KERNEDIR) M=$(PWD) clean
obj-m:=$(NAME).o