|
@@ -0,0 +1,42 @@
|
|
|
+# Usage:
|
|
|
+#
|
|
|
+# confirm target sketch...
|
|
|
+#
|
|
|
+# Builds sketch for target
|
|
|
+# Target can be: uno, due, d1
|
|
|
+#
|
|
|
+# Uses the Arduino command line interface
|
|
|
+#
|
|
|
+# https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc
|
|
|
+
|
|
|
+set -e
|
|
|
+
|
|
|
+TARGET=$1; shift
|
|
|
+cp ~/.arduino15/preferences.txt-$TARGET ~/.arduino15/preferences.txt
|
|
|
+
|
|
|
+for F in $*
|
|
|
+do
|
|
|
+ echo
|
|
|
+ echo ${F}:
|
|
|
+
|
|
|
+ rm -rf w
|
|
|
+ mkdir -p w
|
|
|
+
|
|
|
+ cp $F.ino w/
|
|
|
+ if [ "$TARGET" = "due" ]
|
|
|
+ then
|
|
|
+ sed -i '/EEPROM/d' w/$F.ino
|
|
|
+ fi
|
|
|
+ for A in converted-assets/${F}*_assets.h
|
|
|
+ do
|
|
|
+ [ -f $A ] && cp $A w/
|
|
|
+ done
|
|
|
+ cd w/
|
|
|
+
|
|
|
+ # --preserve-temp-files
|
|
|
+ # -v
|
|
|
+ # --upload
|
|
|
+
|
|
|
+ $HOME/arduino-1.8.3/arduino --verify $F.ino
|
|
|
+ cd ..
|
|
|
+done
|