forked from prusa3d/Original-Prusa-i3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
37 lines (28 loc) · 1.15 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
#!/bin/sh
clear
echo " Prusa Research epic build script for Firmware \n"
rm -r -f /home/arduino/Prusa-i3-Plus/Firmware/hex_files/*
for entry in "/home/arduino/Prusa-i3-Plus/Firmware/variants"/*
do
#entry="/home/arduino/Firmware/variants/175-2a-cz.h"
filename="${entry##*/}"
extension="ex"
log=".log"
echo "--------------------------------------"
echo " Building for:"
echo $entry | sed 's/.*\///'
echo "\n"
echo "Removing config from firmware"
rm -f /home/arduino/Prusa-i3-Plus/Firmware/Configuration_prusa.h
echo "Moving new config"
cp $entry /home/arduino/Prusa-i3-Plus/Firmware/Configuration_prusa.h
echo "Cleaning up output folder"
rm -r -f /home/arduino/output/*
rm -r -f /home/arduino/logs/*
echo "Compiling ..."
sh /home/arduino/arduino-1.6.0/arduino-cli --pref build.path=/home/arduino/output/ --verify --board marlin:avr:rambo /home/arduino/Prusa-i3-Plus/Firmware/Firmware.ino >> /home/arduino/logs/$filename$extension
echo "Moving hex file"
cp /home/arduino/output/Firmware.cpp.hex /home/arduino/Prusa-i3-Plus/Firmware/hex_files/$filename$extension
echo "Done"
done
rm -f /home/arduino/Prusa-i3-Plus/Firmware/Configuration_prusa.h