blob: fe62cda86280e923443809bd038d998aa889f9e7 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001define my-dir
2$(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
3endef
4
5define all-pta-mk-under
6$(wildcard $1/*/pta.mk)
7endef
8
9define _add-prebuilt-libname
10libdirs += $(call my-dir)
11libnames += $1
12endef
13
14define add-prebuilt-libname
15$(eval $(call _add-prebuilt-libname, $1))
16endef
17
18define add-pta-src
19$(eval LDADD := $(LDADD) $(out-dir)/../..$(subst ..,,$(libdir)/$(strip $(subst .c,.o,$1))))
20endef
21
22# $1: libname
23# $2: object file in libname
24define _add-libname-pta-obj
25my-path := $(call my-dir)
26$(out-dir)$$(subst ..,,$$(my-path))/$$(strip $2): $(call my-dir)/lib$$(strip $1).a
27 echo $$@
28 $(q)mkdir -p $$(dir $$@)
29 $(q)cd $$(dir $$@); $(AR$(sm)) x $$(abspath $$<) $2
30
31libdeps += $(out-dir)$$(subst ..,,$$(my-path))/$$(strip $2)
32LDADD := $(LDADD) $(out-dir)$$(subst ..,,$$(my-path))/$$(strip $2)
33endef
34
35define add-libname-pta-obj
36$(eval $(call _add-libname-pta-obj,$1,$2))
37endef
38
39base-prefix = core-lib/
40BUILD_OPTEE_OS_LIB := mk/lib.mk
41
42#include $(call all-pta-mk-under, $(call my-dir))
43include $(call my-dir)/common/pta.mk
44-include $(call my-dir)/$(PLATFORM_FLAVOR)/pta.mk
45