2017-09-09 00:06:29 +02:00
|
|
|
.PHONY: info-buildsizes info-buildsizes-diff info-features-missing \
|
|
|
|
info-boards-features-missing
|
|
|
|
|
2020-03-19 14:06:47 +01:00
|
|
|
# Perform dependency resolution without having included
|
|
|
|
# $(RIOTBASE)/Makefile.features for now. This results in no optional modules and
|
|
|
|
# no architecture specific handling being done. The result will be a subset of
|
|
|
|
# used modules and requirements that is present in for *all* boards, so this can
|
|
|
|
# be cached to speed up individual dependency checks
|
|
|
|
include $(RIOTMAKE)/defaultmodules.inc.mk
|
|
|
|
# add default modules
|
|
|
|
USEMODULE += $(filter-out $(DISABLE_MODULE),$(DEFAULT_MODULE))
|
|
|
|
include $(RIOTMAKE)/dependency_resolution.inc.mk
|
|
|
|
|
2019-12-14 23:17:04 +01:00
|
|
|
BOARDSDIR_GLOBAL := $(BOARDSDIR)
|
2017-09-09 00:06:29 +02:00
|
|
|
USEMODULE_GLOBAL := $(USEMODULE)
|
|
|
|
USEPKG_GLOBAL := $(USEPKG)
|
|
|
|
FEATURES_REQUIRED_GLOBAL := $(FEATURES_REQUIRED)
|
|
|
|
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)
|
2019-12-14 23:17:04 +01:00
|
|
|
BOARDSDIR := $(BOARDSDIR_GLOBAL)
|
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)
|
|
|
|
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
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2019-12-14 23:17:04 +01:00
|
|
|
# Replicate Makefile.include handling that sets BOARDSDIR to RIOTBOARD
|
|
|
|
# when BOARD is not found in BOARDSDIR
|
|
|
|
ifeq (,$(wildcard $(BOARDSDIR_GLOBAL)/$(BOARD)/.))
|
|
|
|
BOARDSDIR = $(RIOTBOARD)
|
|
|
|
endif
|
|
|
|
|
2019-05-02 16:47:08 +02:00
|
|
|
include $(RIOTBASE)/Makefile.features
|
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
|
2018-03-22 16:20:19 +01:00
|
|
|
BOARDS_FEATURES_MISSING += "$(1) $$(FEATURES_MISSING)"
|
2019-05-03 16:14:49 +02:00
|
|
|
BOARDS_WITH_MISSING_FEATURES += $(1)
|
2020-03-19 14:06:47 +01:00
|
|
|
else
|
|
|
|
include $(RIOTMAKE)/dependency_resolution.inc.mk
|
|
|
|
|
|
|
|
ifneq (,$$(FEATURES_MISSING))
|
|
|
|
BOARDS_FEATURES_MISSING += "$(1) $$(FEATURES_MISSING)"
|
|
|
|
BOARDS_WITH_MISSING_FEATURES += $(1)
|
|
|
|
endif
|
2019-08-13 16:02:38 +02:00
|
|
|
|
2020-03-19 14:06:47 +01:00
|
|
|
ifneq (,$$(FEATURES_USED_BLACKLISTED))
|
|
|
|
BOARDS_FEATURES_USED_BLACKLISTED += "$(1) $$(FEATURES_USED_BLACKLISTED)"
|
|
|
|
BOARDS_WITH_BLACKLISTED_FEATURES += $(1)
|
|
|
|
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 :=
|
|
|
|
|
|
|
|
$(foreach BOARD, $(BOARDS), $(eval $(call board_unsatisfied_features,$(BOARD))))
|
|
|
|
BOARDS := $(filter-out $(BOARDS_WITH_MISSING_FEATURES) $(BOARDS_WITH_BLACKLISTED_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
|
|
|
|
|
|
|
# Reset BOARDSDIR so unchanged for makefiles included after, for now only
|
|
|
|
# needed for buildtests.inc.mk
|
|
|
|
BOARDSDIR := $(BOARDSDIR_GLOBAL)
|