diff --git a/.gitignore b/.gitignore index 46a9cff..d95b0d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .directory *.kate-swp Thumbs.db +build +Makefile diff --git a/Makefile.sample b/Makefile.sample new file mode 100644 index 0000000..deb749f --- /dev/null +++ b/Makefile.sample @@ -0,0 +1,18 @@ +# 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 - EDIT! +ARDUINO_DIR = EDIT-ME +ARDMK_DIR = EDIT-ME + +# 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 + 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. diff --git a/make.sh b/make.sh new file mode 100755 index 0000000..b3759ca --- /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 .. +