summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-02-25 14:48:16 -0500
committerCommit Bot <commit-bot@chromium.org>2021-03-05 21:11:12 +0000
commit0cb6fbb4a5391c389abc56346e7e1ccfeaa08708 (patch)
tree7958d3426a71d4eb10a6ce56e33b844d14a33c10 /Makefile.rules
parent1e806bc9eeefa0c91130240f8b0f6f92807232a6 (diff)
downloadchrome-ec-0cb6fbb4a5391c389abc56346e7e1ccfeaa08708.tar.gz
zephyr: Require new CONFIG options to be in Kconfig too
Add a script to help deal with new ad-hoc CONFIG options being added to ECOS. This works by maintaining a list of allowed ad-hoc CONFIG options and refusing to allow a build to succeed if it adds new ones. This is easier to implement than a pre-submit and more useful, since we can check the actual CONFIG file produced by a board. For example, adding a new CONFIG to board/volteer/board.h will cause the volteer build to break, but not kukui. That seems important to avoid frustration. Add the base list of allowed ad-hoc CONFIGs, which should never grow. As new Kconfig options are added for existing CONFIG options, or obsolete CONFIG options are removed, the list should eventually shrink to zero. BUG=b:181253613 BRANCH=none TEST=manually test that adding a new '#define CONFIG' causes an error to be generated, and adding a new Kconfig option with the same name causes the error to go away. Also check that the script suggests updating the list when a Kconfig is added for an existing CONFIG option. Finally, manually check that ALLOW_CONFIG=1 does as intended. (that's quite a few manual tests; possibly it is worth automating them) Change-Id: Id11b8d859fd07c2db73324cbb9e425182710ab3d Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2718533 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules3
1 files changed, 3 insertions, 0 deletions
diff --git a/Makefile.rules b/Makefile.rules
index 08497a8d5f..4f79e295ca 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -231,6 +231,9 @@ ifeq ($(TEST_BUILD),)
@echo "directory! Otherwise, you won't be able to enter any commands."
endif # not a TEST_BUILD
endif # CONFIG_EXPERIMENTAL_CONSOLE=y
+ @if [ -z "${ALLOW_CONFIG}" ]; then \
+ ./util/check_allowed.sh ${config} util/config_allowed.txt .; \
+ fi
proj-%: | $(FAILED_BOARDS_DIR)
@touch $(FAILED_BOARDS_DIR)/$*