|
| 1 | +############################################################################ |
| 2 | +# apps/tee/libteec/Makefile |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: Apache-2.0 |
| 5 | +# |
| 6 | +# Copyright (C) 2023 Xiaomi Corporation |
| 7 | +# |
| 8 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | +# you may not use this file except in compliance with the License. |
| 10 | +# You may obtain a copy of the License at |
| 11 | +# |
| 12 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | +# |
| 14 | +# Unless required by applicable law or agreed to in writing, software |
| 15 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | +# See the License for the specific language governing permissions and |
| 18 | +# limitations under the License. |
| 19 | +# |
| 20 | +############################################################################ |
| 21 | + |
| 22 | +include $(APPDIR)/Make.defs |
| 23 | + |
| 24 | +LIBTEEC_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LIBTEEC_VERSION))) |
| 25 | +LIBTEEC_URL ?= "https://github.com/OP-TEE/optee_client/archive/refs/tags" |
| 26 | +LIBTEEC_ZIP = $(LIBTEEC_VERSION).zip |
| 27 | +LIBTEEC_UNPACKNAME = optee_client |
| 28 | +UNPACK ?= unzip -q -o |
| 29 | + |
| 30 | +CSRCS += optee_client/libteec/src/tee_client_api.c |
| 31 | +CSRCS += optee_client/libteec/src/teec_trace.c |
| 32 | + |
| 33 | +$(LIBTEEC_ZIP): |
| 34 | + @echo "Downloading: $(LIBTEEC_URL)/$(LIBTEEC_ZIP)" |
| 35 | + $(Q) $(call DOWNLOAD,$(LIBTEEC_URL),$(LIBTEEC_ZIP)) |
| 36 | + |
| 37 | +$(LIBTEEC_UNPACKNAME): $(LIBTEEC_ZIP) |
| 38 | + @echo "Unpacking: $(LIBTEEC_ZIP) -> $(LIBTEEC_UNPACKNAME)" |
| 39 | + $(Q) $(UNPACK) $(LIBTEEC_ZIP) |
| 40 | + $(Q) mv $(LIBTEEC_UNPACKNAME)-$(LIBTEEC_VERSION) $(LIBTEEC_UNPACKNAME) |
| 41 | + $(Q) echo "Patching $(LIBTEEC_UNPACKNAME)" |
| 42 | + $(Q) patch -p1 -d $(LIBTEEC_UNPACKNAME) < 0001-libteec-NuttX.patch |
| 43 | + $(Q) touch $(LIBTEEC_UNPACKNAME) |
| 44 | + |
| 45 | +ifeq ($(wildcard $(LIBTEEC_UNPACKNAME)/.git),) |
| 46 | +context:: $(LIBTEEC_UNPACKNAME) |
| 47 | + |
| 48 | +distclean:: |
| 49 | + $(Q) rm -rf $(LIBTEEC_UNPACKNAME) |
| 50 | +endif |
| 51 | + |
| 52 | +include $(APPDIR)/Application.mk |
0 commit comments