Skip to content

Commit a5ae889

Browse files
author
Andrew Boie
committed
build: add Kconfig mechanism for deprecating boards
If a deprecated board is built, a warning is presented indicating what future release the board will be removed. Change-Id: Ib166198d8b71303b990a30f79429f51871591a97 Signed-off-by: Andrew Boie <[email protected]>
1 parent 50b9317 commit a5ae889

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Makefile

+10
Original file line numberDiff line numberDiff line change
@@ -875,15 +875,25 @@ ASSERT_WARNING_STR := \
875875

876876
WARN_ABOUT_ASSERT := $(if $(CONFIG_ASSERT),echo -e -n $(ASSERT_WARNING_STR),true)
877877

878+
879+
DEPRECATION_WARNING_STR := \
880+
"\n WARNING: The board '$(BOARD)' is deprecated and will be" \
881+
"\n removed in version $(CONFIG_BOARD_DEPRECATED)\n\n"
882+
883+
WARN_ABOUT_DEPRECATION := $(if $(CONFIG_BOARD_DEPRECATED),echo -e \
884+
-n $(DEPRECATION_WARNING_STR),true)
885+
878886
ifeq ($(ARCH),x86)
879887
$(KERNEL_ELF_NAME): staticIdt.o linker.cmd
880888
$(call cmd,lnk_elf)
881889
@$(srctree)/scripts/check_link_map.py $(KERNEL_NAME).map
882890
@$(WARN_ABOUT_ASSERT)
891+
@$(WARN_ABOUT_DEPRECATION)
883892
else
884893
$(KERNEL_ELF_NAME): $(TMP_ELF)
885894
@cp $(TMP_ELF) $(KERNEL_ELF_NAME)
886895
@$(WARN_ABOUT_ASSERT)
896+
@$(WARN_ABOUT_DEPRECATION)
887897
endif
888898

889899

boards/Kconfig

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11

2+
config BOARD_DEPRECATED
3+
string
4+
help
5+
This hidden option is set in the board configuation and indicates
6+
the Zephyr release that the board configuration will be removed.
7+
When set, any build for that board will generate a clearly visible
8+
deprecation warning.
9+
210
choice
311
prompt "Board Selection"
412
source "boards/*/*/Kconfig.board"

0 commit comments

Comments
 (0)