MBEDTLS_OBJ_PREFIX = $(OUTDIR)/obj/mbedtls_

MBEDTLS_CONFIG_FILE:

SRC += $(IP_SRC)/common/ilib-cpp/mbedtls/mbedtls_config.cpp MBEDTLS_CONFIG_FILE
LIBOBJS += $(MBEDTLS_OBJ_PREFIX)config.$(OBJ_EXT)
$(MBEDTLS_OBJ_PREFIX)config.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/mbedtls/mbedtls_config.cpp
	$(cc) $(cflags_mbedtls) $< -o $@

SRC += $(IP_SRC)/common/ilib-cpp/mbedtls/mbedtls_ecc.cpp MBEDTLS_CONFIG_FILE
LIBOBJS += $(MBEDTLS_OBJ_PREFIX)ecc.$(OBJ_EXT)
$(MBEDTLS_OBJ_PREFIX)ecc.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/mbedtls/mbedtls_ecc.cpp
	$(cc) $(cflags_mbedtls) $< -o $@

SRC += $(IP_SRC)/common/ilib-cpp/mbedtls/library/aes.c
LIBOBJS += $(MBEDTLS_OBJ_PREFIX)aes.$(OBJ_EXT)
$(MBEDTLS_OBJ_PREFIX)aes.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/mbedtls/library/aes.c MBEDTLS_CONFIG_FILE
	$(cc) $(flags_mbedtls) $< -o $@

SRC += $(IP_SRC)/common/ilib-cpp/mbedtls/library/bignum.c
LIBOBJS += $(MBEDTLS_OBJ_PREFIX)bignum.$(OBJ_EXT)
$(MBEDTLS_OBJ_PREFIX)bignum.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/mbedtls/library/bignum.c MBEDTLS_CONFIG_FILE
	$(cc) $(flags_mbedtls) $< -o $@

SRC += $(IP_SRC)/common/ilib-cpp/mbedtls/library/bignum_core.c
LIBOBJS += $(MBEDTLS_OBJ_PREFIX)bignum_core.$(OBJ_EXT)
$(MBEDTLS_OBJ_PREFIX)bignum_core.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/mbedtls/library/bignum_core.c MBEDTLS_CONFIG_FILE
	$(cc) $(flags_mbedtls) $< -o $@

SRC += $(IP_SRC)/common/ilib-cpp/mbedtls/library/constant_time.c
LIBOBJS += $(MBEDTLS_OBJ_PREFIX)constant_time.$(OBJ_EXT)
$(MBEDTLS_OBJ_PREFIX)constant_time.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/mbedtls/library/constant_time.c MBEDTLS_CONFIG_FILE
	$(cc) $(flags_mbedtls) $< -o $@

SRC += $(IP_SRC)/common/ilib-cpp/mbedtls/library/ctr_drbg.c
LIBOBJS += $(MBEDTLS_OBJ_PREFIX)ctr_drbg.$(OBJ_EXT)
$(MBEDTLS_OBJ_PREFIX)ctr_drbg.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/mbedtls/library/ctr_drbg.c MBEDTLS_CONFIG_FILE
	$(cc) $(flags_mbedtls) $< -o $@

SRC += $(IP_SRC)/common/ilib-cpp/mbedtls/library/ecp.c
LIBOBJS += $(MBEDTLS_OBJ_PREFIX)ecp.$(OBJ_EXT)
$(MBEDTLS_OBJ_PREFIX)ecp.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/mbedtls/library/ecp.c MBEDTLS_CONFIG_FILE
	$(cc) $(flags_mbedtls) $< -o $@

SRC += $(IP_SRC)/common/ilib-cpp/mbedtls/library/ecp_curves.c
LIBOBJS += $(MBEDTLS_OBJ_PREFIX)ecp_curves.$(OBJ_EXT)
$(MBEDTLS_OBJ_PREFIX)ecp_curves.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/mbedtls/library/ecp_curves.c MBEDTLS_CONFIG_FILE
	$(cc) $(flags_mbedtls) $< -o $@

SRC += $(IP_SRC)/common/ilib-cpp/mbedtls/library/platform_util.c
LIBOBJS += $(MBEDTLS_OBJ_PREFIX)platform_util.$(OBJ_EXT)
$(MBEDTLS_OBJ_PREFIX)platform_util.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/mbedtls/library/platform_util.c MBEDTLS_CONFIG_FILE
	$(cc) $(flags_mbedtls) $< -o $@
