-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·48 lines (44 loc) · 2.76 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
46
#!/bin/bash
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
export C_INCLUDE_PATH=/opt/st/stm32cubeide_1.13.1/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.linux64_1.1.0.202305231506/tools/arm-none-eabi/include
export PATH="$PATH:/opt/st/stm32cubeide_1.13.1/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.linux64_1.1.0.202305231506/tools/bin" # /arm-none-eabi-gcc
if [[ $1 == "clean" ]]; then
echo "Cleaning";
make -j8 clean -C ./Debug;
make -j8 clean -C ./Release;
rm -rf compile_commands.json;
elif [[ $1 == "release" ]]; then
echo "Building release";
rm -rf compile_commands.json;
make -j8 clean -C ./Release;
bear -- make -j8 all -C ./Release;
/opt/st/stm32cubeide_1.13.1/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.linux64_2.1.0.202305091550/tools/bin/STM32_Programmer_CLI -c port=swd -w ./Release/CHIP-8-STM32.elf -rst;
elif [[ $1 == "debug" ]]; then
echo "Building debug";
rm -rf compile_commands.json;
make -j8 clean -C ./Debug;
bear -- make -j8 all -C ./Debug;
/opt/st/stm32cubeide_1.13.1/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.linux64_2.1.0.202305091550/tools/bin/STM32_Programmer_CLI -c port=swd -w ./Debug/CHIP-8-STM32.elf -rst;
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
export C_INCLUDE_PATH="/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.macos64_1.1.0.202305231506/tools/arm-none-eabi/include"
export PATH="$PATH:/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.macos64_1.1.0.202305231506/tools/bin" # /arm-none-eabi-gcc
if [[ $1 == "clean" ]]; then
echo "Cleaning";
make -j8 clean -C ./Debug;
make -j8 clean -C ./Release;
rm -rf compile_commands.json;
elif [[ $1 == "release" ]]; then
echo "Building release";
rm -rf compile_commands.json;
make -j8 clean -C ./Release;
bear -- make -j8 all -C ./Release;
/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.macos64_2.1.0.202305091550/tools/bin/STM32_Programmer_CLI -c port=swd -w ./Release/CHIP-8-STM32.elf -rst;
elif [[ $1 == "debug" ]]; then
echo "Building debug";
rm -rf compile_commands.json;
make -j8 clean -C ./Debug;
bear -- make -j8 all -C ./Debug;
/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.macos64_2.1.0.202305091550/tools/bin/STM32_Programmer_CLI -c port=swd -w ./Debug/CHIP-8-STM32.elf -rst;
fi
fi