diff options
author | Zeng Tao <prime.zeng@huawei.com> | 2016-07-15 11:31:24 +0800 |
---|---|---|
committer | Jerome Forissier <jerome.forissier@linaro.org> | 2016-08-11 10:12:51 +0200 |
commit | 9faf0da7b8543690df88623c30a8130234c25bc4 (patch) | |
tree | e68c5e4b1bdbc214f5a18ddc76895518dde01efb /ta | |
parent | 8c9d9445c98f84532251db2f6fbe6158bbc39676 (diff) |
mk: add library common makefile support
It is not always suitable to place the third party library source in
the optee-os directory, provide a common library makefile here, the
usage is similar as TA, the only difference is as follow:
TA Makefile:
BINARY := xxx
LIB Makefile:
LIBNAME := libxxx
And xxx.ta or libxxx.a is the target.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Zeng Tao <prime.zeng@huawei.com>
Diffstat (limited to 'ta')
-rw-r--r-- | ta/mk/ta_dev_kit.mk | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk index 045878d4..34272942 100644 --- a/ta/mk/ta_dev_kit.mk +++ b/ta/mk/ta_dev_kit.mk @@ -8,6 +8,17 @@ all: include $(ta-dev-kit-dir)/mk/conf.mk binary := $(BINARY) +libname := $(LIBNAME) + +ifneq ($(BINARY),) +ifneq ($(LIBNAME),) +$(error You can only specify one of BINARY or LIBNAME) +endif +else +ifeq ($(LIBNAME),) +$(error You must specify one of BINARY or LIBNAME) +endif +endif ifneq ($O,) out-dir := $O @@ -65,9 +76,24 @@ clean: subdirs = . include $(ta-dev-kit-dir)/mk/subdir.mk + +#the build target is ta +ifneq ($(binary),) vpath %.c $(ta-dev-kit-dir)/src srcs += user_ta_header.c +endif include $(ta-dev-kit-dir)/mk/gcc.mk include $(ta-dev-kit-dir)/mk/compile.mk +ifneq ($(binary),) include $(ta-dev-kit-dir)/mk/link.mk +else +ifneq ($(libname),) +all: $(libname).a +cleanfiles += $(libname).a + +$(libname).a: $(objs) + @echo ' AR $@' + $(q)rm -f $@ && $(AR$(sm)) rcs -o $@ $^ +endif +endif |