From cc397f82a60bdada149769f88881895eca1d9302 Mon Sep 17 00:00:00 2001 From: Mar Date: Sun, 4 Oct 2015 19:36:06 +0100 Subject: [PATCH 1/5] Arduino makefile on watch dir --- watch/Makefile | 146 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 watch/Makefile diff --git a/watch/Makefile b/watch/Makefile new file mode 100644 index 0000000..09ed193 --- /dev/null +++ b/watch/Makefile @@ -0,0 +1,146 @@ +# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile + +# Reference for variables: https://github.com/sudar/Arduino-Makefile/blob/master/arduino-mk-vars.md#arduino-ide-variables + +# Installation dirs +ARDUINO_DIR= /home/marbu/bins/arduino-1.6.5-r5_watchduino2 +#PROJECT_DIR = watch +ARDUINO_PREFERENCES_PATH = /home/marbu/bins/arduino-1.6.5-r5_watchduino2/lib/preferences.txt +ARDMK_DIR = /home/marbu/bins/Arduino-Makefile + + +# Compilartion opts +BOARD_TAG = pro +BOARD_SUB = 8MHzatmega328 +MONITOR_PORT = /dev/ttyUSB0 +ARCHITECTURE = avr +ARDUINO_LIBS = Time U8glib SPI SoftwareSerial Wire jeelib_master + + +include $(ARDMK_DIR)/Arduino.mk + + +# --- leonardo (or pro micro w/leo bootloader) +#BOARD_TAG = leonardo +#MONITOR_PORT = /dev/ttyACM0 +#include /usr/share/arduino/Arduino.mk + +# --- mega2560 ide 1.0 +#BOARD_TAG = mega2560 +#ARDUINO_PORT = /dev/ttyACM0 +#include /usr/share/arduino/Arduino.mk + +# --- mega2560 ide 1.6 +#BOARD_TAG = mega +#BOARD_SUB = atmega2560 +#MONITOR_PORT = /dev/ttyACM0 +#ARDUINO_DIR = /where/you/installed/arduino-1.6.5 +#include /usr/share/arduino/Arduino.mk + +# --- nano ide 1.0 +#BOARD_TAG = nano328 +#MONITOR_PORT = /dev/ttyUSB0 +#include /usr/share/arduino/Arduino.mk + +# --- nano ide 1.6 +#BOARD_TAG = nano +#BOARD_SUB = atmega328 +#ARDUINO_DIR = /where/you/installed/arduino-1.6.5 +#include /usr/share/arduino/Arduino.mk + +# --- pro mini +#BOARD_TAG = pro5v328 +#MONITOR_PORT = /dev/ttyUSB0 +#include /usr/share/arduino/Arduino.mk + +# --- sparkfun pro micro +#BOARD_TAG = promicro16 +#ALTERNATE_CORE = promicro +#BOARDS_TXT = $(HOME)/arduino/hardware/promicro/boards.txt +#BOOTLOADER_PARENT = $(HOME)/arduino/hardware/promicro/bootloaders +#BOOTLOADER_PATH = caterina +#BOOTLOADER_FILE = Caterina-promicro16.hex +#ISP_PROG = usbasp +#AVRDUDE_OPTS = -v +#include /usr/share/arduino/Arduino.mk + +# --- chipkit +#BOARD_TAG = mega_pic32 +#MPIDE_DIR = /where/you/installed/mpide-0023-linux64-20130817-test +#include /usr/share/arduino/chipKIT.mk + +# --- pinoccio +#BOARD_TAG = pinoccio256 +#ALTERNATE_CORE = pinoccio +#BOOTLOADER_PARENT = $(HOME)/arduino/hardware/pinoccio/bootloaders +#BOOTLOADER_PATH = STK500RFR2/release_0.51 +#BOOTLOADER_FILE = boot_pinoccio.hex +#CFLAGS_STD = -std=gnu99 +#CXXFLAGS_STD = -std=gnu++11 +#include /usr/share/arduino/Arduino.mk + +# --- fio +#BOARD_TAG = fio +#include /usr/share/arduino/Arduino.mk + +# --- atmega-ng ide 1.6 +#BOARD_TAG = atmegang +#BOARD_SUB = atmega168 +#MONITOR_PORT = /dev/ttyACM0 +#ARDUINO_DIR = /where/you/installed/arduino-1.6.5 +#include /usr/share/arduino/Arduino.mk + +# --- arduino-tiny ide 1.0 +#ISP_PROG = usbasp +#BOARD_TAG = attiny85at8 +#ALTERNATE_CORE = tiny +#ARDUINO_VAR_PATH = $(HOME)/arduino/hardware/tiny/cores/tiny +#ARDUINO_CORE_PATH = $(HOME)/arduino/hardware/tiny/cores/tiny +#AVRDUDE_OPTS = -v +#include /usr/share/arduino/Arduino.mk + +# --- arduino-tiny ide 1.6 +#ISP_PROG = usbasp +#BOARD_TAG = attiny85at8 +#ALTERNATE_CORE = tiny +#ARDUINO_DIR = /where/you/installed/arduino-1.6.5 +#include /usr/share/arduino/Arduino.mk + +# --- damellis attiny ide 1.0 +#ISP_PROG = usbasp +#BOARD_TAG = attiny85 +#ALTERNATE_CORE = attiny-master +#AVRDUDE_OPTS = -v +#include /usr/share/arduino/Arduino.mk + +# --- damellis attiny ide 1.6 +#ISP_PROG = usbasp +#BOARD_TAG = attiny +#BOARD_SUB = attiny85 +#ALTERNATE_CORE = attiny +#F_CPU = 16000000L +#ARDUINO_DIR = /where/you/installed/arduino-1.6.5 +#include /usr/share/arduino/Arduino.mk + +# --- teensy3 +#BOARD_TAG = teensy31 +#ARDUINO_DIR = /where/you/installed/the/patched/teensy/arduino-1.0.6 +#include /usr/share/arduino/Teensy.mk + +# --- mighty 1284p +#BOARD_TAG = mighty_opt +#BOARDS_TXT = $(HOME)/arduino/hardware/mighty-1284p/boards.txt +#BOOTLOADER_PARENT = $(HOME)/arduino/hardware/mighty-1284p/bootloaders +#BOOTLOADER_PATH = optiboot +#BOOTLOADER_FILE = optiboot_atmega1284p.hex +#ISP_PROG = usbasp +#AVRDUDE_OPTS = -v +#include /usr/share/arduino/Arduino.mk + +# --- atmega328p on breadboard +#BOARD_TAG = atmega328bb +#ISP_PROG = usbasp +#AVRDUDE_OPTS = -v +#BOARDS_TXT = $(HOME)/arduino/hardware/breadboard/boards.txt +#include /usr/share/arduino/Arduino.mk + From 4eaa5b6fb6c70b99f4713cd38d2ae1db1d54dcf8 Mon Sep 17 00:00:00 2001 From: Mar Date: Sun, 4 Oct 2015 19:50:37 +0100 Subject: [PATCH 2/5] Call makefile from root --- watch/Makefile => Makefile | 0 make.sh | 10 ++++++++++ 2 files changed, 10 insertions(+) rename watch/Makefile => Makefile (100%) create mode 100755 make.sh diff --git a/watch/Makefile b/Makefile similarity index 100% rename from watch/Makefile rename to Makefile diff --git a/make.sh b/make.sh new file mode 100755 index 0000000..fa93464 --- /dev/null +++ b/make.sh @@ -0,0 +1,10 @@ + #!/bin/bash + + SRC_DIR=watch + + cp Makefile $SRC_DIR + cd $SRC_DIR + make $1 + rm Makefile + cd .. + From 6567edc76e8617080ed25addd6856d8987a551b7 Mon Sep 17 00:00:00 2001 From: Mar Date: Sun, 4 Oct 2015 20:46:25 +0100 Subject: [PATCH 3/5] Custom build dir --- .gitignore | 2 + Makefile | 131 +---------------------------------------------------- 2 files changed, 4 insertions(+), 129 deletions(-) diff --git a/.gitignore b/.gitignore index 46a9cff..8409514 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .directory *.kate-swp Thumbs.db +build + diff --git a/Makefile b/Makefile index 09ed193..58e656b 100644 --- a/Makefile +++ b/Makefile @@ -4,143 +4,16 @@ # Installation dirs ARDUINO_DIR= /home/marbu/bins/arduino-1.6.5-r5_watchduino2 -#PROJECT_DIR = watch ARDUINO_PREFERENCES_PATH = /home/marbu/bins/arduino-1.6.5-r5_watchduino2/lib/preferences.txt ARDMK_DIR = /home/marbu/bins/Arduino-Makefile - -# Compilartion opts +# Compilation opts BOARD_TAG = pro BOARD_SUB = 8MHzatmega328 MONITOR_PORT = /dev/ttyUSB0 ARCHITECTURE = avr ARDUINO_LIBS = Time U8glib SPI SoftwareSerial Wire jeelib_master - +OBJDIR = ../build/build-$(BOARD_TAG) include $(ARDMK_DIR)/Arduino.mk - -# --- leonardo (or pro micro w/leo bootloader) -#BOARD_TAG = leonardo -#MONITOR_PORT = /dev/ttyACM0 -#include /usr/share/arduino/Arduino.mk - -# --- mega2560 ide 1.0 -#BOARD_TAG = mega2560 -#ARDUINO_PORT = /dev/ttyACM0 -#include /usr/share/arduino/Arduino.mk - -# --- mega2560 ide 1.6 -#BOARD_TAG = mega -#BOARD_SUB = atmega2560 -#MONITOR_PORT = /dev/ttyACM0 -#ARDUINO_DIR = /where/you/installed/arduino-1.6.5 -#include /usr/share/arduino/Arduino.mk - -# --- nano ide 1.0 -#BOARD_TAG = nano328 -#MONITOR_PORT = /dev/ttyUSB0 -#include /usr/share/arduino/Arduino.mk - -# --- nano ide 1.6 -#BOARD_TAG = nano -#BOARD_SUB = atmega328 -#ARDUINO_DIR = /where/you/installed/arduino-1.6.5 -#include /usr/share/arduino/Arduino.mk - -# --- pro mini -#BOARD_TAG = pro5v328 -#MONITOR_PORT = /dev/ttyUSB0 -#include /usr/share/arduino/Arduino.mk - -# --- sparkfun pro micro -#BOARD_TAG = promicro16 -#ALTERNATE_CORE = promicro -#BOARDS_TXT = $(HOME)/arduino/hardware/promicro/boards.txt -#BOOTLOADER_PARENT = $(HOME)/arduino/hardware/promicro/bootloaders -#BOOTLOADER_PATH = caterina -#BOOTLOADER_FILE = Caterina-promicro16.hex -#ISP_PROG = usbasp -#AVRDUDE_OPTS = -v -#include /usr/share/arduino/Arduino.mk - -# --- chipkit -#BOARD_TAG = mega_pic32 -#MPIDE_DIR = /where/you/installed/mpide-0023-linux64-20130817-test -#include /usr/share/arduino/chipKIT.mk - -# --- pinoccio -#BOARD_TAG = pinoccio256 -#ALTERNATE_CORE = pinoccio -#BOOTLOADER_PARENT = $(HOME)/arduino/hardware/pinoccio/bootloaders -#BOOTLOADER_PATH = STK500RFR2/release_0.51 -#BOOTLOADER_FILE = boot_pinoccio.hex -#CFLAGS_STD = -std=gnu99 -#CXXFLAGS_STD = -std=gnu++11 -#include /usr/share/arduino/Arduino.mk - -# --- fio -#BOARD_TAG = fio -#include /usr/share/arduino/Arduino.mk - -# --- atmega-ng ide 1.6 -#BOARD_TAG = atmegang -#BOARD_SUB = atmega168 -#MONITOR_PORT = /dev/ttyACM0 -#ARDUINO_DIR = /where/you/installed/arduino-1.6.5 -#include /usr/share/arduino/Arduino.mk - -# --- arduino-tiny ide 1.0 -#ISP_PROG = usbasp -#BOARD_TAG = attiny85at8 -#ALTERNATE_CORE = tiny -#ARDUINO_VAR_PATH = $(HOME)/arduino/hardware/tiny/cores/tiny -#ARDUINO_CORE_PATH = $(HOME)/arduino/hardware/tiny/cores/tiny -#AVRDUDE_OPTS = -v -#include /usr/share/arduino/Arduino.mk - -# --- arduino-tiny ide 1.6 -#ISP_PROG = usbasp -#BOARD_TAG = attiny85at8 -#ALTERNATE_CORE = tiny -#ARDUINO_DIR = /where/you/installed/arduino-1.6.5 -#include /usr/share/arduino/Arduino.mk - -# --- damellis attiny ide 1.0 -#ISP_PROG = usbasp -#BOARD_TAG = attiny85 -#ALTERNATE_CORE = attiny-master -#AVRDUDE_OPTS = -v -#include /usr/share/arduino/Arduino.mk - -# --- damellis attiny ide 1.6 -#ISP_PROG = usbasp -#BOARD_TAG = attiny -#BOARD_SUB = attiny85 -#ALTERNATE_CORE = attiny -#F_CPU = 16000000L -#ARDUINO_DIR = /where/you/installed/arduino-1.6.5 -#include /usr/share/arduino/Arduino.mk - -# --- teensy3 -#BOARD_TAG = teensy31 -#ARDUINO_DIR = /where/you/installed/the/patched/teensy/arduino-1.0.6 -#include /usr/share/arduino/Teensy.mk - -# --- mighty 1284p -#BOARD_TAG = mighty_opt -#BOARDS_TXT = $(HOME)/arduino/hardware/mighty-1284p/boards.txt -#BOOTLOADER_PARENT = $(HOME)/arduino/hardware/mighty-1284p/bootloaders -#BOOTLOADER_PATH = optiboot -#BOOTLOADER_FILE = optiboot_atmega1284p.hex -#ISP_PROG = usbasp -#AVRDUDE_OPTS = -v -#include /usr/share/arduino/Arduino.mk - -# --- atmega328p on breadboard -#BOARD_TAG = atmega328bb -#ISP_PROG = usbasp -#AVRDUDE_OPTS = -v -#BOARDS_TXT = $(HOME)/arduino/hardware/breadboard/boards.txt -#include /usr/share/arduino/Arduino.mk - From 92f7290738fc66a1301758f1484406a1d075eb66 Mon Sep 17 00:00:00 2001 From: Mar Date: Sun, 4 Oct 2015 21:12:33 +0100 Subject: [PATCH 4/5] Sample makefile to customize --- .gitignore | 2 +- Makefile => Makefile.sample | 7 +++---- make.sh | 16 ++++++++-------- 3 files changed, 12 insertions(+), 13 deletions(-) rename Makefile => Makefile.sample (67%) diff --git a/.gitignore b/.gitignore index 8409514..d95b0d1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ *.kate-swp Thumbs.db build - +Makefile diff --git a/Makefile b/Makefile.sample similarity index 67% rename from Makefile rename to Makefile.sample index 58e656b..deb749f 100644 --- a/Makefile +++ b/Makefile.sample @@ -2,10 +2,9 @@ # Reference for variables: https://github.com/sudar/Arduino-Makefile/blob/master/arduino-mk-vars.md#arduino-ide-variables -# Installation dirs -ARDUINO_DIR= /home/marbu/bins/arduino-1.6.5-r5_watchduino2 -ARDUINO_PREFERENCES_PATH = /home/marbu/bins/arduino-1.6.5-r5_watchduino2/lib/preferences.txt -ARDMK_DIR = /home/marbu/bins/Arduino-Makefile +# Installation dirs - EDIT! +ARDUINO_DIR = EDIT-ME +ARDMK_DIR = EDIT-ME # Compilation opts BOARD_TAG = pro diff --git a/make.sh b/make.sh index fa93464..b3759ca 100755 --- a/make.sh +++ b/make.sh @@ -1,10 +1,10 @@ - #!/bin/bash +#!/bin/bash - SRC_DIR=watch - - cp Makefile $SRC_DIR - cd $SRC_DIR - make $1 - rm Makefile - cd .. +SRC_DIR=watch + +cp Makefile $SRC_DIR +cd $SRC_DIR +make $1 +rm Makefile +cd .. From c7a787005072a98ba2549f3d09421e003e77ce2c Mon Sep 17 00:00:00 2001 From: Mar Date: Sun, 4 Oct 2015 21:15:39 +0100 Subject: [PATCH 5/5] Makefile instructions --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index de50fe1..ec5c250 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,19 @@ so expect drastic changes without warning! See official project page for more info and updates on development: https://www.coconauts.net/projects/watchduino2/ + +## Compile without the Arduino IDE + +Watchduino is making use of [https://github.com/marbru/Arduino-Makefile], so you can compile and upload it from the command line. + +Copy `Makefile.sample` into `Makefile`, and edit the paths to your Arduino and Arduino Makefile installation dirs. + +Then you can do: + +./make.sh # To compile +sudo ./make.sh upload # To upload to your Arduino + + ## Tutorials - [How to make](docs/how_to_make.md), how to build your own WatchDuino.