-
Notifications
You must be signed in to change notification settings - Fork 181
/
Copy pathbuild.sh
executable file
·45 lines (34 loc) · 1 KB
/
build.sh
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
45
#!/bin/bash
if ! [ -x "$(command -v python)" ]; then
echo "ERROR: python is not installed! Please install python first."
exit 1
fi
if ! [ -x "$(command -v git)" ]; then
echo "ERROR: git is not installed! Please install git first."
exit 1
fi
mkdir -p dist
# update components from git
./tools/update-components.sh
if [ $? -ne 0 ]; then exit 1; fi
# install esp-idf and gcc toolchain
source ./tools/install-esp-idf.sh
if [ $? -ne 0 ]; then exit 1; fi
if [ -z $TARGETS ]; then
TARGETS="esp32c3 esp32s2 esp32"
fi
echo $(git -C $AR_COMPS/arduino describe --all --long) > version.txt
rm -rf out build sdkconfig sdkconfig.old
for target in $TARGETS; do
rm -rf build sdkconfig sdkconfig.old
# build and prepare libs
idf.py -DIDF_TARGET=${target} -DSDKCONFIG=build/sdkconfig build
if [ $? -ne 0 ]; then exit 1; fi
# build bootloaders
./tools/build-bootloaders.sh
if [ $? -ne 0 ]; then exit 1; fi
done
# archive the build
./tools/archive-build.sh
if [ $? -ne 0 ]; then exit 1; fi
#./tools/copy-to-arduino.sh