| # |
| # Copyright (C) 2012 OpenWrt.org |
| # |
| # This is free software, licensed under the GNU General Public License v2. |
| # See /LICENSE for more information. |
| # |
| |
| include $(TOPDIR)/rules.mk |
| include $(INCLUDE_DIR)/kernel.mk |
| |
| PKG_NAME:=optee_app |
| PKG_VERSION:=1 |
| PKG_RELEASE:=1 |
| |
| PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) |
| PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) |
| SVC_SOURCE_DIR:=$(MRVLDIR)/services/optee_app |
| PKG_SOURCE_DIR:=$(SVC_SOURCE_DIR) $(STAGING_DIR)/usr/include $(STAGING_DIR)/usr/lib |
| PKG_BUILD_PARALLEL:=0 |
| |
| APP_LIST:= libsecure_storage |
| |
| include $(INCLUDE_DIR)/package.mk |
| |
| define Package/optee_app |
| CATEGORY:=service |
| TITLE:=optee application |
| DEPENDS:=+libpthread +optee_client |
| DEFAULT:=n |
| endef |
| |
| define Package/optee_app/extra_provides |
| echo "libmbtk_lib.so" |
| endef |
| |
| define Package/optee_app/config |
| menu "OPTEE application Configuration" |
| config HWRANDOM |
| bool "Enable hardware random TA/CA" |
| default n |
| config CIPHER_TEST |
| bool "Enable Cipher test TA/CA" |
| default n |
| config SECURE_STORAGE |
| bool "Enable secure storage test TA/CA" |
| default n |
| config ACIPHER_TEST |
| bool "Enable ACipher test TA/CA" |
| config KEY_TEST |
| bool "Enable key test TA/CA" |
| endmenu |
| endef |
| |
| ifeq ($(CONFIG_HWRANDOM),y) |
| APP_LIST := $(APP_LIST)" random" |
| endif |
| |
| ifeq ($(CONFIG_CIPHER_TEST),y) |
| APP_LIST := $(APP_LIST)" cipher" |
| endif |
| |
| ifeq ($(CONFIG_SECURE_STORAGE),y) |
| APP_LIST := $(APP_LIST)" secure_storage" |
| endif |
| |
| ifeq ($(CONFIG_ACIPHER_TEST),y) |
| APP_LIST := $(APP_LIST)" acipher" |
| endif |
| |
| ifeq ($(CONFIG_KEY_TEST),y) |
| APP_LIST := $(APP_LIST)" keytest" |
| endif |
| |
| define Package/optee_app/description |
| optee applications |
| endef |
| |
| define Build/Compile |
| $(MAKE) $(PKG_JOBS) -C $(SVC_SOURCE_DIR) HOST_CROSS_COMPILE="$(TARGET_CROSS)" \ |
| TA_DEV_KIT_DIR=$(TOPDIR)/package/services/optee_os/export/asr18xx/export-ta_arm32\ |
| TEEC_EXPORT=$(MRVLDIR)/services/optee_client/out/export/usr PLATFORM=$(ARCH_PROFILE)\ |
| LOG_EXPORT=$(TOPDIR)/mbtk/rootfs \ |
| TA_CROSS_COMPILE="$(TARGET_CROSS)" APP_LIST=$(APP_LIST) |
| endef |
| |
| define Build/Clean |
| $(MAKE) $(PKG_JOBS) -C $(SVC_SOURCE_DIR) \ |
| CROSS_COMPILE="$(TARGET_CROSS)" \ |
| TA_DEV_KIT_DIR=$(TOPDIR)/package/services/optee_os/export/asr18xx/export-ta_arm32\ |
| TEEC_EXPORT=$(MRVLDIR)/services/optee_client/out/export/usr PLATFORM=$(ARCH_PROFILE)\ |
| APP_LIST=$(APP_LIST) clean |
| rm -rf $(SVC_SOURCE_DIR)/out |
| endef |
| |
| define Build/InstallDev |
| endef |
| |
| define Package/$(PKG_NAME)/install |
| $(INSTALL_DIR) $(1)/usr/sbin |
| $(INSTALL_DIR) $(1)/usr/lib/optee_armtz |
| $(INSTALL_DIR) $(1)/lib |
| $(CP) -rf $(SVC_SOURCE_DIR)/out/ca/* $(1)/usr/sbin |
| $(CP) -rf $(SVC_SOURCE_DIR)/out/lib/* $(1)/lib |
| find $(SVC_SOURCE_DIR)/out/ta -name "*.ta" | xargs -i $(CP) {} $(1)/usr/lib/optee_armtz |
| find $(SVC_SOURCE_DIR)/out/ta -name "*.elf" | xargs -i $(CP) {} $(1)/usr/lib/optee_armtz |
| endef |
| |
| $(eval $(call BuildPackage,optee_app)) |