2020-05-25 09:38:27 +02:00
|
|
|
.PHONY: info-buildsizes \
|
|
|
|
info-buildsizes-diff \
|
|
|
|
info-boards-supported \
|
|
|
|
info-boards-features-missing \
|
|
|
|
info-boards-features-blacklisted \
|
2020-08-13 09:14:49 +02:00
|
|
|
info-boards-features-conflicting \
|
2020-05-25 09:38:27 +02:00
|
|
|
#
|
2017-09-09 00:06:29 +02:00
|
|
|
|
2020-04-14 15:23:23 +02:00
|
|
|
BOARDDIR_GLOBAL := $(BOARDDIR)
|
2017-09-09 00:06:29 +02:00
|
|
|
USEMODULE_GLOBAL := $(USEMODULE)
|
|
|
|
USEPKG_GLOBAL := $(USEPKG)
|
|
|
|
FEATURES_REQUIRED_GLOBAL := $(FEATURES_REQUIRED)
|
2021-02-16 16:12:56 +01:00
|
|
|
FEATURES_REQUIRED_ANY_GLOBAL := $(FEATURES_REQUIRED_ANY)
|
2017-09-09 00:06:29 +02:00
|
|
|
FEATURES_OPTIONAL_GLOBAL := $(FEATURES_OPTIONAL)
|
2019-08-14 17:35:08 +02:00
|
|
|
FEATURES_CONFLICT_GLOBAL := $(FEATURES_CONFLICT)
|
|
|
|
FEATURES_CONFLICT_MSG_GLOBAL := $(FEATURES_MSG_CONFLICT)
|
2019-08-14 17:35:08 +02:00
|
|
|
DISABLE_MODULE_GLOBAL := $(DISABLE_MODULE)
|
2019-08-14 17:35:08 +02:00
|
|
|
DEFAULT_MODULE_GLOBAL := $(DEFAULT_MODULE)
|
2018-05-04 15:43:41 +02:00
|
|
|
FEATURES_BLACKLIST_GLOBAL := $(FEATURES_BLACKLIST)
|
2017-09-09 00:06:29 +02:00
|
|
|
|
2019-10-15 07:55:33 +02:00
|
|
|
define board_unsatisfied_features
|
2018-03-22 16:20:19 +01:00
|
|
|
BOARD := $(1)
|
2017-09-09 00:06:29 +02:00
|
|
|
USEMODULE := $(USEMODULE_GLOBAL)
|
|
|
|
USEPKG := $(USEPKG_GLOBAL)
|
|
|
|
DISABLE_MODULE := $(DISABLE_MODULE_GLOBAL)
|
2019-08-14 17:35:08 +02:00
|
|
|
DEFAULT_MODULE := $(DEFAULT_MODULE_GLOBAL)
|
2017-09-09 00:06:29 +02:00
|
|
|
FEATURES_REQUIRED := $(FEATURES_REQUIRED_GLOBAL)
|
2021-02-16 16:12:56 +01:00
|
|
|
FEATURES_REQUIRED_ANY := $(FEATURES_REQUIRED_ANY_GLOBAL)
|
2017-09-09 00:06:29 +02:00
|
|
|
FEATURES_OPTIONAL := $(FEATURES_OPTIONAL_GLOBAL)
|
2019-08-14 17:35:08 +02:00
|
|
|
FEATURES_CONFLICT := $(FEATURES_CONFLICT_GLOBAL)
|
|
|
|
FEATURES_CONFLICT_MSG := $(FEATURES_CONFLICT_MSG_GLOBAL)
|
2018-05-04 15:43:41 +02:00
|
|
|
FEATURES_BLACKLIST:= $(FEATURES_BLACKLIST_GLOBAL)
|
2018-09-23 16:49:17 +02:00
|
|
|
|
2020-04-14 15:23:23 +02:00
|
|
|
# Find matching board folder
|
2020-05-25 09:39:27 +02:00
|
|
|
BOARDDIR := $$(word 1,$$(foreach dir,$$(BOARDSDIRS),$$(wildcard $$(dir)/$$(BOARD)/.)))
|
2020-04-14 15:23:23 +02:00
|
|
|
|
2018-09-23 16:49:17 +02:00
|
|
|
# Remove board specific variables set by Makefile.features/Makefile.dep
|
2017-09-09 00:06:29 +02:00
|
|
|
FEATURES_PROVIDED :=
|
2020-03-19 14:06:47 +01:00
|
|
|
FEATURES_USED :=
|
2019-05-02 16:47:08 +02:00
|
|
|
|
2018-09-23 16:49:17 +02:00
|
|
|
# Undefine variables that must not be defined when starting.
|
|
|
|
# Some are sometime set as `?=`
|
|
|
|
undefine CPU
|
|
|
|
undefine CPU_MODEL
|
2020-04-01 09:50:34 +02:00
|
|
|
undefine CPU_ARCH
|
2020-06-10 13:11:32 +02:00
|
|
|
undefine CPU_CORE
|
2020-04-01 09:50:34 +02:00
|
|
|
undefine CPU_FAM
|
2021-04-02 18:42:34 +02:00
|
|
|
undefine RUST_TARGET
|
2022-08-29 16:24:07 +02:00
|
|
|
undefine BOARD_VERSION
|
2018-09-23 16:49:17 +02:00
|
|
|
|
2019-05-02 16:47:08 +02:00
|
|
|
include $(RIOTBASE)/Makefile.features
|
2021-11-15 09:40:01 +01:00
|
|
|
# always select provided architecture features
|
|
|
|
FEATURES_REQUIRED += $$(filter arch_%,$$(FEATURES_PROVIDED))
|
|
|
|
# always select CPU core features
|
|
|
|
FEATURES_REQUIRED += $$(filter cpu_core_%,$$(FEATURES_PROVIDED))
|
2020-03-19 14:06:47 +01:00
|
|
|
# FEATURES_USED must be populated first in this case so that dependency
|
|
|
|
# resolution can take optional features into account during the first pass.
|
|
|
|
# Also: This allows us to skip resolution if already a missing feature is
|
|
|
|
# detected
|
|
|
|
include $(RIOTMAKE)/features_check.inc.mk
|
2019-05-03 16:19:20 +02:00
|
|
|
ifneq (,$$(FEATURES_MISSING))
|
2020-03-19 14:06:47 +01:00
|
|
|
# Skip full dependency resolution, as even without optional modules features
|
|
|
|
# and architecture specific limitations already some features are missing
|
2020-05-25 09:39:27 +02:00
|
|
|
BOARDS_FEATURES_MISSING += "$$(BOARD) $$(FEATURES_MISSING)"
|
|
|
|
BOARDS_WITH_MISSING_FEATURES += $$(BOARD)
|
2020-03-19 14:06:47 +01:00
|
|
|
else
|
2020-09-14 18:57:27 +02:00
|
|
|
# add default modules
|
2022-02-15 13:33:37 +01:00
|
|
|
include $(RIOTMAKE)/defaultmodules_regular.inc.mk
|
2021-05-04 11:28:17 +02:00
|
|
|
USEMODULE += $$(filter-out $$(DISABLE_MODULE),$$(DEFAULT_MODULE))
|
2020-09-14 18:57:27 +02:00
|
|
|
|
2020-03-19 14:06:47 +01:00
|
|
|
include $(RIOTMAKE)/dependency_resolution.inc.mk
|
|
|
|
|
|
|
|
ifneq (,$$(FEATURES_MISSING))
|
2020-05-25 09:39:27 +02:00
|
|
|
BOARDS_FEATURES_MISSING += "$$(BOARD) $$(FEATURES_MISSING)"
|
|
|
|
BOARDS_WITH_MISSING_FEATURES += $$(BOARD)
|
2020-03-19 14:06:47 +01:00
|
|
|
endif
|
2019-08-13 16:02:38 +02:00
|
|
|
|
2020-03-19 14:06:47 +01:00
|
|
|
ifneq (,$$(FEATURES_USED_BLACKLISTED))
|
2020-05-25 09:39:27 +02:00
|
|
|
BOARDS_FEATURES_USED_BLACKLISTED += "$$(BOARD) $$(FEATURES_USED_BLACKLISTED)"
|
|
|
|
BOARDS_WITH_BLACKLISTED_FEATURES += $$(BOARD)
|
2020-03-19 14:06:47 +01:00
|
|
|
endif
|
2020-08-13 09:14:49 +02:00
|
|
|
|
|
|
|
ifneq (,$$(FEATURES_CONFLICTING))
|
|
|
|
BOARDS_FEATURES_CONFLICTING += "$$(BOARD) $$(FEATURES_CONFLICTING)"
|
|
|
|
BOARDS_WITH_CONFLICTING_FEATURES += $$(BOARD)
|
|
|
|
endif
|
2019-10-15 07:55:33 +02:00
|
|
|
endif
|
|
|
|
|
2019-08-13 16:02:38 +02:00
|
|
|
ifneq (,$$(DEPENDENCY_DEBUG))
|
|
|
|
$$(call file_save_dependencies_variables,dependencies_info-boards-supported)
|
|
|
|
endif
|
2017-09-09 00:06:29 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
BOARDS := $(filter $(if $(BOARD_WHITELIST), $(BOARD_WHITELIST), %), $(BOARDS))
|
|
|
|
BOARDS := $(filter-out $(BOARD_BLACKLIST), $(BOARDS))
|
|
|
|
|
|
|
|
BOARDS_WITH_MISSING_FEATURES :=
|
|
|
|
BOARDS_FEATURES_MISSING :=
|
2019-10-15 07:55:33 +02:00
|
|
|
BOARDS_WITH_BLACKLISTED_FEATURES :=
|
|
|
|
BOARDS_FEATURES_USED_BLACKLISTED :=
|
2020-08-13 09:14:49 +02:00
|
|
|
BOARDS_FEATURES_CONFLICTING :=
|
|
|
|
BOARDS_WITH_CONFLICTING_FEATURES :=
|
2019-10-15 07:55:33 +02:00
|
|
|
|
2020-05-25 09:39:27 +02:00
|
|
|
$(foreach board,$(BOARDS),$(eval $(call board_unsatisfied_features,$(board))))
|
2020-08-13 09:14:49 +02:00
|
|
|
BOARDS := $(filter-out $(BOARDS_WITH_MISSING_FEATURES) \
|
|
|
|
$(BOARDS_WITH_BLACKLISTED_FEATURES) \
|
|
|
|
$(BOARDS_WITH_CONFLICTING_FEATURES), $(BOARDS))
|
2017-09-09 00:06:29 +02:00
|
|
|
|
|
|
|
info-buildsizes: SHELL=bash
|
|
|
|
info-buildsizes:
|
|
|
|
@echo -e " text\t data\t bss\t dec\tboard"; \
|
2018-03-22 16:20:19 +01:00
|
|
|
for board in $(BOARDS); do \
|
2017-09-09 00:06:29 +02:00
|
|
|
echo "$$(BOARD=$${board} $(MAKE) --no-print-directory info-buildsize 2>/dev/null | tail -n-1 | cut -f-4)" "$${board}"; \
|
|
|
|
done;
|
|
|
|
|
|
|
|
info-buildsizes-diff: SHELL=bash
|
|
|
|
info-buildsizes-diff:
|
|
|
|
@echo -e "text\tdata\tbss\tdec\tBOARD/BINDIRBASE\n"; \
|
2018-03-22 16:20:19 +01:00
|
|
|
for board in $(BOARDS); do \
|
2017-09-09 00:06:29 +02:00
|
|
|
for BINDIRBASE in $${OLDBIN} $${NEWBIN}; do \
|
2017-10-23 23:02:07 +02:00
|
|
|
BINDIRBASE=$${BINDIRBASE} BOARD=$${board} $(MAKE) info-buildsize --no-print-directory 2>/dev/null | tail -n-1 | cut -f-4; \
|
2017-09-09 00:06:29 +02:00
|
|
|
done | \
|
|
|
|
while read -a OLD && read -a NEW; do \
|
|
|
|
for I in 0 1 2 3; do \
|
|
|
|
if [[ -n "$${NEW[I]}" && -n "$${OLD[I]}" ]]; then \
|
|
|
|
DIFF=$$(($${NEW[I]} - $${OLD[I]})); \
|
2018-03-22 16:20:19 +01:00
|
|
|
if [[ "$${DIFF}" -gt 0 ]]; then $(COLOR_ECHO) -n "$(COLOR_RED)"; fi; \
|
|
|
|
if [[ "$${DIFF}" -lt 0 ]]; then $(COLOR_ECHO) -n "$(COLOR_GREEN)"; fi; \
|
2017-09-09 00:06:29 +02:00
|
|
|
else \
|
2018-03-22 16:20:19 +01:00
|
|
|
DIFF="$(COLOR_RED)ERR"; \
|
2017-09-09 00:06:29 +02:00
|
|
|
fi; \
|
2018-03-22 16:20:19 +01:00
|
|
|
echo -ne "$${DIFF}\t$(COLOR_RESET)"; \
|
2017-09-09 00:06:29 +02:00
|
|
|
done; \
|
|
|
|
echo "$${board}"; \
|
2018-03-22 16:20:19 +01:00
|
|
|
for I in 0 1 2 3; do echo -ne "$${OLD[I]-$(COLOR_RED)ERR$(COLOR_RESET)}\t"; done; echo -e "$${OLDBIN}"; \
|
|
|
|
for I in 0 1 2 3; do echo -ne "$${NEW[I]-$(COLOR_RED)ERR$(COLOR_RESET)}\t"; done; echo -e "$${NEWBIN}\n"; \
|
2017-09-09 00:06:29 +02:00
|
|
|
done; \
|
|
|
|
done;
|
|
|
|
|
|
|
|
info-boards-supported:
|
|
|
|
@echo $(BOARDS)
|
|
|
|
|
|
|
|
info-boards-features-missing:
|
|
|
|
@for f in $(BOARDS_FEATURES_MISSING); do echo $${f}; done | column -t
|
2020-01-24 18:08:59 +01:00
|
|
|
|
2020-05-25 09:38:27 +02:00
|
|
|
info-boards-features-blacklisted:
|
|
|
|
@for f in $(BOARDS_FEATURES_USED_BLACKLISTED); do echo $${f}; done | column -t
|
|
|
|
|
2020-08-13 09:14:49 +02:00
|
|
|
info-boards-features-conflicting:
|
|
|
|
@for f in $(BOARDS_FEATURES_CONFLICTING); do echo $${f}; done | column -t
|
|
|
|
|
2023-02-04 11:52:15 +01:00
|
|
|
generate-Makefile.ci:
|
2023-02-04 16:53:49 +01:00
|
|
|
@$(RIOTTOOLS)/insufficient_memory/create_makefile.ci.sh
|
2021-02-28 23:42:58 +01:00
|
|
|
|
2023-02-04 11:52:15 +01:00
|
|
|
|
2020-01-24 18:08:59 +01:00
|
|
|
# Reset BOARDSDIR so unchanged for makefiles included after, for now only
|
|
|
|
# needed for buildtests.inc.mk
|
2020-04-14 15:23:23 +02:00
|
|
|
BOARDDIR := $(BOARDDIR_GLOBAL)
|