嵌入式 x86与arm不同平台上驱动Makefile示例

X86平台:

root@u12d32:/qy_work/work_hi3518a/hi_test/c_hi3518/proc_programme# cat Makefile
ifneq ($(KERNELRELEASE),)
obj-m := proc_pgrm.o
else
KERNELDIR_X86 ?= /usr/src/linux-headers-3.5.0-34-generic
PWD := $(shell pwd)

modules: 
 $(MAKE) -C $(KERNELDIR_X86) M=$(PWD) modules
endif

clean: 
 rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions *.symvers *.order

 

Arm平台:

root@u12d32:/qy_work/work_hi3518a/hi_test/c_hi3518/proc_programme# cat Makefile
ifneq ($(KERNELRELEASE),)
obj-m := proc_pgrm.o
else
KERNELDIR ?= /home/kongjun/mywork/develop_kj/Hi3518_SDK_V1.0.3.0/osdrv/kernel/linux-3.0.y
PWD := $(shell pwd)

modules: 
 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
endif

clean: 
 rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions *.symvers *.order

 

你可能感兴趣的:(嵌入式 x86与arm不同平台上驱动Makefile示例)