aboutsummaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
authorFrances Wingerter <wingerter@google.com>2024-01-25 12:07:54 -0500
committerFrances Wingerter <wingerter@google.com>2024-02-14 09:49:20 -0500
commitc2b25bd45757c0689dae0fb4bf9b0a41f06e7822 (patch)
tree6742f54d2d2dd5d57b5f2b28907ce9c751a4cc64 /make
parent8a365f290e615caf8b8f0341530b9b065016c6d7 (diff)
downloadcommon-c2b25bd45757c0689dae0fb4bf9b0a41f06e7822.tar.gz
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
Diffstat (limited to 'make')
-rw-r--r--make/module.mk1
-rw-r--r--make/recurse.mk10
2 files changed, 10 insertions, 1 deletions
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))