|
| 1 | +export KERNEL_SRC := /lib/modules/$(shell uname -r)/build |
| 2 | +#################### Configurations #################### |
| 3 | +# Compile Options for bt driver configuration. |
| 4 | +CONFIG_SUPPORT_BT_DL_WIFI_PATCH=y |
| 5 | +CONFIG_SUPPORT_BLUEZ=n |
| 6 | +CONFIG_SUPPORT_DVT=n |
| 7 | +CONFIG_SUPPORT_MULTI_DEV_NODE=n |
| 8 | + |
| 9 | +ifeq ($(CONFIG_SUPPORT_BT_DL_WIFI_PATCH), y) |
| 10 | + ccflags-y += -DCFG_SUPPORT_BT_DL_WIFI_PATCH=1 |
| 11 | +else |
| 12 | + ccflags-y += -DCFG_SUPPORT_BT_DL_WIFI_PATCH=0 |
| 13 | +endif |
| 14 | + |
| 15 | +ifeq ($(CONFIG_SUPPORT_BLUEZ), y) |
| 16 | + ccflags-y += -DCFG_SUPPORT_BLUEZ=1 |
| 17 | + ccflags-y += -DCFG_SUPPORT_HW_DVT=0 |
| 18 | +else |
| 19 | + ccflags-y += -DCFG_SUPPORT_BLUEZ=0 |
| 20 | + ccflags-y += -DCFG_SUPPORT_HW_DVT=1 |
| 21 | +endif |
| 22 | + |
| 23 | +ifeq ($(CONFIG_SUPPORT_DVT), y) |
| 24 | + ccflags-y += -DCFG_SUPPORT_DVT=1 |
| 25 | +else |
| 26 | + ccflags-y += -DCFG_SUPPORT_DVT=0 |
| 27 | +endif |
| 28 | + |
| 29 | +ifeq ($(CONFIG_SUPPORT_DVT), y) |
| 30 | + ccflags-y += -DCFG_SUPPORT_DVT=1 |
| 31 | +else |
| 32 | + ccflags-y += -DCFG_SUPPORT_DVT=0 |
| 33 | +endif |
| 34 | + |
| 35 | +ifeq ($(CONFIG_SUPPORT_MULTI_DEV_NODE), y) |
| 36 | + ccflags-y += -DCFG_SUPPORT_MULTI_DEV_NODE=1 |
| 37 | +else |
| 38 | + ccflags-y += -DCFG_SUPPORT_MULTI_DEV_NODE=0 |
| 39 | +endif |
| 40 | + |
| 41 | +#################### Configurations #################### |
| 42 | +# For chip interface, driver supports "usb", "sdio", "uart" and "btif" |
| 43 | +MTK_CHIP_IF := usb |
| 44 | + |
| 45 | +ifeq ($(MTK_CHIP_IF), sdio) |
| 46 | + MOD_NAME = btmtk_sdio_unify |
| 47 | + CFILES := sdio/btmtksdio.c btmtk_woble.c btmtk_buffer_mode.c btmtk_chip_reset.c |
| 48 | + ccflags-y += -DCHIP_IF_SDIO |
| 49 | + ccflags-y += -DSDIO_DEBUG=0 |
| 50 | + ccflags-y += -I$(src)/include/sdio |
| 51 | +else ifeq ($(MTK_CHIP_IF), usb) |
| 52 | + MOD_NAME = btmtk_usb_unify |
| 53 | + CFILES := usb/btmtkusb.c btmtk_woble.c btmtk_chip_reset.c |
| 54 | + ccflags-y += -DCHIP_IF_USB |
| 55 | + ccflags-y += -I$(src)/include/usb |
| 56 | +else ifeq ($(MTK_CHIP_IF), uart) |
| 57 | + MOD_NAME = btmtk_uart_unify |
| 58 | + CFILES := uart/btmtk_uart_main.c |
| 59 | + ccflags-y += -DCHIP_IF_UART |
| 60 | + ccflags-y += -I$(src)/include/uart |
| 61 | +else |
| 62 | + MOD_NAME = btmtkbtif_unify |
| 63 | + CFILES := btif/btmtk_btif.c |
| 64 | + ccflags-y += -DCHIP_IF_BTIF |
| 65 | + ccflags-y += -I$(src)/include/btif |
| 66 | +endif |
| 67 | + |
| 68 | +CFILES += btmtk_main.c btmtk_fw_log.c |
| 69 | + |
| 70 | +ccflags-y += -I$(src)/include/ -I$(src)/ |
| 71 | + |
| 72 | +$(MOD_NAME)-objs := $(CFILES:.c=.o) |
| 73 | + |
| 74 | +obj-m += $(MOD_NAME).o |
| 75 | + |
| 76 | + |
| 77 | +#VPATH = /opt/toolchains/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux |
| 78 | +#UART_MOD_NAME = btmtk_uart |
| 79 | +#UART_CFILES := \ |
| 80 | +# btmtk_uart_main.c |
| 81 | +#$(UART_MOD_NAME)-objs := $(UART_CFILES:.c=.o) |
| 82 | +############################################################################### |
| 83 | +# Common |
| 84 | +############################################################################### |
| 85 | +#obj-m := $(UART_MOD_NAME).o |
| 86 | +all: |
| 87 | + make -C $(KERNEL_SRC) M=$(PWD) modules |
| 88 | +clean: |
| 89 | + make -C $(KERNEL_SRC) M=$(PWD) clean |
| 90 | +# Check coding style |
| 91 | +# export IGNORE_CODING_STYLE_RULES := NEW_TYPEDEFS,LEADING_SPACE,CODE_INDENT,SUSPECT_CODE_INDENT |
| 92 | +ccs: |
| 93 | + ./util/checkpatch.pl -f ./sdio/btmtksdio.c |
| 94 | + ./util/checkpatch.pl -f ./include/sdio/btmtk_sdio.h |
| 95 | + ./util/checkpatch.pl -f ./include/btmtk_define.h |
| 96 | + ./util/checkpatch.pl -f ./include/btmtk_drv.h |
| 97 | + ./util/checkpatch.pl -f ./include/btmtk_chip_if.h |
| 98 | + ./util/checkpatch.pl -f ./include/btmtk_main.h |
| 99 | + ./util/checkpatch.pl -f ./include/btmtk_buffer_mode.h |
| 100 | + ./util/checkpatch.pl -f ./include/btmtk_fw_log.h |
| 101 | + ./util/checkpatch.pl -f ./include/btmtk_woble.h |
| 102 | + ./util/checkpatch.pl -f ./include/uart/btmtk_uart.h |
| 103 | + ./util/checkpatch.pl -f ./uart/btmtk_uart_main.c |
| 104 | + ./util/checkpatch.pl -f ./include/usb/btmtk_usb.h |
| 105 | + ./util/checkpatch.pl -f ./usb/btmtkusb.c |
| 106 | + ./util/checkpatch.pl -f btmtk_fw_log.c |
| 107 | + ./util/checkpatch.pl -f btmtk_main.c |
| 108 | + ./util/checkpatch.pl -f btmtk_buffer_mode.c |
| 109 | + ./util/checkpatch.pl -f btmtk_woble.c |
| 110 | + ./util/checkpatch.pl -f btmtk_chip_reset.c |
| 111 | + |
0 commit comments