]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
build: Add library registration for tree build
authorAndrei Tatar <andrei@unikraft.io>
Tue, 18 Jul 2023 18:08:54 +0000 (20:08 +0200)
committerUnikraft <monkey@unikraft.io>
Fri, 11 Aug 2023 16:05:36 +0000 (16:05 +0000)
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 <andrei@unikraft.io>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Simon Kuenzer <simon@unikraft.io>
Approved-by: Simon Kuenzer <simon@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #1001

support/build/Makefile.rules

index fb3ccd64a0947c1f124666e309b5365113dbf6c4..75969ecadf9491256890c5b12f345860ebab0f23 100644 (file)
@@ -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))