include $(IP_SRC)/common/ilib-cpp/mbedtls/mbedtls.mak

SRC += $(IP_SRC)/common/ilib-cpp/asn1.cpp
LIBOBJS += $(OUTDIR)/obj/asn1.$(OBJ_EXT)
$(OUTDIR)/obj/asn1.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/asn1.cpp

SRC += $(IP_SRC)/common/ilib-cpp/asn1_ber.cpp
LIBOBJS += $(OUTDIR)/obj/asn1_ber.$(OBJ_EXT)
$(OUTDIR)/obj/asn1_ber.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/asn1_ber.cpp

SRC += $(IP_SRC)/common/ilib-cpp/asn1_per.cpp
LIBOBJS += $(OUTDIR)/obj/asn1_per.$(OBJ_EXT)
$(OUTDIR)/obj/asn1_per.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/asn1_per.cpp
#	$(analyzer)

SRC += $(IP_SRC)/common/ilib-cpp/base64.cpp
LIBOBJS += $(OUTDIR)/obj/base64.$(OBJ_EXT)
$(OUTDIR)/obj/base64.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/base64.cpp

SRC += $(IP_SRC)/common/ilib-cpp/btree.cpp
LIBOBJS += $(OUTDIR)/obj/btree.$(OBJ_EXT)
$(OUTDIR)/obj/btree.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/btree.cpp

SRC += $(IP_SRC)/common/ilib-cpp/ipaddr.cpp
LIBOBJS += $(OUTDIR)/obj/ipaddr.$(OBJ_EXT)
$(OUTDIR)/obj/ipaddr.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/ipaddr.cpp

SRC += $(IP_SRC)/common/ilib-cpp/json.cpp
LIBOBJS += $(OUTDIR)/obj/json.$(OBJ_EXT)
$(OUTDIR)/obj/json.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/json.cpp

SRC += $(IP_SRC)/common/ilib-cpp/str.cpp
LIBOBJS += $(OUTDIR)/obj/str.$(OBJ_EXT)
$(OUTDIR)/obj/str.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/str.cpp

SRC += $(IP_SRC)/common/ilib-cpp/xml.cpp
LIBOBJS += $(OUTDIR)/obj/xml.$(OBJ_EXT)
$(OUTDIR)/obj/xml.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/xml.cpp

SRC += $(IP_SRC)/common/ilib-cpp/uri.cpp
LIBOBJS += $(OUTDIR)/obj/uri.$(OBJ_EXT)
$(OUTDIR)/obj/uri.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/uri.cpp

ifdef __ANDROID__
else
SRC += $(IP_SRC)/common/ilib-cpp/hash.cpp
endif
LIBOBJS += $(OUTDIR)/obj/hash.$(OBJ_EXT)
$(OUTDIR)/obj/hash.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/hash.cpp

ifdef ARMV8_CRYPT
SRC += $(IP_SRC)/common/ilib-cpp/armv8_sha-core.S
LIBOBJS += $(OUTDIR)/obj/armv8_sha.$(OBJ_EXT)
$(OUTDIR)/obj/armv8_sha.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/armv8_sha.S
	$(cc) $(aflags) $(IP_SRC)/common/ilib-cpp/armv8_sha.S

SRC += $(IP_SRC)/common/ilib-cpp/armv8_aes.S
LIBOBJS += $(OUTDIR)/obj/armv8_aes.$(OBJ_EXT)
$(OUTDIR)/obj/armv8_aes.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/armv8_aes.S
	$(cc) $(aflags) $(IP_SRC)/common/ilib-cpp/armv8_aes.S
endif

ifeq ($(ARMV7_CRYPT),1)
SRC += $(IP_SRC)/common/ilib-cpp/armv7neon_aes.S
LIBOBJS += $(OUTDIR)/obj/armv7neon_aes.$(OBJ_EXT)
$(OUTDIR)/obj/armv7neon_aes.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/armv7neon_aes.S
	$(cc) $(aflags) $(IP_SRC)/common/ilib-cpp/armv7neon_aes.S

SRC += $(IP_SRC)/common/ilib-cpp/armv7neon_sha256.S
LIBOBJS += $(OUTDIR)/obj/armv7neon_sha256.$(OBJ_EXT)
$(OUTDIR)/obj/armv7neon_sha256.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/armv7neon_sha256.S
	$(cc) $(aflags) $(IP_SRC)/common/ilib-cpp/armv7neon_sha256.S

SRC += $(IP_SRC)/common/ilib-cpp/armv7neon_sha512.S
LIBOBJS += $(OUTDIR)/obj/armv7neon_sha512.$(OBJ_EXT)
$(OUTDIR)/obj/armv7neon_sha512.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/armv7neon_sha512.S
	$(cc) $(aflags) $(IP_SRC)/common/ilib-cpp/armv7neon_sha512.S
endif # ($(ARMV7_CRYPT),1)

include $(IP_SRC)/common/ilib-cpp/x86_simd/x86_simd.mak

SRC += $(IP_SRC)/common/ilib-cpp/cipher.cpp
LIBOBJS += $(OUTDIR)/obj/cipher.$(OBJ_EXT)
$(OUTDIR)/obj/cipher.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/cipher.cpp

SRC += $(IP_SRC)/common/ilib-cpp/crc.cpp
LIBOBJS += $(OUTDIR)/obj/crc.$(OBJ_EXT)
$(OUTDIR)/obj/crc.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/crc.cpp

SRC += $(IP_SRC)/common/ilib-cpp/zip.cpp
LIBOBJS += $(OUTDIR)/obj/zip.$(OBJ_EXT)
$(OUTDIR)/obj/zip.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/zip.cpp


SRC += $(IP_SRC)/common/ilib-cpp/http_query_args.cpp
LIBOBJS += $(OUTDIR)/obj/http_query_args.$(OBJ_EXT)
$(OUTDIR)/obj/http_query_args.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/http_query_args.cpp

SRC += $(IP_SRC)/common/ilib-cpp/lib.cpp
LIBOBJS += $(OUTDIR)/obj/lib.$(OBJ_EXT)
$(OUTDIR)/obj/lib.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/lib.cpp

SRC += $(IP_SRC)/common/ilib-cpp/types.cpp
LIBOBJS += $(OUTDIR)/obj/types.$(OBJ_EXT)
$(OUTDIR)/obj/types.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/types.cpp

SRC += $(IP_SRC)/common/ilib-cpp/jwk.cpp
LIBOBJS += $(OUTDIR)/obj/jwk.$(OBJ_EXT)
$(OUTDIR)/obj/jwk.$(OBJ_EXT): $(IP_SRC)/common/ilib-cpp/jwk.cpp
