1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

dist/buildsystem_sanity_check: add check for CPU/CPU_MODEL definition

CPU and CPU_MODEL variables must now be defined by
`boards/**/Makefile.features` or 'cpu/CPU/Makefile.features' files
instead of `**/Makefile.include.

Currently blacklist the slwstk6000b that still define
'CPU_MODEL' in a file that is not a 'Makefile.features.
This allows getting this sanity check script in master

This allow using the variables when parsing dependencies.
This commit is contained in:
Gaëtan Harter 2019-05-02 13:26:30 +02:00
parent 7064f7e0ab
commit cbfab679d3
No known key found for this signature in database
GPG Key ID: 76DF6BCF1B1F883B

View File

@ -144,6 +144,24 @@ check_board_do_not_include_cpu_features_dep() {
| error_with_message 'Makefiles files from cpu must not be included by the board anymore'
}
# CPU and CPU_MODEL definition have been moved to 'BOARD|CPU/Makefile.features'
check_cpu_cpu_model_defined_in_makefile_features() {
local patterns=()
local pathspec=()
# With our without space and with or without ?=
patterns+=(-e '^ *\(export\)\? *CPU \??\?=')
patterns+=(-e '^ *\(export\)\? *CPU_MODEL \??\?=')
pathspec+=(':!boards/**/Makefile.features')
pathspec+=(':!cpu/**/Makefile.features')
# Currently blacklist this non migrated file for CPU_MODEL
pathspec+=(':!boards/slwstk6000b/Makefile.include')
git -C "${RIOTBASE}" grep "${patterns[@]}" -- "${pathspec[@]}" \
| error_with_message 'CPU and CPU_MODEL definition must be done by board/BOARD/Makefile.features, board/common/**/Makefile.features or cpu/CPU/Makefile.features'
}
# Applications Makefile must not set 'BOARD =' unconditionally
check_not_setting_board_equal() {
local patterns=()
@ -166,6 +184,7 @@ all_checks() {
check_not_exporting_variables
check_deprecated_vars_patterns
check_board_do_not_include_cpu_features_dep
check_cpu_cpu_model_defined_in_makefile_features
check_not_setting_board_equal
}