base-linux: omit unused lib/mk/ from API recipe

The 'base-linux' API is used by hybrid Genode/Linux programs for the
lx_hybrid library. This API archive happend to contain other libraries -
like seccomp - that are solely needed for building core. With the change
of the build system in issue #4599, the build system would attempt to
build all libraries instead of merely the library dependencies of the
available targets. Hence, it would trigger the build of, e.g.,  the
seccomp library for each user of the base-linux API.

This patch avoids these superfluous build steps by pruning the content
of lib/mk/ to the libraries actually needed for lx_hybrid users.

Issue #4599
This commit is contained in:
Norman Feske 2022-09-06 12:14:47 +02:00
parent 7be98166ee
commit 35661d065e

View File

@ -1,8 +1,7 @@
FROM_BASE_LINUX := etc src/lib/syscall src/lib/lx_hybrid lib/import include
FROM_BASE_LINUX_AND_BASE := lib/mk src/lib/base src/include
FROM_BASE := src/lib/timeout
FROM_BASE_LINUX_AND_BASE := src/lib/base src/include
content: $(FROM_BASE_LINUX) $(FROM_BASE_LINUX_AND_BASE) $(FROM_BASE) LICENSE
content: $(FROM_BASE_LINUX) $(FROM_BASE_LINUX_AND_BASE) LICENSE
$(FROM_BASE_LINUX):
mkdir -p $@
@ -13,9 +12,30 @@ $(FROM_BASE_LINUX_AND_BASE):
cp -r $(GENODE_DIR)/repos/base/$@/* $@
cp -r $(REP_DIR)/$@/* $@
$(FROM_BASE):
BASE_LIB_MK_CONTENT := \
$(addprefix lib/mk/,base-common.inc timeout.mk)
content: $(BASE_LIB_MK_CONTENT)
$(BASE_LIB_MK_CONTENT):
mkdir -p $(dir $@)
cp $(GENODE_DIR)/repos/base/$@ $@
content: src/lib/timeout
src/lib/timeout:
mkdir -p $@
cp -r $(GENODE_DIR)/repos/base/$@/* $@
BASE_LINUX_LIB_MK_CONTENT := \
$(addprefix lib/mk/,lx_hybrid.mk base-linux.inc base-linux-common.mk) \
$(foreach S,arm arm_64 x86_32 x86_64,lib/mk/spec/$S/syscall-linux.mk)
content: $(BASE_LINUX_LIB_MK_CONTENT)
$(BASE_LINUX_LIB_MK_CONTENT):
mkdir -p $(dir $@)
cp $(REP_DIR)/$@ $@
LICENSE:
cp $(GENODE_DIR)/LICENSE $@