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

Merge pull request #12485 from benpicco/make-add_insufficient_memory

tools: add add_insufficient_memory_board.sh
This commit is contained in:
benpicco 2019-11-13 14:31:47 +01:00 committed by GitHub
commit 71d1eb2cd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,18 @@
-include $(DIR)/Makefile.ci
define create_Makefile.ci
@echo "BOARD_INSUFFICIENT_MEMORY := \\" > $(1)
@for b in $(sort $(BOARD_INSUFFICIENT_MEMORY)); do echo " $$b \\" >> $(1); done
@echo " #" >> $(1)
endef
BOARD_INSUFFICIENT_MEMORY += $(BOARD)
.PHONY: Makefile.ci
ifeq ($(BOARD_INSUFFICIENT_MEMORY),)
Makefile.ci:
@echo "skipping empty Makefile.ci"
else
Makefile.ci:
$(call create_Makefile.ci, $(DIR)/Makefile.ci)
endif

View File

@ -0,0 +1,9 @@
add_insufficient_memory_board.sh
------------------
Usage: `add_insufficient_memory_board.sh <board_name>`
Updates `Makefile.ci` to include `<board_name>` if the memory of the board is not sufficient for the test/example.
For this the script will build every test and example to see if the result would fit into the memory of the specified
board. If not the corresponding `Makefile.ci` is updated automatically.

View File

@ -0,0 +1,29 @@
#!/bin/bash
#
# Copyright (C) 2019 Benjamin Valentin <benjamin.valentin@ml-pa.com>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
if [ -z $1 ]; then
echo "usage: $0 <board>"
exit 1
fi
BOARD=$1
RIOTBASE=$(dirname $0)/../../..
PROJECTS+=$RIOTBASE/examples/*/Makefile
PROJECTS+=" "
PROJECTS+=$RIOTBASE/tests/*/Makefile
for i in $PROJECTS; do
test=$(dirname $(realpath $i));
if make BOARD=$BOARD -j -C $test 2>&1 >/dev/null | grep -e overflowed -e "not within region" > /dev/null; then
echo $(basename $test) is too big for $BOARD
make -f Makefile.for_sh -C $(dirname $0) DIR=$test BOARD=$BOARD Makefile.ci > /dev/null
else
echo $(basename $test) is OK
fi
done