blob: 60759b21885f1648e83a4ebceb9589c0de69db6e [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001export KERNEL_SRC := /lib/modules/$(shell uname -r)/build
2
3$(warning $(CC))
4
5###############################################################################
6# stp_cdev_bt
7###############################################################################
8
9ifneq ($(findstring $(PLATFORM), MT8133_YOCTO MT8512_YOCTO mt6771),)
10 MODULE_NAME = wmt_cdev_bt
11else
12 MODULE_NAME = bt_drv
13endif
14
15$(MODULE_NAME)-objs := stp_chrdev_bt.o
16ifneq ($(CONFIG_MTK_CONNSYS_DEDICATED_LOG_PATH),)
17$(MODULE_NAME)-objs += fw_log_bt.o
18endif
19###############################################################################
20# Common
21###############################################################################
22EXTRA_SYMBOLS = ${TOPDIR}/tmp/work/${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}/mt66xx-wmt-drv/1.0-r0/mt66xx-wmt-drv-1.0/Module.symvers
23
24ccflags-y += -fno-pic
25ccflags-y += -D MTK_WCN_WMT_STP_EXP_SYMBOL_ABSTRACT
26ccflags-y += -D CREATE_NODE_DYNAMIC=1
27ccflags-y += -D CFG_MTK_ANDROID_WMT=1
28ccflags-y += \
29 -I$(CONNECTIVITY_SRC)/wmt_mt66xx/common_main/include \
30 -I$(CONNECTIVITY_SRC)/wmt_mt66xx/common_main/linux/include \
31 -I$(CONNECTIVITY_SRC)/../../linux/${KERNEL_VER}/drivers/misc/mediatek/include/mt-plat
32ifneq ($(CONFIG_MTK_CONNSYS_DEDICATED_LOG_PATH),)
33ccflags-y += -I$(CONNECTIVITY_SRC)/wmt_mt66xx/debug_utility
34endif
35
36WMT_SRC_FOLDER := $(TOP)/vendor/mediatek/kernel_modules/connectivity/common
37
38ccflags-y += \
39 -I$(WMT_SRC_FOLDER)/common_main/include \
40 -I$(WMT_SRC_FOLDER)/common_main/linux/include \
41 -I$(srctree)/drivers/misc/mediatek/include/mt-plat
42
43obj-m := $(MODULE_NAME).o
44
45ifeq ($(CONFIG_MTK_CONN_LTE_IDC_SUPPORT),y)
46 ccflags-y += -D WMT_IDC_SUPPORT=1
47else
48 ccflags-y += -D WMT_IDC_SUPPORT=0
49endif
50
51all:
52 make -C $(LINUX_SRC) M=$(PWD) modules
53
54bt_drv:
55ifneq ($(findstring $(PLATFORM), MT8133_YOCTO MT8512_YOCTO MT2712_YOCTO 2731_YOCTO mt6771),)
56 make -C $(LINUX_SRC) M=$(PWD) modules
57else
58 make -C $(LINUX_SRC) M=$(PWD) $(MODULE_NAME).ko
59endif
60
61clean:
62 make -C $(LINUX_SRC) M=$(PWD) clean
63