Skip to content

Commit 11e2059

Browse files
committed
Documentation changes for Windows usage
1 parent 4519be5 commit 11e2059

File tree

3 files changed

+54
-31
lines changed

3 files changed

+54
-31
lines changed

Arduino.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@
6565
# configuration options. Control Panel > System > Advanced system settings
6666
# Also take into account that when you set them you have to add '\' on
6767
# all spaces and special characters.
68-
# ARDUINO_DIR and AVR_TOOLS_DIR have to be relative and not absolute.
6968
# This are just examples, you have to adapt this variables accordingly to
70-
# your system.
69+
# your system. Note the difference between ARDMK_DIR, which can use /cygdrive/
70+
# and USER_LIB_PATH, which cannnot due to invoking with the build tools
7171
#
72-
# ARDUINO_DIR =../../../../../Arduino
73-
# AVR_TOOLS_DIR =../../../../../Arduino/hardware/tools/avr
72+
# ARDUINO_DIR = C:/Arduino
73+
# AVR_TOOLS_DIR = C:/Arduino/hardware/tools/avr
7474
# ARDMK_DIR = /cygdrive/c/Users/"YourUser"/Arduino-Makefile
7575
#
7676
# On Windows it is highly recommended that you create a symbolic link directory

Common.mk

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,3 @@ ifndef ARDUINO_DIR
7979
else
8080
$(call show_config_variable,ARDUINO_DIR,[USER])
8181
endif
82-
83-
ifeq ($(CURRENT_OS),WINDOWS)
84-
ifneq ($(shell echo $(ARDUINO_DIR) | egrep '^(/|[a-zA-Z]:\\)'),)
85-
echo $(error On Windows, ARDUINO_DIR must be a relative path)
86-
endif
87-
endif

README.md

Lines changed: 50 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ You need to install Cygwin and its packages for Make, Perl and the following Ser
127127
Assuming you included Python in your Cygwin installation:
128128

