]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - optee/ti-optee-client.git/commitdiff
Allow O to be an absolute path
authorJerome Forissier <jerome.forissier@linaro.org>
Fri, 25 Nov 2016 14:07:01 +0000 (15:07 +0100)
committerJerome Forissier <jerome.forissier@linaro.org>
Fri, 16 Dec 2016 10:09:27 +0000 (11:09 +0100)
Update so that absolute as well as relative paths are accepted by the
Makefile.

Tested with:
  $ export CFG_WITH_SQLFS=y
  $ make
  $ make O=build
  $ make O=/tmp/build
  $ make O=~/build

Note that tilde expansion is supposed to be done by the calling shell.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Suggested-by: Zeng Tao <prime.zeng@hisilicon.com>
Acked-by: Zeng Tao <prime.zeng@hisilicon.com>
config.mk
libsqlfs/Makefile
libsqlite3/Makefile
libteec/Makefile
tee-supplicant/Makefile

index 4534cbca02044dc97bce8d1e35acedc44ecefd14..2cffc55350f370087f61730a15741de8d0f3b04b 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -38,10 +38,12 @@ CFG_TEE_CLIENT_LOAD_PATH ?= /system/lib
 # such as 1008.5 that test loading of corrupt TAs.
 CFG_TA_TEST_PATH ?= 1
 
-# Default out dir.
-# Must be a relative path with respect to the op-tee-client root directory
+# Default output directory.
+# May be absolute, or relative to the optee_client source directory.
 O               ?= out
-export O
+
+# To be used instead of $(O) in sub-directories
+OO := $(if $(filter /%,$(O)),$(O),$(CURDIR)/../$(O))
 
 #########################################################################
 # Private Values                                                        #
index 656e94cc40f001878d4985c6cd2bfb682df46dd5..b53ccde724fa49444dbebe0f7966a66c24db0f5f 100644 (file)
@@ -4,9 +4,9 @@
 # and/or linking it statically! See COPYING section 6.
 
 include ../flags.mk
+include ../config.mk
 
-O ?= out
-OUT_DIR        ?= ${CURDIR}/../$(O)/libsqlfs
+OUT_DIR := $(OO)/libsqlfs
 
 .PHONY: all libsqlfs clean
 
@@ -39,10 +39,11 @@ SQLFS_CFLAGS := $(addprefix -I, $(SQLFS_INCLUDES)) \
        -Wno-missing-format-attribute
 
 SQLFS_LFLAGS := -lpthread
-SQLFS_LIBS := $(CURDIR)/../$(O)/libsqlite3/libsqlite3.a
+SQLFS_LIBS := $(OUT_DIR)/../libsqlite3/libsqlite3.a
 SQLFS_LIBRARY := $(OUT_DIR)/$(LIB_MAJ_MIN)
 
 libsqlfs: $(SQLFS_LIBRARY)
+       $(VPREFIX)mkdir -p $(OUT_DIR)
        $(VPREFIX)ln -sf $(SQLFS_LIBRARY) $(OUT_DIR)/$(LIB_MAJOR)
        $(VPREFIX)ln -sf $(OUT_DIR)/$(LIB_MAJOR) $(OUT_DIR)/$(LIB_NAME)
 
index 85d0d0aed09344ee1eb8daf624bd75b81b14c087..a69aabd7c97e59553ed14f9ca369411b3524d7ed 100644 (file)
@@ -1,7 +1,7 @@
 include ../flags.mk
+include ../config.mk
 
-O ?= out
-OUT_DIR        ?= ${CURDIR}/../$(O)/libsqlite3
+OUT_DIR        := $(OO)/libsqlite3
 
 .PHONY: all libsqlite3 clean
 
index effc5862b73c5baa9ac3a21f32657f0179dfdcc5..66055a723a2d34d9b3ba11891770bb02d5f6c995 100644 (file)
@@ -1,6 +1,7 @@
 include ../flags.mk
+include ../config.mk
 
-OUT_DIR                ?= ${CURDIR}/../$(O)/libteec
+OUT_DIR := $(OO)/libteec
 
 .PHONY: all libteec clean
 
index 0ebdd2fac13d06aba7e888f290826664c79636f3..af4024d7f7c382121ac99ec906fbe2bf73ad9c38 100644 (file)
@@ -1,7 +1,7 @@
 include ../flags.mk
 include ../config.mk
 
-OUT_DIR                ?= ${CURDIR}/../$(O)/tee-supplicant
+OUT_DIR := $(OO)/tee-supplicant
 
 # Emulate RPMB ioctl's
 RPMB_EMU       := 1