-
Notifications
You must be signed in to change notification settings - Fork 9
/
esp32-cmake.sh
executable file
·35 lines (27 loc) · 1.06 KB
/
esp32-cmake.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
#!/bin/bash
export BUILD_DIR="${BUILD_DIR:=$(~/)}"
echo "--- CLONING ULAB ---"
cd $BUILD_DIR
git clone --depth 1 https://github.com/v923z/micropython-ulab.git ulab
echo "--- CLONING MICROPYTHON ---"
git clone --depth 1 https://github.com/micropython/micropython.git
echo "--- CLONING ESP-IDF ---"
cd $BUILD_DIR/micropython/
git clone --depth 1 -b v4.0.2 --recursive https://github.com/espressif/esp-idf.git
echo "--- INSTALL ESP-IDF ---"
cd $BUILD_DIR/micropython/esp-idf
./install.sh
. ./export.sh
echo "--- MPY-CROSS ---"
cd $BUILD_DIR/micropython/mpy-cross
make
echo "--- ESP32 SUBMODULES ---"
cd $BUILD_DIR/micropython/ports/esp32
make submodules
echo "--- PATCH MAKEFILE ---"
cp $BUILD_DIR/micropython/ports/esp32/MakeFile $BUILD_DIR/micropython/ports/esp32/MakeFileOld
echo "BOARD = GENERIC" > $BUILD_DIR/micropython/ports/esp32/MakeFile
echo "USER_C_MODULES = \$(BUILD_DIR)/ulab/code/micropython.cmake" >> $BUILD_DIR/micropython/ports/esp32/MakeFile
cat $BUILD_DIR/micropython/ports/esp32/MakeFileOld >> $BUILD_DIR/micropython/ports/esp32/MakeFile
echo "--- MAKE ---"
make