summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index d00a5a5615..aa2037e347 100644
--- a/Makefile
+++ b/Makefile
@@ -310,6 +310,31 @@ endef
$(eval $(call get_sources,y))
$(eval $(call get_sources,ro))
+# The following variables are meant to be initialized in the baseboard or
+# board's build.mk. They will later be appended to in util/build.mk with
+# utils that should be generated for all boards.
+#
+# build-util-bin-y - Utils for the system doing the "build".
+# For example, the 64-bit x86 GNU/Linux running make.
+# These are often program that are needed by the build
+# system to generate code for use in firmware.
+# host-util-bin-y - Utils for the target platform on top of the EC.
+# For example, the 32-bit x86 Chromebook.
+# build-util-art-y - Build ?artifacts? for the system doing the "build"
+#
+# The util targets added to these variable will pickup extra build objects
+# from their optional <util_name>-objs make variable.
+#
+# See commit bc4c1b4 for more context.
+build-utils := $(call objs_from_dir,$(out)/util,build-util-bin)
+host-utils := $(call objs_from_dir,$(out)/util,host-util-bin)
+build-art := $(call objs_from_dir,$(out),build-util-art)
+# Use the util_name with an added .c AND the special <util_name>-objs variable.
+build-srcs := $(foreach u,$(build-util-bin-y),$(sort $($(u)-objs:%.o=util/%.c) \
+ $(wildcard util/$(u).c)))
+host-srcs := $(foreach u,$(host-util-bin-y),$(sort $($(u)-objs:%.o=util/%.c) \
+ $(wildcard util/$(u).c)))
+
dirs=core/$(CORE) chip/$(CHIP) $(BASEDIR) $(BDIR) common fuzz power test \
cts/common cts/$(CTS_MODULE) $(out)/gen
dirs+= private private-kandou $(PDIR) $(PBDIR)