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:
commit
71d1eb2cd4
18
dist/tools/insufficient_memory/Makefile.for_sh
vendored
Normal file
18
dist/tools/insufficient_memory/Makefile.for_sh
vendored
Normal 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
|
9
dist/tools/insufficient_memory/README.md
vendored
Normal file
9
dist/tools/insufficient_memory/README.md
vendored
Normal 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.
|
29
dist/tools/insufficient_memory/add_insufficient_memory_board.sh
vendored
Executable file
29
dist/tools/insufficient_memory/add_insufficient_memory_board.sh
vendored
Executable 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
|
Loading…
Reference in New Issue
Block a user