123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- include $(SCRIPT_DIR)/internal_make_funcs.mk
- FEATURE_DATA_TEMPLATE_ENABLED = y
- FEATURE_OTA_SIGNAL_CHANNEL = MQTT
- SETTING_VARS := \
- BUILD_TYPE \
- PLATFORM_CC \
- PLATFORM_AR \
- PLATFORM_OS \
- SWITCH_VARS := \
- FEATURE_MQTT_COMM_ENABLED \
- FEATURE_OTA_COMM_ENABLED \
- FEATURE_AUTH_WITH_NOTLS \
- FEATURE_GATEWAY_ENABLED \
- FEATURE_GATEWAY_DYN_BIND_SUBDEV_ENABLED \
- FEATURE_LOG_UPLOAD_ENABLED \
- FEATURE_DEV_DYN_REG_ENABLED \
- FEATURE_AT_TCP_ENABLED \
- FEATURE_AT_UART_RECV_IRQ \
- FEATURE_AT_OS_USED \
- FEATURE_AT_DEBUG \
- FEATURE_DATA_TEMPLATE_ENABLED \
- FEATURE_EVENT_POST_ENABLED \
- FEATURE_ACTION_ENABLED \
- FEATURE_DEBUG_DEV_INFO_USED \
- FEATURE_SYSTEM_COMM_ENABLED \
- FEATURE_OTA_USE_HTTPS \
- FEATURE_MULTITHREAD_ENABLED \
-
- $(foreach v, \
- $(SETTING_VARS) $(SWITCH_VARS), \
- $(eval export $(v)=$($(v))) \
- )
- $(foreach v, \
- $(SWITCH_VARS), \
- $(if $(filter y,$($(v))), \
- $(eval CFLAGS += -D$(subst FEATURE_,,$(v)))) \
- )
- ifeq (debug,$(strip $(BUILD_TYPE)))
- CFLAGS += -DIOT_DEBUG -g -O2
- endif
- ifneq (linux,$(strip $(PLATFORM_OS)))
- ifeq (y,$(strip $(FEATURE_SDKTESTS_ENABLED)))
- $(error FEATURE_SDKTESTS_ENABLED with gtest framework just supports to be enabled on PLATFORM_OS = linux!)
- endif
- else
- ifeq (y,$(strip $(FEATURE_SDKTESTS_ENABLED)))
- CFLAGS += -DSDKTESTS_ENABLED
- endif
- endif
- ifeq (y,$(strip $(FEATURE_OTA_COMM_ENABLED)))
- ifeq (MQTT,$(strip $(FEATURE_OTA_SIGNAL_CHANNEL)))
- ifneq (y,$(strip $(FEATURE_MQTT_COMM_ENABLED)))
- $(error FEATURE_OTA_SIGNAL_CHANNEL = MQTT requires FEATURE_MQTT_COMM_ENABLED = y!)
- endif
- CFLAGS += -DOTA_MQTT_CHANNEL
- else
- ifeq (COAP,$(strip $(FEATURE_OTA_SIGNAL_CHANNEL)))
- ifneq (y,$(strip $(FEATURE_COAP_COMM_ENABLED)))
- $(error FEATURE_OTA_SIGNAL_CHANNEL = COAP requires FEATURE_COAP_COMM_ENABLED = y!)
- endif
- CFLAGS += -DOTA_COAP_CHANNEL
- else
- $(error FEATURE_OTA_SIGNAL_CHANNEL must be MQTT or COAP!)
- endif # COAP
- endif # MQTT
- endif # OTA Enabled
- ifeq (CERT,$(strip $(FEATURE_AUTH_MODE)))
- ifeq (y,$(strip $(FEATURE_AUTH_WITH_NOTLS)))
- $(error FEATURE_AUTH_MODE = CERT requires FEATURE_AUTH_WITH_NOTLS = n!)
- endif
- CFLAGS += -DAUTH_MODE_CERT
- else
- ifeq (KEY,$(strip $(FEATURE_AUTH_MODE)))
- CFLAGS += -DAUTH_MODE_KEY
- else
- $(error FEATURE_AUTH_MODE must be CERT or KEY!)
- endif
- endif # Auth mode
- ifeq (y,$(strip $(FEATURE_OTA_USE_HTTPS)))
- ifeq (y,$(strip $(FEATURE_AUTH_WITH_NOTLS)))
- $(error FEATURE_OTA_USE_HTTPS = y requires FEATURE_AUTH_WITH_NOTLS = n!)
- endif
- endif
- ifeq (y, $(strip $(FEATURE_SYSTEM_COMM_ENABLED)))
- CFLAGS += -DSYSTEM_COMM
- endif
- ifeq (y, $(strip $(FEATURE_LOG_UPLOAD_ENABLED)))
- CFLAGS += -DLOG_UPLOAD
- endif
- ifeq (y, $(strip $(FEATURE_GATEWAY_ENABLED)))
- CFLAGS += -DMULTITHREAD_ENABLED
- endif
- ifeq (y, $(strip $(FEATURE_AT_OS_USED)))
- CFLAGS += -DAT_OS_USED
- endif
- ifeq (y, $(strip $(FEATURE_AT_DEBUG)))
- CFLAGS += -DFEATURE_AT_DEBUG
- endif
|