129129
1. download PySerial source package from [https://pypi.python.org/pypi/pyserial](https://pypi.python.org/pypi/pyserial)
130-
2. extract downloaded package running
131-
```tar xvzf dowloaded_package_name.tar.gz```
130+
2. extract downloaded package running `tar xvzf dowloaded_package_name.tar.gz`
132131
3. navigate to extracted package folder
133132
4. build and install Python module:
134133

@@ -137,14 +136,24 @@ python setup.py build
137136
python setup.py install
138137
```
139138

139+
Alternatively, if you have setup Cygwin to use a Windows Python installation,
140+
simply install using pip:
141+
142+
```
143+
pip install pyserial
144+
```
145+
146+
Arduino-Makefile should automatically detect the Python installation type and
147+
use the correct device port binding.
148+
140149
## Usage
141150

142151
Download a copy of this repo somewhere to your system or install it through a package by following the above installation instruction.
143152

144153
Sample makefiles are provided in the `examples/` directory. E.g. [Makefile-example](examples/MakefileExample/Makefile-example.mk) demonstrates some of the more advanced options,
145154
whilst [Blink](examples/Blink/Makefile) demonstrates the minimal settings required for various boards like the Uno, Nano, Mega, Teensy, ATtiny etc.
146155

147-
MAC:
156+
### Mac
148157

149158
On the Mac with IDE 1.0 you might want to set:
150159

@@ -158,24 +167,28 @@ On the Mac with IDE 1.0 you might want to set:
158167

159168
On the Mac with IDE 1.5+ it's like above but with
160169

161-
```
170+
```make
162171
ARDUINO_DIR = /Applications/Arduino.app/Contents/Java
163172
```
164-
LINUX:
173+
### Linux
165174

166175
You can either declare following variables in your project's makefile or set them as environmental variables.
167176

177+
```make
168178
ARDUINO_DIR – Directory where Arduino is installed
169179
ARDMK_DIR – Directory where you have copied the makefile
170180
AVR_TOOLS_DIR – Directory where avr tools are installed
181+
```
171182

172183
Keep in mind, that Arduino 1.5.x+ comes with it's own copy of avr tools which you can leverage in your build process here.
173184

174185
Example of ~/.bashrc file:
175186

176-
export ARDUINO_DIR=/home/sudar/apps/arduino-1.0.5
177-
export ARDMK_DIR=/home/sudar/Dropbox/code/Arduino-Makefile
178-
export AVR_TOOLS_DIR=/usr/include
187+
```make
188+
export ARDUINO_DIR=/home/sudar/apps/arduino-1.0.5
189+
export ARDMK_DIR=/home/sudar/Dropbox/code/Arduino-Makefile
190+
export AVR_TOOLS_DIR=/usr/include
191+
```
179192

180193
Example of the project's make file:
181194

@@ -184,17 +197,25 @@ Example of the project's make file:
184197
MONITOR_PORT = /dev/ttyACM0
185198
```
186199

187-
WINDOWS:
200+
### Windows
188201

189-
On Windows (using cygwin), you might want to set:
202+
On Windows (using Cygwin), you might want to set:
190203

191204
```make
192-
ARDUINO_DIR = ../../arduino
205+
# Symbolic link to Arduino installation directory - see below
206+
ARDUINO_DIR = C:/Arduino
193207
ARDMK_DIR = path/to/mkfile
208+
ARDUINO_SKETCHBOOK = C:/Users/USERNAME/Documents/Arduino
194209
MONITOR_PORT = com3
195210
BOARD_TAG = mega2560
196211
```
197212

213+
**NOTE: Use forward slash not backslash and there should be no spaces or
214+
special characters in the Windows paths (due to Win/Unix crossover). The paths
215+
should not be *cygdrive* paths.** `ARDUINO_SKETCHBOOK` is defined to avoid
216+
automatic resolution, which resolve to *cygdrive* and is incompatable with the
217+
build tools.
218+
198219
On Windows (using MSYS and PuTTY), you might want to set the following extra parameters:
199220

200221
```make
@@ -205,44 +226,52 @@ On Windows (using MSYS and PuTTY), you might want to set the following extra par
205226
On Arduino 1.5+ installs, you should set the architecture to either `avr` or `sam` and if using a submenu CPU type, then also set that:
206227

207228
```make
208-
ARCHITECTURE = avr
229+
ARCHITECTURE = avr
209230
BOARD_TAG = atmegang
210231
BOARD_SUB = atmega168
211232
```
212233

213-
It is recommended in Windows that you create a symbolic link to avoid problems with file naming conventions on Windows. For example, if your your Arduino directory is in:
234+
#### Symbolic Link
214235

215-
c:\Program Files (x86)\Arduino
236+
It is recommended in Windows that you create a symbolic link to avoid problems with file naming conventions on Windows; unless one installs to a non-default location. For example, if your your Arduino directory is in:
237+
238+
C:\Program Files (x86)\Arduino
216239

217240
You will get problems with the special characters on the directory name. More details about this can be found in [issue #94](https://github.com/sudar/Arduino-Makefile/issues/94)
218241

219242
To create a symbolic link, you can use the command “mklink” on Windows, e.g.
220243

221244
```sh
222-
mklink /d c:\Arduino c:\Program Files (x86)\Arduino
245+
mklink /d C:\Arduino C:\Program Files (x86)\Arduino
246+
```
247+
Alternatively if you've setup Cygwin hard symbolic links ([CYGWIN=winsymlinks:native](https://www.cygwin.com/cygwin-ug-net/using-cygwinenv.html)):
248+
249+
```sh
250+
ln -s /cygdrive/c/Program Files\ \(x86\)/Arduino/ C:/Arduino
223251
```
224252

225253
After which, the variables should be:
226254

227255
```make
228-
ARDUINO_DIR=../../../../../Arduino
256+
ARDUINO_DIR=C:/Arduino
229257
```
230258

231259
Instead of:
232260

233261
```make
234-
ARDUINO_DIR=../../../../../Program\ Files\ \(x86\)/Arduino
262+
ARDUINO_DIR=C:/Program\ Files\ \(x86\)/Arduino
235263
```
236264

237-
Usefull Variables:
265+
### Usefull Variables
238266

239267
The list of all variables that can be overridden is available at [arduino-mk-vars.md](arduino-mk-vars.md) file.
240268

241269
- `BOARD_TAG` - Type of board, for a list see boards.txt or `make show_boards`
242270
- `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.
243-
- `ARDUINO_DIR` - Path to Arduino installation. In Cygwin in Windows this path must be
244-
relative, not absolute (e.g. "../../arduino" and not "/c/cygwin/Arduino").
245-
- `ARDMK_DIR` - Path where the `*.mk` are present. If you installed the package, then it is usually `/usr/share/arduino`
271+
- `ARDUINO_DIR` - Path to Arduino installation. Using Windows with Cygwin,
272+
this path must use Unix / and not Windows \\ (eg "C:/Arduino" not
273+
"C:\\Arduino).
274+
- `ARDMK_DIR` - Path where the `*.mk` are present. If you installed the package, then it is usually `/usr/share/arduino`. On Windows, this should be a path without spaces and no special characters, it can be a *cygdrive* path if nessessary and must use / not \\.
246275
- `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.
247276

248277

0 commit comments

Comments
 (0)