-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_mbed.ps1
44 lines (35 loc) · 979 Bytes
/
build_mbed.ps1
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
# Make sure current folder is like this:
# cd mbed-cmake-example-project
# Usage:
# ../build_mbed.ps1 : To build for Arduino Nano 33
# ../build_mbed.ps1 -nucleo : To build for STM32F411 Nucleo
# ../build_mbed.ps1 -quick : To quickly resume `make` from last build
Param(
[Parameter(Mandatory=$false)]
[Switch]
$quick,
[Parameter(Mandatory=$false)]
[Switch]
$nucleo
)
if ($quick) {
cd build
C:\MinGW\bin\mingw32-make -j4 wamr_native_app
}
else {
rm -r build
rm -r mbed-cmake/mbed-src/build
mkdir build
cd build
if ($nucleo) {
python ../mbed-cmake/configure_for_target.py NUCLEO_F411RE
} else {
python ../mbed-cmake/configure_for_target.py ARDUINO_NANO33BLE
}
cmake -G "MinGW Makefiles" ../mini-product
if ($LastExitCode -eq 0) {
Write-Host "Running minGW make. Last command succeeded"
C:\MinGW\bin\mingw32-make -j4 wamr_native_app
}
}
cd ..