################################################################################
# General project settings                                                     #
################################################################################

PROJECTNAME = bt_aoa_host_locator
PROJ_DIR := $(realpath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
SDK_DIR := $(realpath $(PROJ_DIR)/../../../..)

# The MQTT component depends on Mosquitto that has to be installed to the
# development environment. By enabling this experimental option, this dependency
# can be eliminated. The mock component has a very limited functionality
# compared to the original one and serves testing purposes only.
MQTT_MOCK ?= 0

# The MQTT_COMPONENT variable is derived automatically based on the MQTT_MOCK.
# Do not edit manually.
MQTT_COMPONENT = 1
ifeq (, $(filter $(MAKECMDGOALS), export))
  ifneq ($(MQTT_MOCK), 0)
    MQTT_COMPONENT = 0
  endif
else
  MQTT_MOCK = 1
endif


################################################################################
# Components                                                                   #
#                                                                              #
# After setting up the toolchain, components can contribute to the project by  #
# appending items to the project variables like INCLUDEPATHS or C_SRC.         #
################################################################################

include $(SDK_DIR)/app/bluetooth/component_host/toolchain.mk
include $(SDK_DIR)/app/bluetooth/component_host/app_log.mk
include $(SDK_DIR)/app/bluetooth/component_host/app_assert.mk
include $(SDK_DIR)/app/bluetooth/component_host/app_signal.mk
include $(SDK_DIR)/app/bluetooth/component_host/cjson.mk
include $(SDK_DIR)/app/bluetooth/component_host/ncp_host_bt.mk
include $(SDK_DIR)/app/bluetooth/component_host/aoa_cte.mk
include $(SDK_DIR)/app/bluetooth/component_host/aoa_angle.mk
include $(SDK_DIR)/app/bluetooth/component_host/rtl_lib.mk
include $(SDK_DIR)/app/bluetooth/component_host/antenna_array.mk
include ${SDK_DIR}/app/bluetooth/component_host/app_timer.mk
include ${SDK_DIR}/app/bluetooth/component_host/ncp_version.mk
ifneq ($(MQTT_COMPONENT), 0)
  include $(SDK_DIR)/app/bluetooth/component_host/mqtt.mk
endif
ifneq ($(MQTT_MOCK), 0)
  include $(SDK_DIR)/app/bluetooth/component_host/mqtt_mock.mk
endif


################################################################################
# Include paths                                                                #
################################################################################

override INCLUDEPATHS += $(PROJ_DIR) \
$(SDK_DIR)/app/bluetooth/common_host/aoa_parse \
$(SDK_DIR)/app/bluetooth/common_host/aoa_util \
$(SDK_DIR)/app/bluetooth/common_host/aoa_db \
$(SDK_DIR)/app/bluetooth/common_host/system \
$(SDK_DIR)/app/bluetooth/common/ncp_user_cmd \
$(SDK_DIR)/platform/common/inc \
$(SDK_DIR)/protocol/bluetooth/inc \
$(SDK_DIR)/protocol/bluetooth/config


################################################################################
# Input files                                                                  #
################################################################################

override C_SRC += \
$(SDK_DIR)/app/bluetooth/common_host/aoa_parse/aoa_parse.c \
$(SDK_DIR)/app/bluetooth/common_host/aoa_parse/aoa_parse_cte.c \
$(SDK_DIR)/app/bluetooth/common_host/aoa_parse/aoa_parse_enum.c \
$(SDK_DIR)/app/bluetooth/common_host/aoa_util/aoa_serdes.c \
$(SDK_DIR)/app/bluetooth/common_host/aoa_util/aoa_util.c \
$(SDK_DIR)/app/bluetooth/common_host/aoa_db/aoa_db.c \
$(SDK_DIR)/app/bluetooth/common_host/system/system.c \
$(PROJ_DIR)/app.c \
$(PROJ_DIR)/main.c

PROJ_FILES += $(wildcard $(PROJ_DIR)/config/*)


################################################################################
# Target rules                                                                 #
################################################################################

include $(SDK_DIR)/app/bluetooth/component_host/targets.mk
