编译wifi模块时,改用多个*.c、*.h进行编译成单个.ko文件。
Makefile 文件如下:
#!/bin/bash
obj-m += mtk_hif_sdio.o
ccflags-y += -I$(src)/linux/include -I$(src)/core/include -I$(src)/include
KDIR := /home/kernel/iTop4412_Kernel_3.0_linux
mtk_hif_sdio-objs := linux/hif_sdio.o
mtk_hif_sdio-objs += linux/hif_sdio_chrdev.o
mtk_hif_sdio-objs += linux/osal.o
PWD ?= $(shell pwd)
all:
make -C $(KDIR) M=$(PWD) $(CFLAGS) modules
对应解释
obj-m += mtk_hif_sdio.o //需要编译模块名称
ccflags-y += -I$(src)/linux/include -I$(src)/core/include -I$(src)/include //需要添加对应的多个*.h文件
mtk_hif_sdio-objs := linux/hif_sdio.o //对应需要的多个*.c 文件
mtk_hif_sdio-objs += linux/hif_sdio_chrdev.o
mtk_hif_sdio-objs += linux/osal.o