You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.5 KiB

#===============================================================================
# export variables
#===============================================================================
ifeq ($(CFG_SOCT_EXPORT_FLAG),)
ifeq ($(SDK_DIR),)
$(warning "Making bluetooth... SDK_DIR not define,used path!!")
ifneq ($(srctree),)
KERNEL_DIR := $(srctree)
SDK_DIR := $(shell cd $(KERNEL_DIR)/../../.. && /bin/pwd)
else
SDK_DIR := $(shell cd $(CURDIR)/../../../.. && /bin/pwd)
endif
endif
endif
EXTRA_CFLAGS := ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) LINUX_DIR=$(LINUX_DIR)
EXTRA_CFLAGS += ROOTFS_DIR=$(ROOTFS_DIR)
EXTRA_CFLAGS += CFG_SOCT_KERNEL_VERSION=$(CFG_SOCT_KERNEL_VERSION)
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# variable
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
objects :=
ifeq ($(CFG_SOCT_BT_DEVICE_REALTEK),y)
objects += rtkbt/driver
endif
ifeq ($(CFG_SOCT_BT_DEVICE_MEDIATEK),y)
objects += mt76x2u/driver
endif
ifeq ($(CFG_SOCT_BT_DEVICE_MT7961U),y)
objects += mt7961u/bt_driver_7921
endif
ifeq ($(CFG_SOCT_BT_DEVICE_MT7668U),y)
objects += mt7668u/driver
endif
#for linux
ifeq ($(SOCT_CONFIG_SDIO_DETECT),y)
objects += rtkbt/driver
objects += rtkbt/bt_tool/sdio_detect
endif
#for linux end
ifneq ($(objects),)
obj-y += $(addsuffix /,$(objects))
else
$(error "If bluetooth support, you must choose one bluetooth device at least!!")
endif
objects_clean:=$(addsuffix _clean,$(objects))
objects_install:=$(addsuffix _install,$(objects))
objects_uninstall:=$(addsuffix _uninstall,$(objects))
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# rules
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#==================================================================
# all
#==================================================================
.PHONY: all clean install uninstall
all: $(objects)
clean: $(objects_clean)
install: $(objects_install)
uninstall: $(objects_uninstall)
#==================================================================
# modules
#==================================================================
.PHONY: $(objects) $(objects_clean) $(objects_install) $(objects_uninstall)
$(objects):
make $(EXTRA_CFLAGS) -C $@ all
$(objects_clean):
make -C $(patsubst %_clean,%,$@) clean
$(objects_install):
make $(EXTRA_CFLAGS) -C $(patsubst %_install,%,$@) install
$(objects_uninstall):
make -C $(patsubst %_uninstall,%,$@) uninstall