####################################################
# This file contains general project configuration #
####################################################

_local_path := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))

ifeq ($(wildcard $(_local_path)/../local_settings.mk),)
  $(info ******************************************************************)
  $(info * Please, create local_settings.mk in the root dir:              *)
  $(info * $(realpath $(_local_path)/..))
  $(info * You could find default-local-settings.mk in the config folder. *)
  $(info ******************************************************************)
  $(error ./local_settings.mk is absent)
endif

include $(_local_path)/../local_settings.mk

CONFIG_APP_ABI := armeabi arm64-v8a

###  Default configuration to install ##########################################
#ifeq ($(CONFIG_DEPLOY_TARGET),)
#  CONFIG_DEPLOY_TARGET := sdm845/qsee
#endif
#DEPLOY_TARGET := $(CONFIG_DEPLOY_TARGET)
#DEPLOY_PLATFORM := $(notdir $(DEPLOY_TARGET))
#SPACE:= 
#DEPLOY_CHIP := $(firstword $(subst /, $(SPACE), $(DEPLOY_TARGET)))

# Trustlet UUID should consist of 32 bytes, each byte is printable characters.
# It's necessary for QSEE where [sign runtype] = [trustlet name] = [GP API UUID].
# Finally, convert hex to C struct for NWd library to call trustlet by GP API.
# This functionality should be automated in Multibuild SDK.
#
# activation_ta -> 61637469766174696f6e5f7461000000
# 61637469766174696f6e5f7461000000 -> {0x61637469,0x7661,0x7469,{0x6f,0x6e,0x5f,0x74,0x61,0x00,0x00,0x00}}

CONFIG_TA_UUID_TEXT := chnactiv

CONFIG_QSEE_TA_UUID := $(shell bash -c 'printf "%.32s" "$$(echo -n $(CONFIG_TA_UUID_TEXT) | xxd -p)000000000000000000000000000000000"')

CONFIG_TBASE_TA_UUID := ffffffff000000000000000000000088
CONFIG_TBASE_TA_API_LEVEL := 5

CONFIG_TEEGRIS_TA_UUID := 00000000000000000000636163746976

CONFIG_TA_UUID_STRUCT := $(shell bash -c 's='$(CONFIG_TA_UUID)' && echo {0x$${s:0:8}, 0x$${s:8:4}, 0x$${s:12:4}, {0x$${s:16:2}, 0x$${s:18:2}, 0x$${s:20:2}, 0x$${s:22:2}, 0x$${s:24:2}, 0x$${s:26:2}, 0x$${s:28:2}, 0x$${s:30:2}}} | sed -e "s/ //g"')

CONFIG_BUILD_TYPE := \"dev\"

# make RELEASE=y
ifeq ($(CONFIG_DEBUG),y)
  CONFIG_CFLAGS := -DMB_NO_LOGS -O2
  CONFIG_BUILD_TYPE := \"release\"
endif

CONFIG_VERSION := \"$(shell bash -c 'cat $(_local_path)/../VERSION')\"

