mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-31 01:11:21 +01:00
buildsystem: remove info-buildsizes, fix info-buildsizes-diff
This commit is contained in:
parent
90ea940896
commit
612401b145
@ -232,7 +232,7 @@ GLOBAL_GOALS += info-boards-features-blacklisted \
|
||||
info-boards-features-conflicting \
|
||||
info-boards-features-missing \
|
||||
info-boards-supported \
|
||||
info-buildsizes info-buildsizes-diff \
|
||||
info-buildsizes-diff \
|
||||
generate-Makefile.ci \
|
||||
#
|
||||
|
||||
|
||||
2
dist/tools/zsh-completion/zsh-riot.sh
vendored
2
dist/tools/zsh-completion/zsh-riot.sh
vendored
@ -93,7 +93,7 @@ function _riot {
|
||||
"info-build:show details to debug the build"
|
||||
"info-build-json:show details of the build as JSON"
|
||||
"info-buildsize:print the size of the firmware for the given board"
|
||||
"info-buildsizes:print the size of the firmware for every supported board"
|
||||
"info-buildsizes-diff:compare the size of two firmware builds for two given directories"
|
||||
"info-cpu:print the CPU family for the given board"
|
||||
"info-features-missing:list features missing by the given baord in regard to the given app"
|
||||
"info-features-provided:list features provided by the given board"
|
||||
|
||||
@ -177,21 +177,24 @@ multiple git work trees or clones of the RIOT repository.
|
||||
|
||||
Comparing Build Sizes {#comparing-build-sizes}
|
||||
=====================
|
||||
There is a make target for build size comparison. You can use it like that:
|
||||
There is a make target for build size comparison. It will automatically check
|
||||
all the boards compiled in the `NEWBIN` and `OLDBIN` and compare them.
|
||||
For boards that do not have a complementary partner, a warning is generated.
|
||||
You can use it like that:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
$ cd RIOT/test/test_something
|
||||
|
||||
$ git checkout master
|
||||
$ BINDIRBASE=master-bin make buildtest
|
||||
$ BINDIRBASE=master-bin BOARD=native64 make all
|
||||
|
||||
$ git checkout my-branch
|
||||
$ BINDIRBASE=my-branch-bin make buildtest
|
||||
$ BINDIRBASE=my-branch-bin BOARD=native64 make all
|
||||
|
||||
$ OLDBIN=master-bin NEWBIN=my-branch-bin make info-buildsizes-diff
|
||||
text data bss dec BOARD/BINDIRBASE
|
||||
|
||||
0 0 0 0 avsextrem **← this line contains the diff**
|
||||
0 0 0 0 native64 **← this line contains the diff**
|
||||
57356 1532 96769 155657 master-bin
|
||||
57356 1532 96769 155657 my-branch-bin
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
.PHONY: info-buildsizes \
|
||||
info-buildsizes-diff \
|
||||
.PHONY: info-buildsizes-diff \
|
||||
info-boards-supported \
|
||||
info-boards-features-missing \
|
||||
info-boards-features-blacklisted \
|
||||
@ -108,25 +107,29 @@ BOARDS := $(filter-out $(BOARDS_WITH_MISSING_FEATURES) \
|
||||
$(BOARDS_WITH_BLACKLISTED_FEATURES) \
|
||||
$(BOARDS_WITH_CONFLICTING_FEATURES), $(BOARDS))
|
||||
|
||||
info-buildsizes: SHELL=bash
|
||||
info-buildsizes:
|
||||
@echo -e " text\t data\t bss\t dec\tboard"; \
|
||||
for board in $(BOARDS); do \
|
||||
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"; \
|
||||
COMMON_BOARDS=(); ONLY_OLD=(); ONLY_NEW=(); \
|
||||
for board in $(BOARDS); do \
|
||||
if [[ -e "$${OLDBIN}/$${board}" && -e "$${NEWBIN}/$${board}" ]]; then \
|
||||
COMMON_BOARDS+=($${board}); \
|
||||
elif [[ -e "$${OLDBIN}/$${board}" ]]; then \
|
||||
ONLY_OLD+=($${board}); \
|
||||
elif [[ -e "$${NEWBIN}/$${board}" ]]; then \
|
||||
ONLY_NEW+=($${board}); \
|
||||
fi; \
|
||||
done; \
|
||||
for board in "$${COMMON_BOARDS[@]}"; do \
|
||||
for BINDIRBASE in $${OLDBIN} $${NEWBIN}; do \
|
||||
BINDIRBASE=$${BINDIRBASE} BOARD=$${board} $(MAKE) info-buildsize --no-print-directory 2>/dev/null | tail -n-1 | cut -f-4; \
|
||||
env --unset=MAKEFLAGS BINDIRBASE=$${BINDIRBASE} BOARD=$${board} $(MAKE) info-buildsize --no-print-directory 2>/dev/null | tail -n-1 | cut -f-4; \
|
||||
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]})); \
|
||||
if [[ "$${DIFF}" -gt 0 ]]; then $(COLOR_ECHO) -n "$(COLOR_RED)"; fi; \
|
||||
if [[ "$${DIFF}" -eq 0 ]]; then $(COLOR_ECHO) -n "$(COLOR_YELLOW)"; fi; \
|
||||
if [[ "$${DIFF}" -lt 0 ]]; then $(COLOR_ECHO) -n "$(COLOR_GREEN)"; fi; \
|
||||
else \
|
||||
DIFF="$(COLOR_RED)ERR"; \
|
||||
@ -137,7 +140,13 @@ info-buildsizes-diff:
|
||||
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"; \
|
||||
done; \
|
||||
done;
|
||||
done; \
|
||||
if [[ "$${#ONLY_OLD[@]}" -gt 0 ]]; then \
|
||||
$(COLOR_ECHO) "$(COLOR_YELLOW)Boards in OLDBIN without complementary NEWBIN: $${ONLY_OLD[*]}$(COLOR_RESET)"; \
|
||||
fi; \
|
||||
if [[ "$${#ONLY_NEW[@]}" -gt 0 ]]; then \
|
||||
$(COLOR_ECHO) "$(COLOR_YELLOW)Boards in NEWBIN without complementary OLDBIN: $${ONLY_NEW[*]}$(COLOR_RESET)"; \
|
||||
fi;
|
||||
|
||||
info-boards-supported:
|
||||
@echo $(BOARDS)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
.PHONY: info-objsize info-buildsizes info-build info-boards-supported \
|
||||
.PHONY: info-objsize info-buildsize info-build info-boards-supported \
|
||||
info-features-missing info-modules info-cpu \
|
||||
info-features-provided info-features-required \
|
||||
info-features-used info-kconfig-variables \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user