################################################################################
#
# <t-sdk Sample AES Trusted Application
#
################################################################################

TRUSTLET_DIR ?= ../Code

# output binary name without path or extension
OUTPUT_NAME := softsim

#-------------------------------------------------------------------------------
# MobiConvert parameters, see manual for details
#-------------------------------------------------------------------------------
TRUSTLET_UUID := 07020000000000000000000000000000
TRUSTLET_MEMTYPE := 2
TRUSTLET_NO_OF_THREADS := 1
TRUSTLET_SERVICE_TYPE := 3
TRUSTLET_KEYFILE := Locals/Build/keySpTl.xml
TRUSTLET_FLAGS := 4
TRUSTLET_INSTANCES := 16
ifeq ($(TOOLCHAIN),GNU)
    TRUSTLET_OPTS += -Werror
endif
ifeq ($(TOOLCHAIN),ARM)
   TRUSTLET_OPTS += --diag_error=warning
endif

TRUSTLET_OPTS += -DMOBICORE
#-------------------------------------------------------------------------------
# Files and include paths - Add your files here
#-------------------------------------------------------------------------------

### Add include path here
INCLUDE_DIRS += \
    $(TRUSTLET_DIR)/include/crypto_core  \
    $(TRUSTLET_DIR)/include/softsim-logic  \
    $(TRUSTLET_DIR)/qsee     \
    $(TRUSTLET_DIR)/qsee/json     \
    $(TRUSTLET_DIR)/qsee/x509     \
    $(TRUSTLET_DIR)/qsee/target/mobicore 

### Add source code files for C compiler here
SRC_C += \
    $(TRUSTLET_DIR)/qsee/target/mobicore/app_entry.c \
    $(TRUSTLET_DIR)/qsee/tl_process_cmd.c \
    $(TRUSTLET_DIR)/qsee/tl_softsim_logic.c \
    $(TRUSTLET_DIR)/qsee/tl_fs.c \
    $(TRUSTLET_DIR)/qsee/tl_certificate.c \
    $(TRUSTLET_DIR)/qsee/tl_aes.c \
    $(TRUSTLET_DIR)/qsee/tl_aes_crypto.c \
    $(TRUSTLET_DIR)/qsee/tl_rsa_crypto.c \
    $(TRUSTLET_DIR)/qsee/tl_usim_op.c \
    $(TRUSTLET_DIR)/qsee/tl_utils.c \
    $(TRUSTLET_DIR)/qsee/tl_json.c \
    $(TRUSTLET_DIR)/qsee/tl_heap.c \
    $(TRUSTLET_DIR)/qsee/tl_log.c \
    $(TRUSTLET_DIR)/qsee/tl_inter_app_msg.c \
    $(TRUSTLET_DIR)/qsee/softsim_main.c \
    $(TRUSTLET_DIR)/qsee/x509/asn1.c \
    $(TRUSTLET_DIR)/qsee/x509/asn1rsa.c \
    $(TRUSTLET_DIR)/qsee/x509/x509v3.c \
    $(TRUSTLET_DIR)/qsee/json/cJSON.c \
    $(TRUSTLET_DIR)/qsee/target/mobicore/target.c \


### Add source code files for C++ compiler here
SRC_CPP += # nothing

### Add source code files for assembler here
SRC_S += # nothing

CUSTOMER_DRIVER_LIBS += $(TRUSTLET_DIR)/lib/llvm/libsoftsim-logic.a \
                        $(TRUSTLET_DIR)/lib/llvm/crypto_core.a

all:
	echo $(TLSDK_DIR)
#-------------------------------------------------------------------------------
# use generic make file
TLSDK_DIR_SRC ?= $(TLSDK_DIR)
include $(TLSDK_DIR)/trustlet.mk

