rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | define my-dir |
| 2 | $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) |
| 3 | endef |
| 4 | |
| 5 | define all-pta-mk-under |
| 6 | $(wildcard $1/*/pta.mk) |
| 7 | endef |
| 8 | |
| 9 | define _add-prebuilt-libname |
| 10 | libdirs += $(call my-dir) |
| 11 | libnames += $1 |
| 12 | endef |
| 13 | |
| 14 | define add-prebuilt-libname |
| 15 | $(eval $(call _add-prebuilt-libname, $1)) |
| 16 | endef |
| 17 | |
| 18 | define add-pta-src |
| 19 | $(eval LDADD := $(LDADD) $(out-dir)/../..$(subst ..,,$(libdir)/$(strip $(subst .c,.o,$1)))) |
| 20 | endef |
| 21 | |
| 22 | # $1: libname |
| 23 | # $2: object file in libname |
| 24 | define _add-libname-pta-obj |
| 25 | my-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 | |
| 31 | libdeps += $(out-dir)$$(subst ..,,$$(my-path))/$$(strip $2) |
| 32 | LDADD := $(LDADD) $(out-dir)$$(subst ..,,$$(my-path))/$$(strip $2) |
| 33 | endef |
| 34 | |
| 35 | define add-libname-pta-obj |
| 36 | $(eval $(call _add-libname-pta-obj,$1,$2)) |
| 37 | endef |
| 38 | |
| 39 | base-prefix = core-lib/ |
| 40 | BUILD_OPTEE_OS_LIB := mk/lib.mk |
| 41 | |
| 42 | #include $(call all-pta-mk-under, $(call my-dir)) |
| 43 | include $(call my-dir)/common/pta.mk |
| 44 | -include $(call my-dir)/$(PLATFORM_FLAVOR)/pta.mk |
| 45 | |