summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2019-04-08 14:52:34 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-26 00:17:31 -0700
commit5c931074f53de0bcac655d60e5867b3eb0959864 (patch)
tree2acb81ac19cad47cbd174ec8eb39789035951ecf /Makefile.rules
parentd3ce30103e55fb8296259bd7d22f7d8c8d8e7a0c (diff)
downloadchrome-ec-5c931074f53de0bcac655d60e5867b3eb0959864.tar.gz
util: Add tool to generate cros_ec_commands.h
Add a rule to generate a new cros_ec_commands.h when ec_commands.h is modified. The rule is checked when buildall is invoked. At Presubmit stage, check a cros_ec_commands.h exists if ec_commands.h is modified. The CL author is responsible to upstream that file. BUG=chromium:945948 BRANCH=none Cq-Depend: chromium:1558853 TEST=Check manually cros_ec_commands.h is generated with make build_cros_ec_commands Check no bread crumbs are left-over when the rule fails. Check checkpatch triggers when it finds an invalid syntax in the output file. Check ../../repohooks/pre-upload.py returns a meaningful error when cros_ec_commands.h file is not present. Change-Id: Ibc8ed7165914d39b5f0bd41643932a8514768925 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1559380 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Brian Norris <briannorris@chromium.org>
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile.rules b/Makefile.rules
index 888ff06d8c..787e4e7b5d 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -164,7 +164,7 @@ build_boards: | $(FAILED_BOARDS_DIR)
$(MAKE) try_build_boards
.PHONY: buildall
-buildall: build_boards
+buildall: build_boards build_cros_ec_commands
$(MAKE) build_cts
$(MAKE) buildfuzztests
$(MAKE) runtests
@@ -758,6 +758,12 @@ stats: build_boards
$(call cmd_stats,RO)
$(call cmd_stats,RW)
+.PHONY: build_cros_ec_commands
+build_cros_ec_commands: build/kernel/include/linux/mfd/cros_ec_commands.h
+
+build/kernel/include/linux/mfd/cros_ec_commands.h: include/ec_commands.h
+ util/make_linux_ec_commands_h.sh $< $@
+
.SECONDARY:
-include $(deps)