iotstack-device-sdk-c/Makefile

86 lines
1.8 KiB
Makefile
Raw Normal View History

2021-01-22 16:31:40 +08:00
include make.settings
include tools/scripts/default_settings.mk
include tools/scripts/parse_make_settings.mk
# IoT SDK sources files defination
COMP_LIB := libiot_sdk.a
COMP_LIB_COMPONENTS := \
src/utils \
src/certs \
src/sdk-impl \
$(call CompLib_Map, MQTT_COMM_ENABLED, src/mqtt/src)
2021-05-17 13:20:56 +08:00
$(call CompLib_Map, OTA_ENABLED, src/ota/src)
2021-01-22 16:31:40 +08:00
$(call CompLib_Map, SUPPORT_AT_CMD, src/at/src src/at/class/$(PLATFORM_MODULE) platform/module)
IOTSDK_SRC_FILES := \
$(foreach v, \
$(COMP_LIB_COMPONENTS), \
$(eval \
export IOTSDK_SRC_FILES += \
$(wildcard $(TOP_DIR)/$(v)/*.c) \
) \
)
# IoT Platform sources files defination
PLATFORM_LIB := libiot_platform.a
PLATFORM_LIB_COMPONENTS := \
platform/os/$(PLATFORM_OS) \
ifneq (,$(filter -DSUPPORT_TLS,$(CFLAGS)))
PLATFORM_LIB_COMPONENTS += \
platform/ssl/$(PLATFORM_SSL)
endif
IOTPLATFORM_SRC_FILES := \
$(foreach v, \
$(PLATFORM_LIB_COMPONENTS), \
$(eval \
export IOTPLATFORM_SRC_FILES += \
$(wildcard $(TOP_DIR)/$(v)/*.c) \
) \
)
# IoT Include files defination
COMP_LIB_COMPONENTS_INCLUDES := \
src/utils \
src/certs \
src/sdk-impl \
platform/os/$(PLATFORM_OS)
$(call CompInc_Map, MQTT_COMM_ENABLED, \
src/mqtt/include \
)
2021-05-17 13:20:56 +08:00
$(call CompInc_Map, OTA_ENABLED, \
src/ota/include \
)
2021-01-22 16:31:40 +08:00
$(call CompInc_Map, SUPPORT_TLS, \
external_libs/mbedtls/include \
)
$(call CompInc_Map, SUPPORT_AT_CMD, \
src/at/include \
)
IOTSDK_INCLUDE_FILES := \
$(foreach v, \
$(COMP_LIB_COMPONENTS_INCLUDES), \
$(eval \
export IOTSDK_INCLUDE_FILES += \
-I$(TOP_DIR)/$(v) \
) \
)
CFLAGS += -Werror -Wall -Wno-error=sign-compare -Wno-error=format -Os ${IOTSDK_INCLUDE_FILES} -pthread
include tools/scripts/rules.mk
include samples/samples.mk
ifneq (,$(filter -DSDK_TESTS_ENABLED, $(CFLAGS)))
include tests/unit_test/unit_test.mk
endif