summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Cutts <hcutts@chromium.org>2019-10-02 12:27:57 -0700
committerCommit Bot <commit-bot@chromium.org>2019-10-11 01:45:46 +0000
commitb9f24d30e9a379f1ab8d457e655b3e22301dd4ca (patch)
tree0791178355fe275a119cea584fefdba5fd73f094
parent1092c786f7876745ec0d68dd52284d252e1abee5 (diff)
downloadchrome-ec-b9f24d30e9a379f1ab8d457e655b3e22301dd4ca.tar.gz
util: add build include for private host tools
We have provision for private host commands (see the `EC_PRIVATE_HOST_COMMAND_VALUE` macro), but no way to make a private host-side tool that can share the host command protocol implementation in util/. This CL allows a private directory to be symlinked as util/private and have its build.mk file included in the build. For an (internal-only) example of what you might put in private, see https://crrev.com/i/1914158. BRANCH=none BUG=chromium:1008568 TEST=Patch https://crrev.com/i/1914158 in the private repo (or add a util directory there with a build.mk), then from the ec directory, run `ln -s ../private/util util/private`. Run a build and verify that the private build.mk gets run. Change-Id: Ie1ad00cb454ba9ed57e4e9b24d4f5d397ca0d7a5 Signed-off-by: Harry Cutts <hcutts@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1836757 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--Makefile.rules4
-rw-r--r--util/build.mk6
2 files changed, 8 insertions, 2 deletions
diff --git a/Makefile.rules b/Makefile.rules
index df8c047afd..f04fa4a15c 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -21,8 +21,8 @@ skip_boards = OWNERS host kevin gru
boards := $(filter-out $(skip_boards),$(notdir $(wildcard board/* private*/board/*)))
# Create output directories if necessary
-_common_dir_create := $(foreach d,$(common_dirs),$(shell [ -d $(out)/$(d) ] || \
- mkdir -p $(out)/$(d)))
+_common_dir_create := $(foreach d,$(common_dirs) $(common-dirs-y),\
+ $(shell [ -d $(out)/$(d) ] || mkdir -p $(out)/$(d)))
_sharedlib_dir_create := $(foreach d,$(dirs),$(shell \
[ -d $(out)/$(SHOBJLIB)/$(d) ] || mkdir -p $(out)/$(SHOBJLIB)/$(d)))
_dir_create := $(foreach d,$(dirs) $(dirs-y),\
diff --git a/util/build.mk b/util/build.mk
index 37f01e0341..9b9f44c814 100644
--- a/util/build.mk
+++ b/util/build.mk
@@ -22,6 +22,12 @@ ifeq ($(BOARD),nocturne_fp)
build-util-bin+=ectool_servo
endif
+# If the util/ directory in the private repo is symlinked into util/private,
+# we want to build host-side tools from it, too.
+ifneq ("$(wildcard util/private/build.mk)","")
+include util/private/build.mk
+endif
+
comm-objs=$(util-lock-objs:%=lock/%) comm-host.o comm-dev.o
comm-objs+=comm-lpc.o comm-i2c.o misc_util.o