Merge branch 'master' of github.com:az-z/Arduino-Makefile

not sure
This commit is contained in:
az-z 2016-06-18 15:00:04 -04:00
commit 93c8380ac8

View file

@ -127,12 +127,12 @@ or you can install it using the [pre-built package installer](https://pypi.pytho
## Usage ## Usage
You can also find more [detailed instructions in this guide](http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile). Download a copy of this repo somewhere in your system or install it through a package.
You can also checkout the sample makefiles inside the `examples/` directory, e.g. [Makefile-example](examples/MakefileExample/Makefile-example.mk) demonstrates some of the more advanced options, Sample makefiles are provided in the `examples/` directory. E.g. [Makefile-example](examples/MakefileExample/Makefile-example.mk) demonstrates some of the more advanced options,
whilst [Blink](examples/Blink/Makefile) demonstrates the minimal settings required for various boards like the Uno, Nano, Mega, Teensy, ATtiny etc. whilst [Blink](examples/Blink/Makefile) demonstrates the minimal settings required for various boards like the Uno, Nano, Mega, Teensy, ATtiny etc.
Download a copy of this repo some where in your system or install it through a package. MAC:
On the Mac with IDE 1.0 you might want to set: On the Mac with IDE 1.0 you might want to set:
@ -149,14 +149,25 @@ On the Mac with IDE 1.5+ it's like above but with
``` ```
ARDUINO_DIR = /Applications/Arduino.app/Contents/Java ARDUINO_DIR = /Applications/Arduino.app/Contents/Java
``` ```
LINUX:
You can either declare following variables in your child makefile or set them as environmental variables.
On Linux (if you have installed through package), you shouldn't need to set anything other than your board type and port: ARDUINO_DIR Directory where Arduino is installed
ARDMK_DIR Directory where you have copied the makefile
AVR_TOOLS_DIR Directory where avr tools are installed
Keep in mind, that for Arduino 1.5.x+ comes with it's own copy of avr tools which you can leverage here.
Example of ~/.bashrc file:
export ARDUINO_DIR=/home/sudar/apps/arduino-1.0.5
export ARDMK_DIR=/home/sudar/Dropbox/code/Arduino-Makefile
export AVR_TOOLS_DIR=/usr/include
```make ```make
BOARD_TAG = mega2560 BOARD_TAG = mega2560
MONITOR_PORT = /dev/ttyACM0 MONITOR_PORT = /dev/ttyACM0
``` ```
WINDOWS:
On Windows (using cygwin), you might want to set: On Windows (using cygwin), you might want to set:
```make ```make
@ -205,6 +216,10 @@ Instead of:
ARDUINO_DIR=../../../../../Program\ Files\ \(x86\)/Arduino ARDUINO_DIR=../../../../../Program\ Files\ \(x86\)/Arduino
``` ```
Usefull Variables:
The list of all variables that can be overridden is available at [arduino-mk-vars.md](arduino-mk-vars.md) file.
- `BOARD_TAG` - Type of board, for a list see boards.txt or `make show_boards` - `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. - `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 - `ARDUINO_DIR` - Path to Arduino installation. In Cygwin in Windows this path must be
@ -212,17 +227,17 @@ Instead of:
- `ARDMK_DIR` - Path where the `*.mk` are present. If you installed the package, then it is usually `/usr/share/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. Otherwise set it realtive and not absolute. - `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. Otherwise set it realtive and not absolute.
The list of all variables that can be overridden is available at [arduino-mk-vars.md](arduino-mk-vars.md) file.
## Including Libraries ## Including Libraries
You can specify space separated list of libraries that are needed for your sketch to the variable `ARDUINO_LIBS`. You can specify space separated list of libraries that are needed for your sketch in the variable `ARDUINO_LIBS`.
```make ```make
ARDUINO_LIBS = Wire SoftwareSerial ARDUINO_LIBS = Wire SoftwareSerial
``` ```
The libraries will be searched in the following places in the following order. The libraries will be searched for in the following places in the following order.
- `/libraries` directory inside your sketchbook directory. Sketchbook directory will be auto detected from your Arduino preference file. You can also manually set it through `ARDUINO_SKETCHBOOK`. - `/libraries` directory inside your sketchbook directory. Sketchbook directory will be auto detected from your Arduino preference file. You can also manually set it through `ARDUINO_SKETCHBOOK`.
- `/libraries` directory inside your Arduino directory, which is read from `ARDUINO_DIR`. - `/libraries` directory inside your Arduino directory, which is read from `ARDUINO_DIR`.