From: Andrei Tatar Date: Tue, 18 Jul 2023 18:08:54 +0000 (+0200) Subject: build: Add library registration for tree build X-Git-Tag: RELEASE-0.14.0~51 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ae1cb65410f66666f65befb7f92d9f09d5e90bdb;p=unikraft%2Funikraft.git build: Add library registration for tree build This change adds `addlib_tree` and `addlib_tree_s` as library registration functions that enable build products to be placed in a directory tree mirroring the source files. This is useful for code that shares source filenames across multiple directories. Signed-off-by: Andrei Tatar Reviewed-by: Maria Sfiraiala Reviewed-by: Marco Schlumpp Reviewed-by: Stefan Jumarea Reviewed-by: Simon Kuenzer Approved-by: Simon Kuenzer Tested-by: Unikraft CI GitHub-Closes: #1001 --- diff --git a/support/build/Makefile.rules b/support/build/Makefile.rules index fb3ccd64a..75969ecad 100644 --- a/support/build/Makefile.rules +++ b/support/build/Makefile.rules @@ -271,6 +271,12 @@ $(eval $(call uc,$(1))_EXPORTS += $(wildcard $(IMPORT_BASE)/exportsyms.uk)) $(eval $(call uc,$(1))_LOCALS += $(wildcard $(IMPORT_BASE)/localsyms.uk)) endef +# addlib_tree $1:libname +define addlib_tree = +$(eval $(call uc,$(1))__BUILDTREE := y) +$(call addlib,$(1)) +endef + # addlib_s $1:libname,$2:switch define addlib_s = ifeq ($(2),y) @@ -278,6 +284,13 @@ $(call addlib,$(1)) endif endef +# addlib_tree_s $1:libname,$2:switch +define addlib_tree_s = +ifeq ($(2),y) +$(call addlib_tree,$(1)) +endif +endef + # addplatlib $1:platname,$2:libname define addplatlib = $(call mk_sub_build_dir,$(2))