-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·44 lines (40 loc) · 962 Bytes
/
build.sh
File metadata and controls
executable file
·44 lines (40 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
# Build the given board out-of-tree
# ./build.sh BOARD=PYBV11 V=1 ...
# ./build.sh BOARD=NUCLEO_H743ZI2 V=1 ...
# useful make flags:
# DEBUG=1
# V=1
#
# Directories
: ${BOARD:="PYBV11"}
: ${TOP:=`pwd`}
: ${MPY_DIR:="$TOP/../micropython"}
: ${BOARDS_DIR:="$TOP/boards"}
: ${C_EXTENSION_DIR:="$TOP/c_extension"}
: ${BUILD_DIR:="$TOP/build-$BOARD"}
: ${PORTS_DIR:="$MPY_DIR/ports/stm32"}
: ${BOARD_DIR:="$BOARDS_DIR/$BOARD"}
if [ ! -d "$BOARD_DIR" ]; then
echo "Board directory $BOARD_DIR does not exist"
exit 1
fi
if [ ! -d "$MPY_DIR" ]; then
echo "Micropython directory $MPY_DIR does not exist"
exit 1
fi
echo TOP=$TOP
echo MICROPYTHON_DIR=$MICROPYTHON_DIR
echo BOARDS_DIR=$BOARDS_DIR
echo BOARD_DIR=$BOARD_DIR
echo C_EXTENSION_DIR=$C_EXTENSION_DIR
echo BUILD_DIR=$BUILD_DIR
echo PORTS_DIR=$PORTS_DIR
set -x
cd ${PORTS_DIR} && \
make \
BOARD=${BOARD} \
BUILD=${BUILD_DIR} \
BOARD_DIR=${BOARD_DIR} \
USER_C_MODULES=${C_EXTENSION_DIR} \
"$@"