2017-09-09 00:06:29 +02:00
|
|
|
.PHONY: info-buildsizes info-buildsizes-diff info-features-missing \
|
|
|
|
info-boards-features-missing
|
|
|
|
|
|
|
|
USEMODULE_GLOBAL := $(USEMODULE)
|
|
|
|
USEPKG_GLOBAL := $(USEPKG)
|
|
|
|
FEATURES_REQUIRED_GLOBAL := $(FEATURES_REQUIRED)
|
|
|
|
FEATURES_OPTIONAL_GLOBAL := $(FEATURES_OPTIONAL)
|
2019-08-14 17:35:08 +02:00
|
|
|
DISABLE_MODULE_GLOBAL := $(DISABLE_MODULE)
|
2017-09-09 00:06:29 +02:00
|
|
|
|
|
|
|
define board_missing_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)
|
|
|
|
FEATURES_REQUIRED := $(FEATURES_REQUIRED_GLOBAL)
|
|
|
|
FEATURES_OPTIONAL := $(FEATURES_OPTIONAL_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 :=
|
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-05-02 16:47:08 +02:00
|
|
|
include $(RIOTBASE)/Makefile.features
|
|
|
|
|
2017-09-09 00:06:29 +02:00
|
|
|
include $(RIOTBASE)/Makefile.dep
|
|
|
|
|
2019-05-03 16:19:20 +02:00
|
|
|
ifneq (,$$(FEATURES_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)
|
2017-09-09 00:06:29 +02:00
|
|
|
endif
|
|
|
|
endef
|
|
|
|
|
|
|
|
BOARDS := $(filter $(if $(BOARD_WHITELIST), $(BOARD_WHITELIST), %), $(BOARDS))
|
|
|
|
BOARDS := $(filter-out $(BOARD_BLACKLIST), $(BOARDS))
|
|
|
|
|
|
|
|
BOARDS_WITH_MISSING_FEATURES :=
|
|
|
|
BOARDS_FEATURES_MISSING :=
|
|
|
|
$(foreach BOARD, $(BOARDS), $(eval $(call board_missing_features,$(BOARD))))
|
|
|
|
BOARDS := $(filter-out $(BOARDS_WITH_MISSING_FEATURES), $(BOARDS))
|
|
|
|
|
|
|
|
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
|