From 0526855340c97bd93939fffc206adf08b261151f Mon Sep 17 00:00:00 2001 From: Sudar Date: Wed, 29 Jan 2014 11:32:16 +0530 Subject: [PATCH] Update `README.md` about compatibility with Windows Fix #94 --- HISTORY.md | 2 ++ README.md | 76 ++++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 59 insertions(+), 19 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 7b3fcd9..1800cb8 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -10,6 +10,8 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it - Tweak: Don't hard code MONITOR_PORT in examples, for more flexible testing. (Issue #157) (https://github.com/peplin) - Tweak: Silence the stderr output from call to `which`. (Issue #158) (https://github.com/peplin) - Fix: Override complete compiler tool paths for chipKIT. (Issue #159) (https://github.com/peplin) +- New: The makefile is compatible with Windows +- New: Update `README.md` file about usage and Windows compatibility ### 1.2.0 (2014-01-14) - Add: Add RPM SPECfile and new `package` directory to store package instructions and files (https://github.com/sej7278) diff --git a/README.md b/README.md index 7176049..dadd8c2 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,37 @@ # A Makefile for Arduino Sketches -This is a very simple Makefile which knows how to build Arduino sketches. It defines the entire workflows for compiling code, flashing it to Arduino and even communicating through Serial monitor. You don't need to change anything in the Arduino sketches. +This is a very simple Makefile which knows how to build Arduino sketches. It defines entire workflows for compiling code, flashing it to Arduino and even communicating through Serial monitor. You don't need to change anything in the Arduino sketches. -If you're using FreeBSD, Debian or Ubuntu, you can find this in the `arduino-mk` package. +## Features -## Usage +- Very robust +- Supports all official AVR-based Arduino boards +- Supports chipKIT +- Works on all three major OS (Mac, Linux, Windows) +- Auto detects serial baud rate and libraries used +- Support for `*.ino` and `*.pde` sketches as well as raw `*.c` and `*.cpp` +- Support for Arduino Software versions 1.0.x as well as 0.x. +Support for Arduino 1.5.x is still work in progress +- Automatic dependency tracking. Referred libraries are automatically included +in the build process. Changes in `*.h` files lead to recompilation of sources which include them -You can also find more [detailed instructions in this guide](http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile) or also checkout the sample makefiles inside the examples/ folder +## Installation -Download a copy of this repo some where in your system. +### Through package -On the Mac you might want to set: +If you're using FreeBSD, Debian or Ubuntu, you can find this in the `arduino-mk` +package and can be installed using `apt-get` or `aptitude`. - ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java - ARDMK_DIR = /usr/local - AVR_TOOLS_DIR = /usr +### From source -On Linux, you shouldn't need to set anything other than your board type and port: +- Download the latest release +- Or clone it from Github using the command `git clone git@github.com:sudar/Arduino-Makefile.git` +- Check the [usage section](https://github.com/sudar/Arduino-Makefile#usage) in this readme about setting usage options - BOARD_TAG = mega2560 - MONITOR_PORT = /dev/ttyACM0 +## Requirements -- `BOARD_TAG` - Type of board, for a list see boards.txt or `make show_boards` -- `MONITOR_PORT` - The port where your Arduino is plugged in, usually `/dev/ttyACM0` or `/dev/ttyUSB0` in Linux or Mac OS X and `com3`, `com4`, etc. in Windows. -- `ARDUINO_DIR` - Path to Arduino installation. In Cygwin in Windows this path must be - relative, not absolute (e.g. "../../arduino" and not "/c/cygwin/Arduino"). -- `ARDMK_DIR` - Path where the `*.mk` are present. If you installed the package, then it is usually `/usr/share/arduino` -- `AVR_TOOLS_DIR` - Path where the avr tools chain binaries are present. If you are going to use the binaries that came with Arduino installation, then you don't have to set it. +You need to have the Arduino IDE. You can either install it through the +installer or download the distribution zip file and extract it. The Makefile also delegates resetting the board to a short Perl program. You'll need to install `Device::SerialPort` to use it though. @@ -45,7 +50,7 @@ On openSUSE: On Mac using MacPorts: - sudo port install p5-device-serialport + sudo port install p5-device-serialport and use /opt/local/bin/perl5 instead of /usr/bin/perl @@ -53,6 +58,39 @@ On other systems: cpan Device::SerialPort +## Usage + +You can also find more [detailed instructions in this guide](http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile) or also checkout the sample makefiles inside the examples/ folder + +Download a copy of this repo some where in your system or install it through a package. + +On the Mac you might want to set: + + ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java + ARDMK_DIR = /usr/local + AVR_TOOLS_DIR = /usr + MONITOR_PORT = /dev/ttyACM0 + BOARD_TAG = mega2560 + +On Linux (if you have installed through package), you shouldn't need to set anything other than your board type and port: + + BOARD_TAG = mega2560 + MONITOR_PORT = /dev/ttyACM0 + +On Windows (using cygwin), you might want to set: + + ARDUINO_DIR = ../../arduino + ARDMK_DIR = path/to/mkfile + MONITOR_PORT = com3 + BOARD_TAG = mega2560 + +- `BOARD_TAG` - Type of board, for a list see boards.txt or `make show_boards` +- `MONITOR_PORT` - The port where your Arduino is plugged in, usually `/dev/ttyACM0` or `/dev/ttyUSB0` in Linux or Mac OS X and `com3`, `com4`, etc. in Windows. +- `ARDUINO_DIR` - Path to Arduino installation. In Cygwin in Windows this path must be + relative, not absolute (e.g. "../../arduino" and not "/c/cygwin/Arduino"). +- `ARDMK_DIR` - Path where the `*.mk` are present. If you installed the package, then it is usually `/usr/share/arduino` +- `AVR_TOOLS_DIR` - Path where the avr tools chain binaries are present. If you are going to use the binaries that came with Arduino installation, then you don't have to set it. + ## Including Libraries You can specify space separated list of libraries that are needed for your sketch to the variable `ARDUINO_LIBS`.