From c2b25bd45757c0689dae0fb4bf9b0a41f06e7822 Mon Sep 17 00:00:00 2001 From: Frances Wingerter Date: Thu, 25 Jan 2024 12:07:54 -0500 Subject: build: accumulate ALLHOSTMODULES list of host modules to support kernel rust, we need to be able to require host modules, such as proc-macro crates, from the kernel. by accumulating them in the ALLHOSTMODULES variable, we can then pass them to the userspace build system, which already knows how to build them Bug: 304850822 Change-Id: I4ecba4d20a5ad0d61827eca30e47941d573337ab --- make/module.mk | 1 + make/recurse.mk | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/make/module.mk b/make/module.mk index 1f56eb28..23d85f0d 100644 --- a/make/module.mk +++ b/make/module.mk @@ -259,6 +259,7 @@ HOST_RUST_DEPS := $(foreach dep, $(MODULE_KERNEL_RUST_DEPS), $(if $(filter proc- # add kernel rust deps to the set of modules MODULES += $(KERNEL_RUST_DEPS) +HOST_MODULES += $(HOST_RUST_DEPS) # determine crate names of dependency modules so we can depend on their rlibs. # because of ordering, we cannot simply e.g. set/read MODULE_$(dep)_CRATE_NAME, diff --git a/make/recurse.mk b/make/recurse.mk index d4510906..bdeaf179 100644 --- a/make/recurse.mk +++ b/make/recurse.mk @@ -6,12 +6,20 @@ MODULES := $(sort $(MODULES)) MODULES := $(filter-out $(ALLMODULES),$(MODULES)) -ifneq ($(MODULES),) +HOST_MODULES := $(sort $(HOST_MODULES)) +HOST_MODULES := $(filter-out $(ALLHOSTMODULES),$(HOST_MODULES)) + +ifneq ($(MODULES)$(HOST_MODULES),) ALLMODULES += $(MODULES) ALLMODULES := $(sort $(ALLMODULES)) INCMODULES := $(MODULES) MODULES := + +ALLHOSTMODULES += $(HOST_MODULES) +ALLHOSTMODULES := $(sort $(ALLHOSTMODULES)) +HOST_MODULES := + $(info including $(INCMODULES)) include $(addsuffix /rules.mk,$(INCMODULES)) -- cgit v1.2.3