2020-05-26 20:50:25 +02:00
|
|
|
include ../Makefile.tests_common
|
|
|
|
|
2020-06-18 15:16:35 +02:00
|
|
|
all: checks
|
2020-05-26 20:50:25 +02:00
|
|
|
|
|
|
|
include $(RIOTBASE)/Makefile.include
|
2020-06-04 12:04:54 +02:00
|
|
|
|
2020-06-18 15:16:35 +02:00
|
|
|
# List of variables to compare between Makefile and Kconfig
|
|
|
|
_VARS_TO_CHECK = BOARD CPU CPU_MODEL CPU_FAM CPU_CORE CPU_ARCH
|
|
|
|
|
2020-07-03 12:52:49 +02:00
|
|
|
# Commands to diff in 'check-values'
|
|
|
|
_CMDS = $(foreach v,$(_VARS_TO_CHECK), $(if $($(v)),info-debug-variable-$(v)))
|
|
|
|
_CMDS_CONFIG = $(foreach v,$(_VARS_TO_CHECK), $(if $($(v)),info-debug-variable-CONFIG_$(v)))
|
|
|
|
|
2020-06-18 15:16:35 +02:00
|
|
|
# Only compare variables that have a value in Makefile
|
2020-07-03 12:52:49 +02:00
|
|
|
checks: kconfig-features check-values
|
2020-06-18 15:16:35 +02:00
|
|
|
|
2020-06-04 12:04:54 +02:00
|
|
|
kconfig-features: $(KCONFIG_OUT_CONFIG)
|
|
|
|
@bash -c 'diff <($(MAKE) info-features-provided) \
|
|
|
|
<($(MAKE) dependency-debug-features-provided-kconfig) || \
|
|
|
|
(echo "ERROR: Kconfig features mismatch" && exit 1)'
|
2020-06-18 15:16:35 +02:00
|
|
|
|
2020-07-03 12:52:49 +02:00
|
|
|
check-values: $(KCONFIG_OUT_CONFIG)
|
|
|
|
@bash -c '(diff <($(MAKE) $(_CMDS) | sort) \
|
|
|
|
<($(MAKE) $(_CMDS_CONFIG) | sort) && echo "SUCCESS: $(_CMDS:info-debug-variable-%=%) values match") || \
|
|
|
|
(echo "ERROR: The value for $(_CMDS:info-debug-variable-%=%) in Kconfig does not match the one in the Makefile" && exit 1)'
|