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