]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
build: Introduce `mk_sub_libbuild_dir`
authorSimon Kuenzer <simon.kuenzer@neclab.eu>
Mon, 26 Apr 2021 14:28:29 +0000 (16:28 +0200)
committerUnikraft <monkey@unikraft.io>
Wed, 5 May 2021 17:52:49 +0000 (17:52 +0000)
Inline with `mk_sub_build_dir`, this commit introduces
`mk_sub_libbuild_dir` that enables creating a sub build
directory for a library. This new Makefile command has
two parameters: (1) library name, (2) sub directory
structure.

Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Pull-Request: #194

support/build/Makefile.rules

index ec28b96103a520a889abadf378576ab5d9a6b056..e6de319c3918e7e5e1c048b65419549faac1bb76 100644 (file)
@@ -226,6 +226,14 @@ define addplatlib_s =
 $(if $(filter y,$(3)),$(call addplatlib,$(1),$(2)),)
 endef
 
+# creates a sub build directory for a library
+# $libname,$subdir
+define mk_sub_libbuild_dir =
+$(if $(shell mkdir -p "$(BUILD_DIR)/$(1)/$(2)" && cd "$(BUILD_DIR)/$(1)/$(2)" >/dev/null && pwd),,\
+     $(error could not create directory "$(BUILD_DIR)/$(1)/$(2)"))
+endef
+
+sub_libbuild_dir = $(BUILD_DIR)/$(1)/$(2)
 
 ################################################################################
 #