From: Simon Kuenzer Date: Mon, 26 Apr 2021 14:28:29 +0000 (+0200) Subject: build: Introduce `mk_sub_libbuild_dir` X-Git-Tag: RELEASE-0.6~221 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9d6d85530967184de97ab9b07d4d803ba7d8b2a6;p=unikraft%2Funikraft.git build: Introduce `mk_sub_libbuild_dir` 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 Reviewed-by: Cezar Craciunoiu Tested-by: Unikraft CI GitHub-Pull-Request: #194 --- diff --git a/support/build/Makefile.rules b/support/build/Makefile.rules index ec28b9610..e6de319c3 100644 --- a/support/build/Makefile.rules +++ b/support/build/Makefile.rules @@ -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) ################################################################################ #