Browse Source

Squashed 'vendor/arduino-mk/' content from commit 11c9341

git-subtree-dir: vendor/arduino-mk
git-subtree-split: 11c9341692
master
Peter J. Jones 4 years ago
commit
c683564201
42 changed files with 4521 additions and 0 deletions
  1. 3
    0
      .gitignore
  2. 1327
    0
      Arduino.mk
  3. 35
    0
      CONTRIBUTING.md
  4. 46
    0
      Common.mk
  5. 233
    0
      HISTORY.md
  6. 217
    0
      README.md
  7. 48
    0
      ard-reset-arduino.1
  8. 1101
    0
      arduino-mk-vars.md
  9. 38
    0
      bin/ard-reset-arduino
  10. 115
    0
      chipKIT.mk
  11. 1
    0
      examples/.gitignore
  12. 23
    0
      examples/ATtinyBlink/ATtinyBlink.ino
  13. 13
    0
      examples/ATtinyBlink/Makefile
  14. 53
    0
      examples/AnalogInOutSerial/AnalogInOutSerial.ino
  15. 4
    0
      examples/AnalogInOutSerial/Makefile
  16. 19
    0
      examples/Blink/Blink.ino
  17. 5
    0
      examples/Blink/Makefile
  18. 19
    0
      examples/BlinkChipKIT/BlinkChipKIT.pde
  19. 5
    0
      examples/BlinkChipKIT/Makefile
  20. 16
    0
      examples/BlinkInAVRC/Makefile
  21. 38
    0
      examples/BlinkInAVRC/blink.c
  22. 65
    0
      examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
  23. 4
    0
      examples/BlinkWithoutDelay/Makefile
  24. 31
    0
      examples/Fade/Fade.ino
  25. 4
    0
      examples/Fade/Makefile
  26. 58
    0
      examples/HelloWorld/HelloWorld.ino
  27. 4
    0
      examples/HelloWorld/Makefile
  28. 55
    0
      examples/MakefileExample/Makefile-example.mk
  29. 7
    0
      examples/README.md
  30. 14
    0
      examples/TinySoftWareSerial/Makefile
  31. 12
    0
      examples/TinySoftWareSerial/TinySoftwareSerial.ino
  32. 6
    0
      examples/WebServer/Makefile
  33. 82
    0
      examples/WebServer/WebServer.ino
  34. 6
    0
      examples/master_reader/Makefile
  35. 32
    0
      examples/master_reader/master_reader.ino
  36. 4
    0
      examples/toneMelody/Makefile
  37. 95
    0
      examples/toneMelody/pitches.h
  38. 49
    0
      examples/toneMelody/toneMelody.ino
  39. 502
    0
      licence.txt
  40. 23
    0
      packaging/debian/README.md
  41. 39
    0
      packaging/fedora/README.md
  42. 70
    0
      packaging/fedora/arduino-mk.spec

+ 3
- 0
.gitignore View File

@@ -0,0 +1,3 @@
1
+*.o
2
+build-cli
3
+/.project

+ 1327
- 0
Arduino.mk
File diff suppressed because it is too large
View File


+ 35
- 0
CONTRIBUTING.md View File

@@ -0,0 +1,35 @@
1
+# Contributing To Arduino Makefile
2
+
3
+Community made patches, localizations, bug reports, documentation and contributions are always welcome and are crucial to the success of this project.
4
+
5
+When contributing please ensure you follow the guidelines below so that we can keep on top of things.
6
+
7
+## Getting Started
8
+
9
+Submit a ticket for your issue, assuming one does not already exist.
10
+
11
+- Raise it on our [Issue Tracker](https://github.com/sudar/Arduino-Makefile/issues)
12
+- Clearly describe the issue including steps to reproduce the bug.
13
+- Make sure you fill in the earliest version that you know has the issue as well as the following
14
+    - Your operating system (Mac, Linux/Unix, Windows)
15
+    - Your Arduino IDE version
16
+    - Snippet of your makefile
17
+
18
+## Making Changes
19
+
20
+- Fork the repository on GitHub
21
+- Make the changes to your forked repository
22
+- Update the [changelog file](HISTORY.md) and add a note about your change. If possible prefix it with either Fix, Tweak or New
23
+- If you are adding or changing the behavior of any variable, then update the corresponding documentation in the [arduino-mk-vars.md](arduino-mk-vars.md) file as well
24
+- When committing, reference your issue (if present) and include a note about the fix
25
+    - If possible (and if makes sense) do atomic commits
26
+    - Try to follow [this guideline](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) while choosing the git commit message
27
+- Push the changes to your fork and submit a pull request to the 'master' branch of the this repository
28
+
29
+At this point you're waiting on us to merge your pull request. We'll review all pull requests, and make suggestions and changes if necessary.
30
+
31
+# Additional Resources
32
+
33
+- [General GitHub Documentation](http://help.github.com/)
34
+- [GitHub Pull Request documentation](http://help.github.com/send-pull-requests/)
35
+- [Guide about contributing code in GitHub](http://sudarmuthu.com/blog/contributing-to-project-hosted-in-github)

+ 46
- 0
Common.mk View File

@@ -0,0 +1,46 @@
1
+# Useful functions
2
+# Returns the first argument (typically a directory), if the file or directory
3
+# named by concatenating the first and optionally second argument
4
+# (directory and optional filename) exists
5
+dir_if_exists = $(if $(wildcard $(1)$(2)),$(1))
6
+
7
+# Run a shell script if it exists. Stops make on error.
8
+runscript_if_exists =                                                          \
9
+    $(if $(wildcard $(1)),                                                     \
10
+         $(if $(findstring 0,                                                  \
11
+                  $(lastword $(shell $(abspath $(wildcard $(1))); echo $$?))), \
12
+              $(info Info: $(1) success),                                      \
13
+              $(error ERROR: $(1) failed)))
14
+
15
+# For message printing: pad the right side of the first argument with spaces to
16
+# the number of bytes indicated by the second argument.
17
+space_pad_to = $(shell echo $(1) "                                                      " | head -c$(2))
18
+
19
+# Call with some text, and a prefix tag if desired (like [AUTODETECTED]),
20
+show_config_info = $(call arduino_output,- $(call space_pad_to,$(2),20) $(1))
21
+
22
+# Call with the name of the variable, a prefix tag if desired (like [AUTODETECTED]),
23
+# and an explanation if desired (like (found in $$PATH)
24
+show_config_variable = $(call show_config_info,$(1) = $($(1)) $(3),$(2))
25
+
26
+# Just a nice simple visual separator
27
+show_separator = $(call arduino_output,-------------------------)
28
+
29
+$(call show_separator)
30
+$(call arduino_output,Arduino.mk Configuration:)
31
+
32
+########################################################################
33
+#
34
+# Detect OS
35
+ifeq ($(OS),Windows_NT)
36
+    CURRENT_OS = WINDOWS
37
+else
38
+    UNAME_S := $(shell uname -s)
39
+    ifeq ($(UNAME_S),Linux)
40
+        CURRENT_OS = LINUX
41
+    endif
42
+    ifeq ($(UNAME_S),Darwin)
43
+        CURRENT_OS = MAC
44
+    endif
45
+endif
46
+$(call show_config_variable,CURRENT_OS,[AUTODETECTED])

+ 233
- 0
HISTORY.md View File

@@ -0,0 +1,233 @@
1
+A Makefile for Arduino Sketches
2
+===============================
3
+
4
+The following is the rough list of changes that went into different versions.
5
+I tried to give credit whenever possible. If I have missed anyone, kindly add it to the list.
6
+
7
+### 1.3.4 (2014-07-12)
8
+- Tweak: Allow spaces in "Serial.begin (....)". (Issue #190) (https://github.com/pdav)
9
+- Add: Add support for compiling assembler code. (Issue #195) (https://github.com/hrobeers)
10
+- Add: Try to guess port from wildcards if not specified. (Issue #197) (https://github.com/tuzz)
11
+- Fix: Check that on windows ARDUINO_DIR (and MPIDE_DIR) is a relative path. (Issue #201 and #202) (https://github.com/sej7278)
12
+- Add: List board name as well as tag in `make show_boards`. (Issue #204) (https://github.com/sej7278)
13
+- Fix: Add missing newlines at end of some echo's (Issue #207) (https://github.com/sej7278)
14
+- Fix: Add missing/reorder/reword targets in `make help` (https://github.com/sej7278)
15
+- New: Arduino.mk is now compatible with Flymake mode (https://github.com/rbarzic)
16
+- Fix: MONITOR_PORT detection (Issue #213, #215) (https://github.com/sej7278)
17
+- Tweak: Audited regexes/quoting/wildcards (Issue #192) (https://github.com/sej7278)
18
+- New: Build core objects in subdirectory (Issue #82) (https://github.com/sej7278)
19
+
20
+### 1.3.3 (2014-04-12)
21
+- Fix: Make a new manpage for ard-reset-arduino. Fixes issue #188 (https://github.com/sej7278)
22
+
23
+### 1.3.2 (2014-04-11)
24
+- Fix: Add arduino-mk-vars.md file to RPM SPECfile. (https://github.com/sej7278)
25
+- Fix: Add avr-libc/malloc.c and realloc.c to included core files. Fixes issue #163 (https://github.com/sej7278)
26
+- Fix: Add "gpio" to the list of isp that don't have a port. (Issue #165, #166) (https://github.com/sej7278)
27
+- Fix: Add "-D__PROG_TYPES_COMPAT__" to the avr-g++ compiler flags to match IDE. (https://github.com/sej7278)
28
+- New: Create `Makefile-example-mk`, a *real life* `Makefile` example, to be used as a reference. (https://github.com/tinyladi)
29
+- Tweak: Add `OBJDIR` to `arduino-mk-vars.md` (https://github.com/tinyladi)
30
+- Tweak: *Beautify* `arduino-mk-vars.md` with code blocks. (https://github.com/tinyladi)
31
+- Fix: AVR tools paths for chipKIT in Linux. (https://github.com/peplin)
32
+- Fix: Consider usb or usb:... to be a valid ISP_PORT (https://github.com/geoffholden)
33
+- Add: Add phony target to run pre-build hook script (https://github.com/jrid)
34
+- Fix: Add BOOTLOADER_PARENT to `arduino-mk-vars.md` and fixed BOOTLOADER_PATH example. (https://github.com/sej7278)
35
+- Tweak: Replace perl reset script with Python script. (https://github.com/sej7278)
36
+- Tweak: Made choice of Python2/3 interpreter up to the OS. (https://github.com/peplin)
37
+- Tweak: Simplified packaging dependencies. (https://github.com/sej7278)
38
+- Tweak: Tweak AVRDUDE conf detection in windows. (https://github.com/EAGMnor)
39
+
40
+### 1.3.1 (2014-02-04)
41
+- Fix: BUNDLED_AVR_TOOLS_DIR is now set properly when using only arduino-core and not the whole arduino package. (https://github.com/sej7278)
42
+- New: Document all variables that can be overridden. (https://github.com/sej7278)
43
+- New: Add a new `help_vars` target to display information about variables that can be overridden.
44
+
45
+### 1.3.0 (2014-01-29)
46
+- Fix: Use more reliable serial device naming in Windows. Fix issue #139 and #155 (https://github.com/peplin)
47
+- Fix: Document that ARDUINO_DIR must be a relative path in Windows. Fix issue #156 (https://github.com/peplin)
48
+- Tweak: Don't hard code MONITOR_PORT in examples, for more flexible testing. (Issue #157) (https://github.com/peplin)
49
+- Tweak: Silence the stderr output from call to `which`. (Issue #158) (https://github.com/peplin)
50
+- Fix: Override complete compiler tool paths for chipKIT. (Issue #159) (https://github.com/peplin)
51
+- New: The makefile is compatible with Windows
52
+- New: Update `README.md` file about usage and Windows compatibility
53
+
54
+### 1.2.0 (2014-01-14)
55
+- Add: Add RPM SPECfile and new `package` directory to store package instructions and files (https://github.com/sej7278)
56
+- Fix: Remove use of arduino-mk subdirectory in git. Fix issue #151, #152 and #147 (https://github.com/sej7278)
57
+- Fix: Remove `arduino-mk` directory from all examples. Fix #154
58
+
59
+### 1.1.0 (2013-12-26)
60
+- Don't append port details to avrdude for usbasp. See #123
61
+- Ignore commented lines while parsing boards.txt file. See #124
62
+- In ISP mode, read baudrate and programmer from boards.txt. See #125
63
+- Add `burn_bootloader` target. See #85
64
+- Show correct path to `arduino.mk` file in help message. Fix #120
65
+- Change echo for printf. Fix #129 (https://github.com/thomassigurdsen)
66
+- Add support for ChipKiT 2013. Fix #136 (https://github.com/peplin)
67
+- Auto detect and include libraries specified in `USER_LIB_PATH`. Fix #135 (https://github.com/tinyladi)
68
+- Use `MAKEFILE_LIST` to get the name of the make file. Fix #130 (https://github.com/cantora)
69
+- New: Add option to set fuses without burning a bootloader. Fix #141 (https://github.com/sej7278)
70
+- Tweak: Don't append port details to avrdude for usbtiny. Fix #140 and #138 (https://github.com/PPvG)
71
+- Fix: Handle relative paths of bootloader file while burning bootloaders. Fix #126 and #142 (https://github.com/sej7278)
72
+- New: Add `CONTRIBUTING.md` explaining how to contribute to the project.
73
+- New: Force -Os optimization for SoftwareSerial. Add `OPTIMIZATION_FLAGS` and `DEBUG_FLAGS`. (https://github.com/mahoy)
74
+- Fix: Use `ARDUINO_HEADER` variable instead of hardcoded file names. Fix #131
75
+
76
+### 1.0.1 (2013-09-25)
77
+- Unconditionally add -D in avrdude options. See #114
78
+
79
+### 1.0.0 (2013-09-22)
80
+- Add $OBJDIR to the list of configuration that gets printed. Fix issue #77
81
+- Add support for specifying optimization level. Fix issue #81
82
+- Add support for reseting "Micro" Arduino. Fix issue #80 (https://github.com/sej7278)
83
+- Remove "utility" from example makefiles. Fix issue #84
84
+- Auto detect alternate core path from sketchbook folder. Fix issue #86
85
+- Remove redundant checks for ARDUINO_DIR
86
+- Improve avrdude and avrdude.conf path auto detection. Fix issue #48
87
+- Move binary sketch size verification logic inside makefile. Fix issue #54
88
+- Remove dependency on wait-connection-leonardo shell script. Fix issue #95
89
+- Add support for the Digilent chipKIT platform. (https://github.com/peplin)
90
+- Implement ard-parse-boards with shell scripting instead of Perl (https://github.com/peplin)
91
+- Compile with debugging symbols only when DEBUG=1 (https://github.com/peplin)
92
+- Replace Leonardo detection with Caterina detection (https://github.com/sej7278)
93
+- Autodetect baudrate only if either a .ino/.pde is present
94
+- Allow building with Arduino core, without a .ino/.pde file
95
+- Ability to support different Arduino cores (https://github.com/sej7278)
96
+
97
+### 0.12.0 (2013-06-20)
98
+- Fix "generated_assembly" target, which got broken earlier. Fix issue #76 (https://github.com/matthijskooijman)
99
+- Deprecate "generated_assembly" target in favour of "generate_assembly". Fix issue #79
100
+
101
+### 0.11.0 (2013-06-15)
102
+- Replace hardcoded executables with variable
103
+- Fix whitespace issues
104
+- Add a warning when HEX_MAXIMUM_SIZE is not specified
105
+- Add the ability to configure avrdude options. Fix issue #53
106
+- Handle cases where certain fuse bits are not present. Fix issue #61
107
+- Add support for compiling plain AVR C files. Fix issue #63
108
+- Add an example to show how to compile AVR C files. Fix issue #73
109
+
110
+### 0.10.6 (2013-06-14)
111
+- Fix whitespace and add /dev/null redirection (https://github.com/sej7278)
112
+- Change the way AUTO_ARDUINO_VERSION is computed (https://github.com/sej7278)
113
+- Make serial monitor baudrate detection work in Mac as well(https://github.com/sej7278)
114
+- Fix directory creation for library source files (https://github.com/matthijskooijman)
115
+- Rewrite ard-leonardo-reset script in perl (https://github.com/sej7278)
116
+
117
+### 0.10.5 (2013-06-11)
118
+- Add USB_VID and USB_PID to CPPFLAGS only if the board is Leonardo.
119
+- Allow adding extra common dependencies (COMMON_DEPS) (https://github.com/gaftech)
120
+- Added ifndef ARDUINO_VAR_PATH for compiling for the attiny (https://github.com/danielesteban)
121
+- Strip extra whitespace from the `BOARD_TAG` variable
122
+- Enhanced support for programming using Arduino as ISP
123
+- Added example to show how to program using Arduino as ISP
124
+- Add support for Leonardo boards. Took code from (https://github.com/guicho271828)
125
+
126
+### 0.10.4 (2013-05-31) @matthijskooijman
127
+- Improved BAUD_RATE detection logic
128
+- Added logic to check if there is only .ino or .pde file
129
+- Compile .ino/.pde files directly
130
+- Output configuration only once
131
+- Try to read Version.txt file only if it is present
132
+- Refactored dependency code
133
+
134
+###	0.10.3 16.xii 2012 gaftech
135
+- Enabling creation of EEPROM file (.eep)
136
+- EEPROM upload: eeprom and raw_eeprom targets
137
+- Auto EEPROM upload with isp mode: ISP_EEPROM option.
138
+- Allow custom OBJDIR
139
+
140
+### 0.10.2 15.xii.2012 Sudar
141
+- Added sketch size verification. (https://github.com/fornellas)
142
+- Show original line number for error messages (https://github.com/WizenedEE)
143
+- Removed -w from CPPFLAGS to show warnings (https://github.com/gaftech)
144
+- Changed shebang to use /usr/bin/env (https://github.com/anm)
145
+- set USB_VID and USB_PID only for leonardo boards(https://github.com/alohr)
146
+- Updated Readme (https://github.com/fr0sty1/)
147
+
148
+###  0.10.1 15.xii.2012 Sudar
149
+- Merged all changes from Upstream and the following changes from https://github.com/rpavlik
150
+- Allow passing extra flags
151
+- Make listing files more useful
152
+- Add knowledge of device-specific assembler
153
+- Use variables instead of hardcoded commands
154
+- Make disasm more helpful
155
+- Change .sym output
156
+- Provide symbol_sizes and generated_assembly targets.
157
+- Be able to silence configuration output
158
+- Make everybody depend on the makefile, in case cflags are changed, etc.
159
+- Make the makefile error if the arduino port is not present.
160
+
161
+###   0.10 17.ix.12   M J Oldfield
162
+- Added installation notes for Fedora (ex Rickard Lindberg).
163
+- Changed size target so that it looks at the ELF object,
164
+    not the hexfile (ex Jared Szechy and Scott Howard).
165
+- Fixed ARDUNIO typo in README.md (ex Kalin Kozhuharov).
166
+- Tweaked OBJDIR handling (ex Matthias Urlichs and Scott Howard).
167
+- Changed the name of the Debian/Ubuntu package (ex
168
+    Scott Howard).
169
+- Only set AVRDUDE_CONF if it's not set (ex Tom Hall).
170
+- Added support for USB_PID/VID used by the Leonardo (ex Dan
171
+    Villiom Podlaski Christiansen and Marc Plano-Lesay).
172
+
173
+###   0.9.3.2 10.ix.2012 Sudar
174
+- Fixed a typo in README. Issue reported at upstream (https://github.com/mjoldfield/Arduino-Makefile/issues/21)
175
+
176
+###   0.9.3.1 18.viii.2012 jeffkowalski
177
+
178
+- Autodetect ARDUINO_LIBS from includes in LOCAL_SRCS
179
+- Autodetect ARDUINO_SKETCHBOOK from file set by Arduino IDE
180
+- Autodetect ARDMK_DIR based on location of this file
181
+- Added support for utility directory within SYS and USER libraries
182
+
183
+### 0.9.3 13.vi.2012
184
+
185
+- Auto detect ARDUINO_DIR, Arduino version (https://github.com/rpavlik/)
186
+- Categorize libs into user and system (https://github.com/rpavlik/)
187
+- Dump size at the end of the build (https://github.com/rpavlik/)
188
+- Lots and lots of improvements (https://github.com/rpavlik/)
189
+- Changed bytes option for the head shell command, so that it works in Mac as well
190
+- Auto detect Serial Baud rate from sketch if possible
191
+
192
+### 0.9.2 06.vi.2012
193
+
194
+- Allow user to choose source files (LOCAL_*_SRCS flags) (https://github.com/Gaftech)
195
+- Modified "make size" behavior: using --mcu option and targeting .elf file instead of .hex file.(https://github.com/Gaftech)
196
+
197
+### 0.9.1 06.vi.2012
198
+
199
+- Corrected the ubuntu package names
200
+- Prevent the *file-not-found* error if the depends.mk file is not needed
201
+- Delete the build-cli folder as well while doing make clean
202
+- Added support for compiling .pde files in Arduino 1.0 environment
203
+- Replaced = with += in CPPFLAGS assignment so that we can set CPPFLAGS per sketch if needed
204
+- Changed AVRDUDE_CONF so it can be defined in per-project makefile (https://github.com/WizenedEE)
205
+- Cleaner way to delete the build-cli directory when make clean is invoked
206
+- The package name in Debian and Ubuntu is arduino-mk (https://github.com/maqifrnswa)
207
+
208
+### 2012-02-12, version 0.8
209
+- Patches for version 1.0 of the Arduino IDE. Older versions might still work, but I’ve not tested it.
210
+- A change to the build process: rather than link all the system objects directly into the executable, bundle them in a library first. This should make the final executable smaller.
211
+- If TARGET isn’t explicitly set, default to the current directory name. Thanks to Daniele Vergini for this patch.
212
+- Add support for .c files in system libraries: Dirk-Willem van Gulik and Evan Goldenberg both reported this and provided patches in the same spirit.
213
+- Added a size target as suggested by Alex Satrapa.
214
+
215
+### Unreleased, version 0.7
216
+- Added -lm to the linker options, and -F to stty.
217
+
218
+### 2011-06-23, version 0.6
219
+- Added ard-parse-boards. Mark Sproul suggested doing something like this ages ago, but I’ve only recently looked at it in detail.
220
+- Fabien Le Lez reported that one needs to link with -lc to avoid [linker errors](http://forum.arduino.cc/index.php/topic,40215.0.html).
221
+
222
+### 2011-06-23, version 0.5
223
+- Imported changes from Debian/Ubuntu, which incorporate a patch from Stefan Tomanek so that libraries would be compiled too.
224
+
225
+Note: Many other people sent me similar patches, but I didn't get around to using them. In the end, I took the patch from Debian and Ubuntu: there seems merit in not forking the code and using a tested version. So, thanks and apologies to Nick Andrew, Leandro Coletto Biazon, Thibaud Chupin, Craig Hollabaugh, Johannes H. Jensen, Fabien Le Lez, Craig Leres, and Mark Sproul.
226
+
227
+### 2010-05-24, version 0.4
228
+Tweaked rules for the reset target on Philip Hands’ advice.
229
+
230
+### 2010-05-21, version 0.3
231
+- Tidied up the licensing, making it clear that it’s released under LGPL 2.1.
232
+- [Philip Hands](http://hands.com/~phil/) sent me some code to reset the Arduino by dropping DTR for 100ms, and I added it.
233
+- Tweaked the Makefile to handle version 0018 of the Arduino software which now includes main.cpp. Accordingly we don’t need to—and indeed must not—add main.cxx to the .pde sketch file. The paths seem to have changed a bit too.

+ 217
- 0
README.md View File

@@ -0,0 +1,217 @@
1
+# A Makefile for Arduino Sketches
2
+
3
+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.
4
+
5
+## Features
6
+
7
+- Very robust
8
+- Highly customizable
9
+- Supports all official AVR-based Arduino boards
10
+- Supports chipKIT
11
+- Works on all three major OS (Mac, Linux, Windows)
12
+- Auto detects serial baud rate and libraries used
13
+- Support for `*.ino` and `*.pde` sketches as well as raw `*.c` and `*.cpp`
14
+- Support for Arduino Software versions 1.0.x as well as 0.x.
15
+Support for Arduino 1.5.x is still work in progress
16
+- Automatic dependency tracking. Referred libraries are automatically included
17
+in the build process. Changes in `*.h` files lead to recompilation of sources which include them
18
+
19
+## Installation
20
+
21
+### Through package
22
+
23
+If you're using FreeBSD, Debian or Ubuntu, you can find this in the `arduino-mk`
24
+package which can be installed using `apt-get` or `aptitude`.
25
+
26
+### From source
27
+
28
+- Download the latest release
29
+- Or clone it from Github using the command `git clone git@github.com:sudar/Arduino-Makefile.git`
30
+- Check the [usage section](https://github.com/sudar/Arduino-Makefile#usage) in this readme about setting usage options
31
+
32
+## Requirements
33
+
34
+You need to have the Arduino IDE. You can either install it through the
35
+installer or download the distribution zip file and extract it.
36
+
37
+The Makefile also delegates resetting the board to a short Python program.
38
+You'll need to install `pySerial` to use it though.
39
+
40
+On Debian or Ubuntu:
41
+
42
+       apt-get install python-serial
43
+
44
+On Fedora:
45
+
46
+       yum install pyserial
47
+
48
+On openSUSE:
49
+
50
+      zypper install python-serial
51
+
52
+On Mac using MacPorts:
53
+
54
+      sudo port install py27-serial
55
+
56
+On Windows:
57
+
58
+You need to install Cygwin and its packages for Make, Perl and the following Serial library.
59
+
60
+       pySerial can be downloaded from PyPi
61
+
62
+On other systems:
63
+
64
+       pip install pyserial
65
+
66
+        or
67
+
68
+       easy_install -U pyserial
69
+
70
+## Usage
71
+
72
+You can also find more [detailed instructions in this guide](http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile).
73
+
74
+You can also checkout the sample makefiles inside the `examples/` directory, e.g. [Makefile-example](examples/MakefileExample/Makefile-example.mk).
75
+
76
+Download a copy of this repo some where in your system or install it through a package.
77
+
78
+On the Mac you might want to set:
79
+
80
+    ARDUINO_DIR   = /Applications/Arduino.app/Contents/Resources/Java
81
+    ARDMK_DIR     = /usr/local
82
+    AVR_TOOLS_DIR = /usr
83
+    MONITOR_PORT  = /dev/ttyACM0
84
+    BOARD_TAG     = mega2560
85
+
86
+On Linux (if you have installed through package), you shouldn't need to set anything other than your board type and port:
87
+
88
+    BOARD_TAG     = mega2560
89
+    MONITOR_PORT  = /dev/ttyACM0
90
+
91
+On Windows (using cygwin), you might want to set:
92
+
93
+    ARDUINO_DIR   = ../../arduino
94
+    ARDMK_DIR     = path/to/mkfile
95
+    MONITOR_PORT  = com3
96
+    BOARD_TAG     = mega2560
97
+
98
+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:
99
+
100
+    c:\Program Files (x86)\Arduino
101
+
102
+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)
103
+
104
+To create a symbolic link, you can use the command “mklink” on Windows, e.g.
105
+
106
+    mklink /d c:\Arduino c:\Program Files (x86)\Arduino
107
+
108
+After which, the variables should be:
109
+
110
+    ARDUINO_DIR=../../../../../Arduino
111
+
112
+Instead of:
113
+
114
+    ARDUINO_DIR=../../../../../Program\ Files\ \(x86\)/Arduino
115
+
116
+
117
+
118
+- `BOARD_TAG` - Type of board, for a list see boards.txt or `make show_boards`
119
+- `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.
120
+- `ARDUINO_DIR` - Path to Arduino installation. In Cygwin in Windows this path must be
121
+  relative, not absolute (e.g. "../../arduino" and not "/c/cygwin/Arduino").
122
+- `ARDMK_DIR`   - Path where the `*.mk` are present. If you installed the package, then it is usually `/usr/share/arduino`
123
+- `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.
124
+
125
+The list of all variables that can be overridden is available at [arduino-mk-vars.md](arduino-mk-vars.md) file.
126
+
127
+## Including Libraries
128
+
129
+You can specify space separated list of libraries that are needed for your sketch to the variable `ARDUINO_LIBS`.
130
+
131
+`ARDUINO_LIBS = Wire SoftwareSerial`
132
+
133
+The libraries will be searched in the following places in the following order.
134
+
135
+- `/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`.
136
+- `/libraries` directory inside your Arduino directory, which is read from `ARDUINO_DIR`.
137
+
138
+The libraries inside user directories will take precedence over libraries present in Arduino core directory.
139
+
140
+The makefile can autodetect the libraries that are included from your sketch and can include them automatically. But it can't detect libraries that are included from other libraries. (see [issue #93](https://github.com/sudar/Arduino-Makefile/issues/93))
141
+
142
+## avrdude
143
+
144
+To upload compiled files, `avrdude` is used. This Makefile tries to find `avrdude` and it's config (`avrdude.conf`) below `ARDUINO_DIR`. If you like to use the one installed on your system instead of the one which came with Arduino, you can try to set the variables `AVRDUDE` and `AVRDUDE_CONF`. On a typical Linux system these could be set to
145
+
146
+      AVRDDUDE     = /usr/bin/avrdude
147
+      AVRDUDE_CONF = /etc/avrdude.conf
148
+
149
+## Colorgcc
150
+
151
+It is possible to use [`colorgcc`](https://github.com/colorgcc/colorgcc) with this makefile. Check out [this comment](http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile#comment-1408) to find usage instructions.
152
+
153
+## Emacs/Flymake support
154
+
155
+On-the-fly syntax checking in Emacs using the [Flymake](http://www.emacswiki.org/emacs/FlyMake) minor mode is now possible.
156
+
157
+First, the flymake mode must be configured to recognize ino files :
158
+
159
+Edit the flymake configuration :
160
+
161
+```
162
+    M-x customize-option RET
163
+    flymake-allowed-file-name-masks RET
164
+```
165
+
166
+Add the line :
167
+
168
+```
169
+      ("\\.ino\\'" flymake-simple-make-init)
170
+```
171
+
172
+Then click on "Apply and Save" button
173
+
174
+Then, the following line must be added to the project Makefile :
175
+
176
+```
177
+    check-syntax:
178
+        $(CXX_NAME) -c -include Arduino.h   -x c++ $(CXXFLAGS)   $(CPPFLAGS)  -fsyntax-only $(CHK_SOURCES)
179
+```
180
+
181
+## Versioning
182
+
183
+The current version of the makefile is `1.3.4`. You can find the full history in the [HISTORY.md](HISTORY.md) file
184
+
185
+This project adheres to Semantic [Versioning 2.0](http://semver.org/).
186
+
187
+## License
188
+
189
+This makefile and the related documentation and examples are free software; you can redistribute it and/or modify it
190
+under the terms of the GNU Lesser General Public License as
191
+published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
192
+
193
+## Contribution
194
+
195
+All contributions (even documentation) are welcome :) Open a pull request and I would be happy to merge them.
196
+Also checkout the [contribution guide](CONTRIBUTING.md) for more details.
197
+
198
+If you are looking for ideas to work on, then check out the following TODO items or the [issue tracker](https://github.com/sudar/Arduino-Makefile/issues/).
199
+
200
+## Limitations / Know Issues / TODO's
201
+
202
+- Doesn't work with Arduino 1.5.x yet. Follow [issue #45](https://github.com/sudar/Arduino-Makefile/issues/45) for progress.
203
+- Since it doesn't do any pre processing like Arduino IDE, you have to declare all methods before you use them ([issue #59](https://github.com/sudar/Arduino-Makefile/issues/59))
204
+- More than one .ino or .pde file is not supported yet ([issue #49](https://github.com/sudar/Arduino-Makefile/issues/49))
205
+- When you compile for the first time, it builds all libs inside Arduino directory even if it is not needed. But while linking only the relevant files are linked. ([issue #29](https://github.com/sudar/Arduino-Makefile/issues/29)). Even Arduino IDE does the same thing though.
206
+
207
+If you find an issue or have an idea for a feature then log them in the [issue tracker](https://github.com/sudar/Arduino-Makefile/issues/)
208
+
209
+## Credits
210
+
211
+This makefile was originally created by [Martin Oldfield](http://mjo.tc/atelier/2009/02/arduino-cli.html) and he maintained it till v0.10.2.
212
+From May 2013, it is maintained by [Sudar](http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile)
213
+
214
+## Similar works
215
+- It's not a derivative of this, but Alan Burlison has written a [similar thing](http://bleaklow.com/2010/06/04/a_makefile_for_arduino_sketches.html).
216
+- Alan's Makefile was used in a [Pragmatic Programmer's article](http://pragprog.com/magazines/2011-04/advanced-arduino-hacking).
217
+- Rei Vilo wrote to tell me that he's using the Makefile ina Xcode 4 template called [embedXcode](http://embedxcode.weebly.com/). Apparently it supports many platforms and boards, including AVR-based Arduino, AVR-based Wiring, PIC32-based chipKIT, MSP430-based LaunchPad and ARM3-based Maple.

+ 48
- 0
ard-reset-arduino.1 View File

@@ -0,0 +1,48 @@
1
+.TH ARD-RESET-ARDUINO "1" "April 2014" "ard-reset-arduino 1.3.4" "Arduino CLI Reset"
2
+
3
+.SH NAME
4
+ard-reset-arduino - Reset Arduino board
5
+
6
+.SH SYNOPSIS
7
+.B ard-reset-arduino
8
+[OPTION]... [PORT]
9
+
10
+.SH DESCRIPTION
11
+To reset Arduinos, we either pulse the DTR line or open the USB port 
12
+at 1200 baud and close it again.
13
+
14
+.SH OPTIONS
15
+.B \-\-verbose
16
+Watch what's going on on STDERR.
17
+
18
+.B \-\-period
19
+Specify the DTR pulse width in seconds.
20
+
21
+.B \-\-caterina
22
+Reset a Leonardo, Micro, Robot, LilyPadUSB or similar 32u4-based device.
23
+
24
+.SH EXAMPLES
25
+ard-reset-arduino /dev/ttyACM0
26
+.PP
27
+ard-reset-arduino \-\-verbose \-\-period=0.1 /dev/cu.usb*
28
+.PP
29
+ard-reset-arduino \-\-verbose \-\-caterina /dev/ttyUSB0
30
+
31
+.SH BUGS
32
+There are no known bugs in this application. Please report problems 
33
+to the author. Patches are welcome.
34
+
35
+.SH AUTHOR
36
+Simon John, git@the-jedi.co.uk
37
+
38
+.SH LICENSE
39
+Copyright (c) 2014, Simon John. All rights reserved.
40
+.PP
41
+This file is free software; you can redistribute it and/or modify it
42
+under the terms of the GNU Lesser General Public License as published
43
+by the Free Software Foundation; either version 2.1 of the License, or
44
+(at your option) any later version.
45
+.PP
46
+This program is distributed in the hope that it will be useful, but
47
+WITHOUT ANY WARRANTY; without even the implied warranty of
48
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

+ 1101
- 0
arduino-mk-vars.md
File diff suppressed because it is too large
View File


+ 38
- 0
bin/ard-reset-arduino View File

@@ -0,0 +1,38 @@
1
+#!/usr/bin/env python
2
+
3
+from __future__ import print_function
4
+import serial
5
+import os.path
6
+import argparse
7
+from time import sleep
8
+
9
+parser = argparse.ArgumentParser(description='Reset an Arduino')
10
+parser.add_argument('--caterina', action='store_true', help='Reset a Leonardo, Micro, Robot or LilyPadUSB.')
11
+parser.add_argument('--verbose', action='store_true', help="Watch what's going on on STDERR.")
12
+parser.add_argument('--period', default=0.1, help='Specify the DTR pulse width in seconds.')
13
+parser.add_argument('port', nargs=1, help='Serial device e.g. /dev/ttyACM0')
14
+args = parser.parse_args()
15
+
16
+if args.caterina:
17
+    if args.verbose: print('Forcing reset using 1200bps open/close on port %s' % args.port[0])
18
+    ser = serial.Serial(args.port[0], 57600)
19
+    ser.close()
20
+    ser.open()
21
+    ser.close()
22
+    ser.setBaudrate(1200)
23
+    ser.open()
24
+    ser.close()
25
+    sleep(1)
26
+
27
+    while not os.path.exists(args.port[0]):
28
+        if args.verbose: print('Waiting for %s to come back' % args.port[0])
29
+        sleep(1)
30
+
31
+    if args.verbose: print('%s has come back after reset' % args.port[0])
32
+else:
33
+    if args.verbose: print('Setting DTR high on %s for %ss' % (args.port[0],args.period))
34
+    ser = serial.Serial(args.port[0], 115200)
35
+    ser.setDTR(False)
36
+    sleep(args.period)
37
+    ser.setDTR(True)
38
+    ser.close()

+ 115
- 0
chipKIT.mk View File

@@ -0,0 +1,115 @@
1
+#
2
+# chipKIT extensions for Arduino Makefile
3
+# System part (i.e. project independent)
4
+#
5
+# Copyright (C) 2011, 2012, 2013 Christopher Peplin
6
+# <chris.peplin@rhubarbtech.com>, based on work that is Copyright Martin
7
+# Oldfield
8
+#
9
+# This file is free software; you can redistribute it and/or modify it
10
+# under the terms of the GNU Lesser General Public License as
11
+# published by the Free Software Foundation; either version 2.1 of the
12
+# License, or (at your option) any later version.
13
+#
14
+# Modified by John Wallbank for Visual Studio
15
+#
16
+#    Development changes, John Wallbank,
17
+#
18
+#   - made inclusion of WProgram.h optional so that
19
+#    including it in the source doesn't mess up compile error line numbers
20
+#   - parameterised the routine used to reset the serial port
21
+#
22
+
23
+########################################################################
24
+# Makefile distribution path
25
+#
26
+
27
+# The show_config_variable is unavailable before we include the common makefile,
28
+# so we defer logging the ARDMK_DIR info until it happens in Arduino.mk
29
+ifndef ARDMK_DIR
30
+    # presume it's the same path to our own file
31
+    ARDMK_DIR := $(realpath $(dir $(realpath $(lastword $(MAKEFILE_LIST)))))
32
+endif
33
+
34
+include $(ARDMK_DIR)/Common.mk
35
+
36
+ifndef MPIDE_DIR
37
+    AUTO_MPIDE_DIR := $(firstword \
38
+        $(call dir_if_exists,/usr/share/mpide) \
39
+        $(call dir_if_exists,/Applications/Mpide.app/Contents/Resources/Java) )
40
+    ifdef AUTO_MPIDE_DIR
41
+       MPIDE_DIR = $(AUTO_MPIDE_DIR)
42
+       $(call show_config_variable,MPIDE_DIR,[autodetected])
43
+    else
44
+        echo $(error "mpide_dir is not defined")
45
+    endif
46
+else
47
+    $(call show_config_variable,MPIDE_DIR,[USER])
48
+endif
49
+
50
+ifeq ($(CURRENT_OS),WINDOWS)
51
+    ifneq ($(shell echo $(ARDUINO_DIR) | egrep '^(/|[a-zA-Z]:\\)'),)
52
+        echo $(error On Windows, MPIDE_DIR must be a relative path)
53
+    endif
54
+endif
55
+
56
+ifndef MPIDE_PREFERENCES_PATH
57
+    AUTO_MPIDE_PREFERENCES_PATH := $(firstword \
58
+        $(call dir_if_exists,$(HOME)/.mpide/preferences.txt) \
59
+        $(call dir_if_exists,$(HOME)/Library/Mpide/preferences.txt) )
60
+    ifdef AUTO_MPIDE_PREFERENCES_PATH
61
+       MPIDE_PREFERENCES_PATH = $(AUTO_MPIDE_PREFERENCES_PATH)
62
+       $(call show_config_variable,MPIDE_PREFERENCES_PATH,[autodetected])
63
+    endif
64
+endif
65
+
66
+# The same as in Arduino, the Linux distribution contains avrdude and #
67
+# avrdude.conf in a different location, but for chipKIT it's even slightly
68
+# different than the Linux paths for Arduino, so we have to "double override".
69
+ifeq ($(CURRENT_OS),LINUX)
70
+    AVRDUDE_DIR = $(ARDUINO_DIR)/hardware/tools
71
+    AVRDUDE = $(AVRDUDE_DIR)/avrdude
72
+    AVRDUDE_CONF = $(AVRDUDE_DIR)/avrdude.conf
73
+endif
74
+
75
+PIC32_TOOLS_DIR = $(ARDUINO_DIR)/hardware/pic32/compiler/pic32-tools
76
+PIC32_TOOLS_PATH = $(PIC32_TOOLS_DIR)/bin
77
+
78
+ALTERNATE_CORE = pic32
79
+ALTERNATE_CORE_PATH = $(MPIDE_DIR)/hardware/pic32
80
+ARDUINO_CORE_PATH = $(ALTERNATE_CORE_PATH)/cores/$(ALTERNATE_CORE)
81
+ARDUINO_PREFERENCES_PATH = $(MPIDE_PREFERENCES_PATH)
82
+ARDUINO_DIR = $(MPIDE_DIR)
83
+
84
+CORE_AS_SRCS = $(ARDUINO_CORE_PATH)/vector_table.S
85
+
86
+ARDUINO_VERSION = 23
87
+
88
+CC_NAME = pic32-gcc
89
+CXX_NAME = pic32-g++
90
+AR_NAME = pic32-ar
91
+OBJDUMP_NAME = pic32-objdump
92
+OBJCOPY_NAME = pic32-objcopy
93
+SIZE_NAME = pic32-size
94
+NM_NAME = pic32-nm
95
+
96
+OVERRIDE_EXECUTABLES = 1
97
+CC      = $(PIC32_TOOLS_PATH)/$(CC_NAME)
98
+CXX     = $(PIC32_TOOLS_PATH)/$(CXX_NAME)
99
+AS      = $(PIC32_TOOLS_PATH)/$(AS_NAME)
100
+OBJCOPY = $(PIC32_TOOLS_PATH)/$(OBJCOPY_NAME)
101
+OBJDUMP = $(PIC32_TOOLS_PATH)/$(OBJDUMP_NAME)
102
+AR      = $(PIC32_TOOLS_PATH)/$(AR_NAME)
103
+SIZE    = $(PIC32_TOOLS_PATH)/$(SIZE_NAME)
104
+NM      = $(PIC32_TOOLS_PATH)/$(NM_NAME)
105
+
106
+LDSCRIPT = $(call PARSE_BOARD,$(BOARD_TAG),ldscript)
107
+LDSCRIPT_FILE = $(ARDUINO_CORE_PATH)/$(LDSCRIPT)
108
+
109
+MCU_FLAG_NAME=mprocessor
110
+LDFLAGS  += -T$(ARDUINO_CORE_PATH)/$(LDSCRIPT)
111
+LDFLAGS  += -T$(ARDUINO_CORE_PATH)/chipKIT-application-COMMON.ld
112
+CPPFLAGS += -mno-smart-io -fno-short-double
113
+CFLAGS_STD =
114
+
115
+include $(ARDMK_DIR)/Arduino.mk

+ 1
- 0
examples/.gitignore View File

@@ -0,0 +1 @@
1
+build-*

+ 23
- 0
examples/ATtinyBlink/ATtinyBlink.ino View File

@@ -0,0 +1,23 @@
1
+/*
2
+  Blink
3
+  Turns on an LED on for one second, then off for one second, repeatedly.
4
+ 
5
+  This example code is in the public domain.
6
+ */
7
+ 
8
+// Connect a LED to Pin 3. It might be different in different ATtiny micro controllers
9
+int led = 3;
10
+
11
+// the setup routine runs once when you press reset:
12
+void setup() {                
13
+  // initialize the digital pin as an output.
14
+  pinMode(led, OUTPUT);     
15
+}
16
+
17
+// the loop routine runs over and over again forever:
18
+void loop() {
19
+  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
20
+  delay(1000);               // wait for a second
21
+  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
22
+  delay(1000);               // wait for a second
23
+}

+ 13
- 0
examples/ATtinyBlink/Makefile View File

@@ -0,0 +1,13 @@
1
+# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile
2
+
3
+# if you have placed the alternate core in your sketchbook directory, then you can just mention the core name alone. 
4
+ALTERNATE_CORE = attiny
5
+# If not, you might have to include the full path.
6
+#ALTERNATE_CORE_PATH = /home/sudar/Dropbox/code/arduino-sketches/hardware/attiny/
7
+
8
+BOARD_TAG    = attiny85-8
9
+ISP_PORT = /dev/ttyACM*
10
+
11
+include $(ARDMK_DIR)/Arduino.mk
12
+
13
+# !!! Important. You have to use make ispload to upload when using ISP programmer

+ 53
- 0
examples/AnalogInOutSerial/AnalogInOutSerial.ino View File

@@ -0,0 +1,53 @@
1
+/*
2
+  Analog input, analog output, serial output
3
+ 
4
+ Reads an analog input pin, maps the result to a range from 0 to 255
5
+ and uses the result to set the pulsewidth modulation (PWM) of an output pin.
6
+ Also prints the results to the serial monitor.
7
+ 
8
+ The circuit:
9
+ * potentiometer connected to analog pin 0.
10
+   Center pin of the potentiometer goes to the analog pin.
11
+   side pins of the potentiometer go to +5V and ground
12
+ * LED connected from digital pin 9 to ground
13
+ 
14
+ created 29 Dec. 2008
15
+ modified 30 Aug 2011
16
+ by Tom Igoe
17
+ 
18
+ This example code is in the public domain.
19
+ 
20
+ */
21
+
22
+// These constants won't change.  They're used to give names
23
+// to the pins used:
24
+const int analogInPin = A0;  // Analog input pin that the potentiometer is attached to
25
+const int analogOutPin = 9; // Analog output pin that the LED is attached to
26
+
27
+int sensorValue = 0;        // value read from the pot
28
+int outputValue = 0;        // value output to the PWM (analog out)
29
+
30
+void setup() {
31
+  // initialize serial communications at 9600 bps:
32
+  Serial.begin(9600); 
33
+}
34
+
35
+void loop() {
36
+  // read the analog in value:
37
+  sensorValue = analogRead(analogInPin);            
38
+  // map it to the range of the analog out:
39
+  outputValue = map(sensorValue, 0, 1023, 0, 255);  
40
+  // change the analog out value:
41
+  analogWrite(analogOutPin, outputValue);           
42
+
43
+  // print the results to the serial monitor:
44
+  Serial.print("sensor = " );                       
45
+  Serial.print(sensorValue);      
46
+  Serial.print("\t output = ");      
47
+  Serial.println(outputValue);   
48
+
49
+  // wait 10 milliseconds before the next loop
50
+  // for the analog-to-digital converter to settle
51
+  // after the last reading:
52
+  delay(10);                     
53
+}

+ 4
- 0
examples/AnalogInOutSerial/Makefile View File

@@ -0,0 +1,4 @@
1
+BOARD_TAG    = uno
2
+ARDUINO_LIBS =
3
+
4
+include ../../Arduino.mk

+ 19
- 0
examples/Blink/Blink.ino View File

@@ -0,0 +1,19 @@
1
+/*
2
+  Blink
3
+  Turns on an LED on for one second, then off for one second, repeatedly.
4
+ 
5
+  This example code is in the public domain.
6
+ */
7
+
8
+void setup() {                
9
+  // initialize the digital pin as an output.
10
+  // Pin 13 has an LED connected on most Arduino boards:
11
+  pinMode(13, OUTPUT);     
12
+}
13
+
14
+void loop() {
15
+  digitalWrite(13, HIGH);   // set the LED on
16
+  delay(1000);              // wait for a second
17
+  digitalWrite(13, LOW);    // set the LED off
18
+  delay(1000);              // wait for a second
19
+}

+ 5
- 0
examples/Blink/Makefile View File

@@ -0,0 +1,5 @@
1
+BOARD_TAG    = uno
2
+ARDUINO_LIBS =
3
+
4
+include ../../Arduino.mk
5
+

+ 19
- 0
examples/BlinkChipKIT/BlinkChipKIT.pde View File

@@ -0,0 +1,19 @@
1
+/*
2
+  Blink
3
+  Turns on an LED on for one second, then off for one second, repeatedly.
4
+ 
5
+  This example code is in the public domain.
6
+ */
7
+
8
+void setup() {                
9
+  // initialize the digital pin as an output.
10
+  // Pin 13 has an LED connected on most Arduino boards:
11
+  pinMode(13, OUTPUT);     
12
+}
13
+
14
+void loop() {
15
+  digitalWrite(13, HIGH);   // set the LED on
16
+  delay(1000);              // wait for a second
17
+  digitalWrite(13, LOW);    // set the LED off
18
+  delay(1000);              // wait for a second
19
+}

+ 5
- 0
examples/BlinkChipKIT/Makefile View File

@@ -0,0 +1,5 @@
1
+BOARD_TAG    = mega_pic32
2
+ARDUINO_LIBS =
3
+
4
+include ../../chipKIT.mk
5
+

+ 16
- 0
examples/BlinkInAVRC/Makefile View File

@@ -0,0 +1,16 @@
1
+# This sample Makefile, explains how you can compile plain AVR C file.
2
+#
3
+# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile
4
+
5
+NO_CORE = Yes
6
+
7
+BOARD_TAG    = atmega16
8
+MCU = atmega16
9
+F_CPU = 8000000L
10
+
11
+ISP_PROG   = stk500v1
12
+AVRDUDE_ISP_BAUDRATE = 19200
13
+
14
+include $(ARDMK_DIR)/Arduino.mk
15
+
16
+# !!! Important. You have to use make ispload to upload when using ISP programmer

+ 38
- 0
examples/BlinkInAVRC/blink.c View File

@@ -0,0 +1,38 @@
1
+/*
2
+ * © Anil Kumar Pugalia, 2010. Email: email@sarika-pugs.com
3
+ *
4
+ * ATmega48/88/168, ATmega16/32
5
+ * 
6
+ * Example Blink. Toggles all IO pins at 1Hz
7
+ */
8
+
9
+#include <avr/io.h>
10
+#include <util/delay.h>
11
+
12
+void init_io(void)
13
+{
14
+	// 1 = output, 0 = input
15
+	DDRB = 0b11111111; // All outputs
16
+	DDRC = 0b11111111; // All outputs
17
+	DDRD = 0b11111110; // PORTD (RX on PD0). Just for demo
18
+}
19
+
20
+int main(void)
21
+{
22
+	init_io();
23
+
24
+	while (1)
25
+	{
26
+		PORTC = 0xFF;
27
+		PORTB = 0xFF;
28
+		PORTD = 0xFF;
29
+		_delay_ms(500);
30
+
31
+		PORTC = 0x00;
32
+		PORTB = 0x00;
33
+		PORTD = 0x00;
34
+		_delay_ms(500);
35
+	}
36
+
37
+	return 0;
38
+}

+ 65
- 0
examples/BlinkWithoutDelay/BlinkWithoutDelay.ino View File

@@ -0,0 +1,65 @@
1
+/* Blink without Delay
2
+ 
3
+ Turns on and off a light emitting diode(LED) connected to a digital  
4
+ pin, without using the delay() function.  This means that other code
5
+ can run at the same time without being interrupted by the LED code.
6
+ 
7
+ The circuit:
8
+ * LED attached from pin 13 to ground.
9
+ * Note: on most Arduinos, there is already an LED on the board
10
+ that's attached to pin 13, so no hardware is needed for this example.
11
+ 
12
+ 
13
+ created 2005
14
+ by David A. Mellis
15
+ modified 8 Feb 2010
16
+ by Paul Stoffregen
17
+ 
18
+ This example code is in the public domain.
19
+
20
+ 
21
+ http://www.arduino.cc/en/Tutorial/BlinkWithoutDelay
22
+ */
23
+
24
+// constants won't change. Used here to 
25
+// set pin numbers:
26
+const int ledPin =  13;      // the number of the LED pin
27
+
28
+// Variables will change:
29
+int ledState = LOW;             // ledState used to set the LED
30
+long previousMillis = 0;        // will store last time LED was updated
31
+
32
+// the follow variables is a long because the time, measured in miliseconds,
33
+// will quickly become a bigger number than can be stored in an int.
34
+long interval = 1000;           // interval at which to blink (milliseconds)
35
+
36
+void setup() {
37
+  // set the digital pin as output:
38
+  pinMode(ledPin, OUTPUT);      
39
+}
40
+
41
+void loop()
42
+{
43
+  // here is where you'd put code that needs to be running all the time.
44
+
45
+  // check to see if it's time to blink the LED; that is, if the 
46
+  // difference between the current time and last time you blinked 
47
+  // the LED is bigger than the interval at which you want to 
48
+  // blink the LED.
49
+  unsigned long currentMillis = millis();
50
+ 
51
+  if(currentMillis - previousMillis > interval) {
52
+    // save the last time you blinked the LED 
53
+    previousMillis = currentMillis;   
54
+
55
+    // if the LED is off turn it on and vice-versa:
56
+    if (ledState == LOW)
57
+      ledState = HIGH;
58
+    else
59
+      ledState = LOW;
60
+
61
+    // set the LED with the ledState of the variable:
62
+    digitalWrite(ledPin, ledState);
63
+  }
64
+}
65
+

+ 4
- 0
examples/BlinkWithoutDelay/Makefile View File

@@ -0,0 +1,4 @@
1
+BOARD_TAG    = uno
2
+ARDUINO_LIBS =
3
+
4
+include ../../Arduino.mk

+ 31
- 0
examples/Fade/Fade.ino View File

@@ -0,0 +1,31 @@
1
+/*
2
+ Fade
3
+ 
4
+ This example shows how to fade an LED on pin 9
5
+ using the analogWrite() function.
6
+ 
7
+ This example code is in the public domain.
8
+ 
9
+ */
10
+int brightness = 0;    // how bright the LED is
11
+int fadeAmount = 5;    // how many points to fade the LED by
12
+
13
+void setup()  { 
14
+  // declare pin 9 to be an output:
15
+  pinMode(9, OUTPUT);
16
+} 
17
+
18
+void loop()  { 
19
+  // set the brightness of pin 9:
20
+  analogWrite(9, brightness);    
21
+
22
+  // change the brightness for next time through the loop:
23
+  brightness = brightness + fadeAmount;
24
+
25
+  // reverse the direction of the fading at the ends of the fade: 
26
+  if (brightness == 0 || brightness == 255) {
27
+    fadeAmount = -fadeAmount ; 
28
+  }     
29
+  // wait for 30 milliseconds to see the dimming effect    
30
+  delay(30);                            
31
+}

+ 4
- 0
examples/Fade/Makefile View File

@@ -0,0 +1,4 @@
1
+BOARD_TAG    = uno
2
+ARDUINO_LIBS =
3
+
4
+include ../../Arduino.mk

+ 58
- 0
examples/HelloWorld/HelloWorld.ino View File

@@ -0,0 +1,58 @@
1
+/*
2
+  LiquidCrystal Library - Hello World
3
+ 
4
+ Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
5
+ library works with all LCD displays that are compatible with the 
6
+ Hitachi HD44780 driver. There are many of them out there, and you
7
+ can usually tell them by the 16-pin interface.
8
+ 
9
+ This sketch prints "Hello World!" to the LCD
10
+ and shows the time.
11
+ 
12
+  The circuit:
13
+ * LCD RS pin to digital pin 12
14
+ * LCD Enable pin to digital pin 11
15
+ * LCD D4 pin to digital pin 5
16
+ * LCD D5 pin to digital pin 4
17
+ * LCD D6 pin to digital pin 3
18
+ * LCD D7 pin to digital pin 2
19
+ * LCD R/W pin to ground
20
+ * 10K resistor:
21
+ * ends to +5V and ground
22
+ * wiper to LCD VO pin (pin 3)
23
+ 
24
+ Library originally added 18 Apr 2008
25
+ by David A. Mellis
26
+ library modified 5 Jul 2009
27
+ by Limor Fried (http://www.ladyada.net)
28
+ example added 9 Jul 2009
29
+ by Tom Igoe
30
+ modified 22 Nov 2010
31
+ by Tom Igoe
32
+ 
33
+ This example code is in the public domain.
34
+
35
+ http://www.arduino.cc/en/Tutorial/LiquidCrystal
36
+ */
37
+
38
+// include the library code:
39
+#include <LiquidCrystal.h>
40
+
41
+// initialize the library with the numbers of the interface pins
42
+LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
43
+
44
+void setup() {
45
+  // set up the LCD's number of columns and rows: 
46
+  lcd.begin(16, 2);
47
+  // Print a message to the LCD.
48
+  lcd.print("hello, world!");
49
+}
50
+
51
+void loop() {
52
+  // set the cursor to column 0, line 1
53
+  // (note: line 1 is the second row, since counting begins with 0):
54
+  lcd.setCursor(0, 1);
55
+  // print the number of seconds since reset:
56
+  lcd.print(millis()/1000);
57
+}
58
+

+ 4
- 0
examples/HelloWorld/Makefile View File

@@ -0,0 +1,4 @@
1
+BOARD_TAG    = uno
2
+ARDUINO_LIBS = LiquidCrystal
3
+
4
+include ../../Arduino.mk

+ 55
- 0
examples/MakefileExample/Makefile-example.mk View File

@@ -0,0 +1,55 @@
1
+### DISCLAIMER
2
+### This is an example Makefile and it MUST be configured to suit your needs.
3
+### For detailled explanations about all the avalaible options,
4
+### please refer to https://github.com/sudar/Arduino-Makefile/blob/master/arduino-mk-vars.md
5
+
6
+### PROJECT_DIR
7
+### This is the path to where you have created/cloned your project
8
+PROJECT_DIR       = /Users/Ladislas/dev/leka/moti
9
+
10
+### ARDMK_DIR
11
+### Path to the Arduino-Makefile directory.
12
+ARDMK_DIR         = $(PROJECT_DIR)/arduino-mk
13
+
14
+### ARDUINO_DIR
15
+### Path to the Arduino application and ressources directory.
16
+ARDUINO_DIR       = /Applications/Arduino.app/Contents/Resources/Java
17
+
18
+### USER_LIB_PATH
19
+### Path to where the your project's libraries are stored.
20
+USER_LIB_PATH     :=  $(PROJECT_DIR)/lib
21
+
22
+### BOARD_TAG
23
+### It must be set to the board you are currently using. (i.e uno, mega2560, etc.)
24
+BOARD_TAG         = mega2560
25
+
26
+### MONITOR_BAUDRATE
27
+### It must be set to Serial baudrate value you are using.
28
+MONITOR_BAUDRATE  = 115200
29
+
30
+### AVR_TOOLS_DIR
31
+### Path to the AVR tools directory such as avr-gcc, avr-g++, etc.
32
+AVR_TOOLS_DIR     = /usr/local
33
+
34
+### AVRDDUDE
35
+### Path to avrdude directory.
36
+AVRDDUDE          = /usr/local/bin/avrdude
37
+
38
+### CPPFLAGS
39
+### Flags you might want to set for debugging purpose. Comment to stop.
40
+CPPFLAGS         = -pedantic -Wall -Wextra
41
+
42
+### MONITOR_PORT
43
+### The port your board is connected to. Using an '*' tries all the ports and finds the right one.
44
+MONITOR_PORT      = /dev/tty.usbmodem*
45
+
46
+### don't touch this
47
+CURRENT_DIR       = $(shell basename $(CURDIR))
48
+
49
+### OBJDIR
50
+### This is were you put the binaries you just compile using 'make'
51
+OBJDIR            = $(PROJECT_DIR)/bin/$(BOARD_TAG)/$(CURRENT_DIR)
52
+
53
+### path to Arduino.mk, inside the ARDMK_DIR, don't touch.
54
+include $(ARDMK_DIR)/Arduino.mk
55
+

+ 7
- 0
examples/README.md View File

@@ -0,0 +1,7 @@
1
+This folder contains the list of example Arduino sketches and makefile showing the different usage patterns
2
+
3
+- Blink - Shows normal usage
4
+- HelloWorld - Shows how to include Arduino libraries
5
+- BlinkInAVRC - Shows how to use plain AVR C code
6
+- BlinkChipKIT - Shows how to use ChipKIT
7
+- ATtinyBlink - Shows how to use different cores like ATtiny

+ 14
- 0
examples/TinySoftWareSerial/Makefile View File

@@ -0,0 +1,14 @@
1
+# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile
2
+
3
+# if you have placed the alternate core in your sketchbook directory, then you can just mention the core name alone.
4
+ALTERNATE_CORE = attiny
5
+# If not, you might have to include the full path.
6
+#ALTERNATE_CORE_PATH = /home/sudar/Dropbox/code/arduino-sketches/hardware/attiny/
7
+
8
+BOARD_TAG    = attiny85-8
9
+
10
+ARDUINO_LIBS = SoftwareSerial
11
+
12
+include $(ARDMK_DIR)/Arduino.mk
13
+
14
+# !!! Important. You have to use make ispload to upload when using ISP programmer

+ 12
- 0
examples/TinySoftWareSerial/TinySoftwareSerial.ino View File

@@ -0,0 +1,12 @@
1
+#include <SoftwareSerial.h>
2
+
3
+SoftwareSerial mySerial(3, 4); // RX, TX
4
+
5
+void setup() {  
6
+    mySerial.begin(9600);
7
+}
8
+
9
+void loop() {
10
+    mySerial.println(millis()); 
11
+    delay(1000);
12
+}

+ 6
- 0
examples/WebServer/Makefile View File

@@ -0,0 +1,6 @@
1
+# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile
2
+
3
+BOARD_TAG    = uno
4
+ARDUINO_LIBS = Ethernet SPI
5
+
6
+include ../../Arduino.mk

+ 82
- 0
examples/WebServer/WebServer.ino View File

@@ -0,0 +1,82 @@
1
+/*
2
+  Web Server
3
+ 
4
+ A simple web server that shows the value of the analog input pins.
5
+ using an Arduino Wiznet Ethernet shield. 
6
+ 
7
+ Circuit:
8
+ * Ethernet shield attached to pins 10, 11, 12, 13
9
+ * Analog inputs attached to pins A0 through A5 (optional)
10
+ 
11
+ created 18 Dec 2009
12
+ by David A. Mellis
13
+ modified 4 Sep 2010
14
+ by Tom Igoe
15
+ 
16
+ */
17
+
18
+#include <SPI.h>
19
+#include <Ethernet.h>
20
+
21
+// Enter a MAC address and IP address for your controller below.
22
+// The IP address will be dependent on your local network:
23
+byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
24
+IPAddress ip(192,168,1, 178);
25
+
26
+// Initialize the Ethernet server library
27
+// with the IP address and port you want to use 
28
+// (port 80 is default for HTTP):
29
+EthernetServer server(80);
30
+
31
+void setup()
32
+{
33
+  // start the Ethernet connection and the server:
34
+  Ethernet.begin(mac, ip);
35
+  server.begin();
36
+}
37
+
38
+void loop()
39
+{
40
+  // listen for incoming clients
41
+  EthernetClient client = server.available();
42
+  if (client) {
43
+    // an http request ends with a blank line
44
+    boolean currentLineIsBlank = true;
45
+    while (client.connected()) {
46
+      if (client.available()) {
47
+        char c = client.read();
48
+        // if you've gotten to the end of the line (received a newline
49
+        // character) and the line is blank, the http request has ended,
50
+        // so you can send a reply
51
+        if (c == '\n' && currentLineIsBlank) {
52
+          // send a standard http response header
53
+          client.println("HTTP/1.1 200 OK");
54
+          client.println("Content-Type: text/html");
55
+          client.println();
56
+
57
+          // output the value of each analog input pin
58
+          for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
59
+            client.print("analog input ");
60
+            client.print(analogChannel);
61
+            client.print(" is ");
62
+            client.print(analogRead(analogChannel));
63
+            client.println("<br />");
64
+          }
65
+          break;
66
+        }
67
+        if (c == '\n') {
68
+          // you're starting a new line
69
+          currentLineIsBlank = true;
70
+        } 
71
+        else if (c != '\r') {
72
+          // you've gotten a character on the current line
73
+          currentLineIsBlank = false;
74
+        }
75
+      }
76
+    }
77
+    // give the web browser time to receive the data
78
+    delay(1);
79
+    // close the connection:
80
+    client.stop();
81
+  }
82
+}

+ 6
- 0
examples/master_reader/Makefile View File

@@ -0,0 +1,6 @@
1
+# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile
2
+
3
+BOARD_TAG    = uno
4
+ARDUINO_LIBS = Wire
5
+
6
+include ../../Arduino.mk

+ 32
- 0
examples/master_reader/master_reader.ino View File

@@ -0,0 +1,32 @@
1
+// Wire Master Reader
2
+// by Nicholas Zambetti <http://www.zambetti.com>
3
+
4
+// Demonstrates use of the Wire library
5
+// Reads data from an I2C/TWI slave device
6
+// Refer to the "Wire Slave Sender" example for use with this
7
+
8
+// Created 29 March 2006
9
+
10
+// This example code is in the public domain.
11
+
12
+
13
+#include <Wire.h>
14
+
15
+void setup()
16
+{
17
+  Wire.begin();        // join i2c bus (address optional for master)
18
+  Serial.begin(9600);  // start serial for output
19
+}
20
+
21
+void loop()
22
+{
23
+  Wire.requestFrom(2, 6);    // request 6 bytes from slave device #2
24
+
25
+  while(Wire.available())    // slave may send less than requested
26
+  { 
27
+    char c = Wire.read(); // receive a byte as character
28
+    Serial.print(c);         // print the character
29
+  }
30
+
31
+  delay(500);
32
+}

+ 4
- 0
examples/toneMelody/Makefile View File

@@ -0,0 +1,4 @@
1
+BOARD_TAG    = uno
2
+ARDUINO_LIBS =
3
+
4
+include ../../Arduino.mk

+ 95
- 0
examples/toneMelody/pitches.h View File

@@ -0,0 +1,95 @@
1
+/*************************************************
2
+ * Public Constants
3
+ *************************************************/
4
+
5
+#define NOTE_B0  31
6
+#define NOTE_C1  33
7
+#define NOTE_CS1 35
8
+#define NOTE_D1  37
9
+#define NOTE_DS1 39
10
+#define NOTE_E1  41
11
+#define NOTE_F1  44
12
+#define NOTE_FS1 46
13
+#define NOTE_G1  49
14
+#define NOTE_GS1 52
15
+#define NOTE_A1  55
16
+#define NOTE_AS1 58
17
+#define NOTE_B1  62
18
+#define NOTE_C2  65
19
+#define NOTE_CS2 69
20
+#define NOTE_D2  73
21
+#define NOTE_DS2 78
22
+#define NOTE_E2  82
23
+#define NOTE_F2  87
24
+#define NOTE_FS2 93
25
+#define NOTE_G2  98
26
+#define NOTE_GS2 104
27
+#define NOTE_A2  110
28
+#define NOTE_AS2 117
29
+#define NOTE_B2  123
30
+#define NOTE_C3  131
31
+#define NOTE_CS3 139
32
+#define NOTE_D3  147
33
+#define NOTE_DS3 156
34
+#define NOTE_E3  165
35
+#define NOTE_F3  175
36
+#define NOTE_FS3 185
37
+#define NOTE_G3  196
38
+#define NOTE_GS3 208
39
+#define NOTE_A3  220
40
+#define NOTE_AS3 233
41
+#define NOTE_B3  247
42
+#define NOTE_C4  262
43
+#define NOTE_CS4 277
44
+#define NOTE_D4  294
45
+#define NOTE_DS4 311
46
+#define NOTE_E4  330
47
+#define NOTE_F4  349
48
+#define NOTE_FS4 370
49
+#define NOTE_G4  392
50
+#define NOTE_GS4 415
51
+#define NOTE_A4  440
52
+#define NOTE_AS4 466
53
+#define NOTE_B4  494
54
+#define NOTE_C5  523
55
+#define NOTE_CS5 554
56
+#define NOTE_D5  587
57
+#define NOTE_DS5 622
58
+#define NOTE_E5  659
59
+#define NOTE_F5  698
60
+#define NOTE_FS5 740
61
+#define NOTE_G5  784
62
+#define NOTE_GS5 831
63
+#define NOTE_A5  880
64
+#define NOTE_AS5 932
65
+#define NOTE_B5  988
66
+#define NOTE_C6  1047
67
+#define NOTE_CS6 1109
68
+#define NOTE_D6  1175
69
+#define NOTE_DS6 1245
70
+#define NOTE_E6  1319
71
+#define NOTE_F6  1397
72
+#define NOTE_FS6 1480
73
+#define NOTE_G6  1568
74
+#define NOTE_GS6 1661
75
+#define NOTE_A6  1760
76
+#define NOTE_AS6 1865
77
+#define NOTE_B6  1976
78
+#define NOTE_C7  2093
79
+#define NOTE_CS7 2217
80
+#define NOTE_D7  2349
81
+#define NOTE_DS7 2489
82
+#define NOTE_E7  2637
83
+#define NOTE_F7  2794
84
+#define NOTE_FS7 2960
85
+#define NOTE_G7  3136
86
+#define NOTE_GS7 3322
87
+#define NOTE_A7  3520
88
+#define NOTE_AS7 3729
89
+#define NOTE_B7  3951
90
+#define NOTE_C8  4186
91
+#define NOTE_CS8 4435
92
+#define NOTE_D8  4699
93
+#define NOTE_DS8 4978
94
+
95
+

+ 49
- 0
examples/toneMelody/toneMelody.ino View File

@@ -0,0 +1,49 @@
1
+/*
2
+  Melody
3
+ 
4
+ Plays a melody 
5
+ 
6
+ circuit:
7
+ * 8-ohm speaker on digital pin 8
8
+ 
9
+ created 21 Jan 2010
10
+ modified 30 Aug 2011
11
+ by Tom Igoe 
12
+
13
+This example code is in the public domain.
14
+ 
15
+ http://arduino.cc/en/Tutorial/Tone
16
+ 
17
+ */
18
+ #include "pitches.h"
19
+
20
+// notes in the melody:
21
+int melody[] = {
22
+  NOTE_C4, NOTE_G3,NOTE_G3, NOTE_A3, NOTE_G3,0, NOTE_B3, NOTE_C4};
23
+
24
+// note durations: 4 = quarter note, 8 = eighth note, etc.:
25
+int noteDurations[] = {
26
+  4, 8, 8, 4,4,4,4,4 };
27
+
28
+void setup() {
29
+  // iterate over the notes of the melody:
30
+  for (int thisNote = 0; thisNote < 8; thisNote++) {
31
+
32
+    // to calculate the note duration, take one second 
33
+    // divided by the note type.
34
+    //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
35
+    int noteDuration = 1000/noteDurations[thisNote];
36
+    tone(8, melody[thisNote],noteDuration);
37
+
38
+    // to distinguish the notes, set a minimum time between them.
39
+    // the note's duration + 30% seems to work well:
40
+    int pauseBetweenNotes = noteDuration * 1.30;
41
+    delay(pauseBetweenNotes);
42
+    // stop the tone playing:
43
+    noTone(8);
44
+  }
45
+}
46
+
47
+void loop() {
48
+  // no need to repeat the melody.
49
+}

+ 502
- 0
licence.txt View File

@@ -0,0 +1,502 @@
1
+                  GNU LESSER GENERAL PUBLIC LICENSE
2
+                       Version 2.1, February 1999
3
+
4
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+[This is the first released version of the Lesser GPL.  It also counts
10
+ as the successor of the GNU Library Public License, version 2, hence
11
+ the version number 2.1.]
12
+
13
+                            Preamble
14
+
15
+  The licenses for most software are designed to take away your
16
+freedom to share and change it.  By contrast, the GNU General Public
17
+Licenses are intended to guarantee your freedom to share and change
18
+free software--to make sure the software is free for all its users.
19
+
20
+  This license, the Lesser General Public License, applies to some
21
+specially designated software packages--typically libraries--of the
22
+Free Software Foundation and other authors who decide to use it.  You
23
+can use it too, but we suggest you first think carefully about whether
24
+this license or the ordinary General Public License is the better
25
+strategy to use in any particular case, based on the explanations below.
26
+
27
+  When we speak of free software, we are referring to freedom of use,
28
+not price.  Our General Public Licenses are designed to make sure that
29
+you have the freedom to distribute copies of free software (and charge
30
+for this service if you wish); that you receive source code or can get
31
+it if you want it; that you can change the software and use pieces of
32
+it in new free programs; and that you are informed that you can do
33
+these things.
34
+
35
+  To protect your rights, we need to make restrictions that forbid
36
+distributors to deny you these rights or to ask you to surrender these
37
+rights.  These restrictions translate to certain responsibilities for
38
+you if you distribute copies of the library or if you modify it.
39
+
40
+  For example, if you distribute copies of the library, whether gratis
41
+or for a fee, you must give the recipients all the rights that we gave
42
+you.  You must make sure that they, too, receive or can get the source
43
+code.  If you link other code with the library, you must provide
44
+complete object files to the recipients, so that they can relink them
45
+with the library after making changes to the library and recompiling
46
+it.  And you must show them these terms so they know their rights.
47
+
48
+  We protect your rights with a two-step method: (1) we copyright the
49
+library, and (2) we offer you this license, which gives you legal
50
+permission to copy, distribute and/or modify the library.
51
+
52
+  To protect each distributor, we want to make it very clear that
53
+there is no warranty for the free library.  Also, if the library is
54
+modified by someone else and passed on, the recipients should know
55
+that what they have is not the original version, so that the original
56
+author's reputation will not be affected by problems that might be
57
+introduced by others.
58
+
59
+  Finally, software patents pose a constant threat to the existence of
60
+any free program.  We wish to make sure that a company cannot
61
+effectively restrict the users of a free program by obtaining a
62
+restrictive license from a patent holder.  Therefore, we insist that
63
+any patent license obtained for a version of the library must be
64
+consistent with the full freedom of use specified in this license.
65
+
66
+  Most GNU software, including some libraries, is covered by the
67
+ordinary GNU General Public License.  This license, the GNU Lesser
68
+General Public License, applies to certain designated libraries, and
69
+is quite different from the ordinary General Public License.  We use
70
+this license for certain libraries in order to permit linking those
71
+libraries into non-free programs.
72
+
73
+  When a program is linked with a library, whether statically or using
74
+a shared library, the combination of the two is legally speaking a
75
+combined work, a derivative of the original library.  The ordinary
76
+General Public License therefore permits such linking only if the
77
+entire combination fits its criteria of freedom.  The Lesser General
78
+Public License permits more lax criteria for linking other code with
79
+the library.
80
+
81
+  We call this license the "Lesser" General Public License because it
82
+does Less to protect the user's freedom than the ordinary General
83
+Public License.  It also provides other free software developers Less
84
+of an advantage over competing non-free programs.  These disadvantages
85
+are the reason we use the ordinary General Public License for many
86
+libraries.  However, the Lesser license provides advantages in certain
87
+special circumstances.
88
+
89
+  For example, on rare occasions, there may be a special need to
90
+encourage the widest possible use of a certain library, so that it becomes
91
+a de-facto standard.  To achieve this, non-free programs must be
92
+allowed to use the library.  A more frequent case is that a free
93
+library does the same job as widely used non-free libraries.  In this
94
+case, there is little to gain by limiting the free library to free
95
+software only, so we use the Lesser General Public License.
96
+
97
+  In other cases, permission to use a particular library in non-free
98
+programs enables a greater number of people to use a large body of
99
+free software.  For example, permission to use the GNU C Library in
100
+non-free programs enables many more people to use the whole GNU
101
+operating system, as well as its variant, the GNU/Linux operating
102
+system.
103
+
104
+  Although the Lesser General Public License is Less protective of the
105
+users' freedom, it does ensure that the user of a program that is
106
+linked with the Library has the freedom and the wherewithal to run
107
+that program using a modified version of the Library.
108
+
109
+  The precise terms and conditions for copying, distribution and
110
+modification follow.  Pay close attention to the difference between a
111
+"work based on the library" and a "work that uses the library".  The
112
+former contains code derived from the library, whereas the latter must
113
+be combined with the library in order to run.
114
+
115
+                  GNU LESSER GENERAL PUBLIC LICENSE
116
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
117
+
118
+  0. This License Agreement applies to any software library or other
119
+program which contains a notice placed by the copyright holder or
120
+other authorized party saying it may be distributed under the terms of
121
+this Lesser General Public License (also called "this License").
122
+Each licensee is addressed as "you".
123
+
124
+  A "library" means a collection of software functions and/or data
125
+prepared so as to be conveniently linked with application programs
126
+(which use some of those functions and data) to form executables.
127
+
128
+  The "Library", below, refers to any such software library or work
129
+which has been distributed under these terms.  A "work based on the
130
+Library" means either the Library or any derivative work under
131
+copyright law: that is to say, a work containing the Library or a
132
+portion of it, either verbatim or with modifications and/or translated
133
+straightforwardly into another language.  (Hereinafter, translation is
134
+included without limitation in the term "modification".)
135
+
136
+  "Source code" for a work means the preferred form of the work for
137
+making modifications to it.  For a library, complete source code means
138
+all the source code for all modules it contains, plus any associated
139
+interface definition files, plus the scripts used to control compilation
140
+and installation of the library.
141
+
142
+  Activities other than copying, distribution and modification are not
143
+covered by this License; they are outside its scope.  The act of
144
+running a program using the Library is not restricted, and output from
145
+such a program is covered only if its contents constitute a work based
146
+on the Library (independent of the use of the Library in a tool for
147
+writing it).  Whether that is true depends on what the Library does
148
+and what the program that uses the Library does.
149
+
150
+  1. You may copy and distribute verbatim copies of the Library's
151
+complete source code as you receive it, in any medium, provided that
152
+you conspicuously and appropriately publish on each copy an
153
+appropriate copyright notice and disclaimer of warranty; keep intact
154
+all the notices that refer to this License and to the absence of any
155
+warranty; and distribute a copy of this License along with the
156
+Library.
157
+
158
+  You may charge a fee for the physical act of transferring a copy,
159
+and you may at your option offer warranty protection in exchange for a
160
+fee.
161
+
162
+  2. You may modify your copy or copies of the Library or any portion
163
+of it, thus forming a work based on the Library, and copy and
164
+distribute such modifications or work under the terms of Section 1
165
+above, provided that you also meet all of these conditions:
166
+
167
+    a) The modified work must itself be a software library.
168
+
169
+    b) You must cause the files modified to carry prominent notices
170
+    stating that you changed the files and the date of any change.
171
+
172
+    c) You must cause the whole of the work to be licensed at no
173
+    charge to all third parties under the terms of this License.
174
+
175
+    d) If a facility in the modified Library refers to a function or a
176
+    table of data to be supplied by an application program that uses
177
+    the facility, other than as an argument passed when the facility
178
+    is invoked, then you must make a good faith effort to ensure that,
179
+    in the event an application does not supply such function or
180
+    table, the facility still operates, and performs whatever part of
181
+    its purpose remains meaningful.
182
+
183
+    (For example, a function in a library to compute square roots has
184
+    a purpose that is entirely well-defined independent of the
185
+    application.  Therefore, Subsection 2d requires that any
186
+    application-supplied function or table used by this function must
187
+    be optional: if the application does not supply it, the square
188
+    root function must still compute square roots.)
189
+
190
+These requirements apply to the modified work as a whole.  If
191
+identifiable sections of that work are not derived from the Library,
192
+and can be reasonably considered independent and separate works in
193
+themselves, then this License, and its terms, do not apply to those
194
+sections when you distribute them as separate works.  But when you
195
+distribute the same sections as part of a whole which is a work based
196
+on the Library, the distribution of the whole must be on the terms of
197
+this License, whose permissions for other licensees extend to the
198
+entire whole, and thus to each and every part regardless of who wrote
199
+it.
200
+
201
+Thus, it is not the intent of this section to claim rights or contest
202
+your rights to work written entirely by you; rather, the intent is to
203
+exercise the right to control the distribution of derivative or
204
+collective works based on the Library.
205
+
206
+In addition, mere aggregation of another work not based on the Library
207
+with the Library (or with a work based on the Library) on a volume of
208
+a storage or distribution medium does not bring the other work under
209
+the scope of this License.
210
+
211
+  3. You may opt to apply the terms of the ordinary GNU General Public
212
+License instead of this License to a given copy of the Library.  To do
213
+this, you must alter all the notices that refer to this License, so
214
+that they refer to the ordinary GNU General Public License, version 2,
215
+instead of to this License.  (If a newer version than version 2 of the
216
+ordinary GNU General Public License has appeared, then you can specify
217
+that version instead if you wish.)  Do not make any other change in
218
+these notices.
219
+
220
+  Once this change is made in a given copy, it is irreversible for
221
+that copy, so the ordinary GNU General Public License applies to all
222
+subsequent copies and derivative works made from that copy.
223
+
224
+  This option is useful when you wish to copy part of the code of
225
+the Library into a program that is not a library.
226
+
227
+  4. You may copy and distribute the Library (or a portion or
228
+derivative of it, under Section 2) in object code or executable form
229
+under the terms of Sections 1 and 2 above provided that you accompany
230
+it with the complete corresponding machine-readable source code, which
231
+must be distributed under the terms of Sections 1 and 2 above on a
232
+medium customarily used for software interchange.
233
+
234
+  If distribution of object code is made by offering access to copy
235
+from a designated place, then offering equivalent access to copy the
236
+source code from the same place satisfies the requirement to
237
+distribute the source code, even though third parties are not
238
+compelled to copy the source along with the object code.
239
+
240
+  5. A program that contains no derivative of any portion of the
241
+Library, but is designed to work with the Library by being compiled or
242
+linked with it, is called a "work that uses the Library".  Such a
243
+work, in isolation, is not a derivative work of the Library, and
244
+therefore falls outside the scope of this License.
245
+
246
+  However, linking a "work that uses the Library" with the Library
247
+creates an executable that is a derivative of the Library (because it
248
+contains portions of the Library), rather than a "work that uses the
249
+library".  The executable is therefore covered by this License.
250
+Section 6 states terms for distribution of such executables.
251
+
252
+  When a "work that uses the Library" uses material from a header file
253
+that is part of the Library, the object code for the work may be a
254
+derivative work of the Library even though the source code is not.
255
+Whether this is true is especially significant if the work can be
256
+linked without the Library, or if the work is itself a library.  The
257
+threshold for this to be true is not precisely defined by law.
258
+
259
+  If such an object file uses only numerical parameters, data
260
+structure layouts and accessors, and small macros and small inline
261
+functions (ten lines or less in length), then the use of the object
262
+file is unrestricted, regardless of whether it is legally a derivative
263
+work.  (Executables containing this object code plus portions of the
264
+Library will still fall under Section 6.)
265
+
266
+  Otherwise, if the work is a derivative of the Library, you may
267
+distribute the object code for the work under the terms of Section 6.
268
+Any executables containing that work also fall under Section 6,
269
+whether or not they are linked directly with the Library itself.
270
+
271
+  6. As an exception to the Sections above, you may also combine or
272
+link a "work that uses the Library" with the Library to produce a
273
+work containing portions of the Library, and distribute that work
274
+under terms of your choice, provided that the terms permit
275
+modification of the work for the customer's own use and reverse
276
+engineering for debugging such modifications.
277
+
278
+  You must give prominent notice with each copy of the work that the
279
+Library is used in it and that the Library and its use are covered by
280
+this License.  You must supply a copy of this License.  If the work
281
+during execution displays copyright notices, you must include the
282
+copyright notice for the Library among them, as well as a reference
283
+directing the user to the copy of this License.  Also, you must do one
284
+of these things:
285
+
286
+    a) Accompany the work with the complete corresponding
287
+    machine-readable source code for the Library including whatever
288
+    changes were used in the work (which must be distributed under
289
+    Sections 1 and 2 above); and, if the work is an executable linked
290
+    with the Library, with the complete machine-readable "work that
291
+    uses the Library", as object code and/or source code, so that the
292
+    user can modify the Library and then relink to produce a modified
293
+    executable containing the modified Library.  (It is understood
294
+    that the user who changes the contents of definitions files in the
295
+    Library will not necessarily be able to recompile the application
296
+    to use the modified definitions.)
297
+
298
+    b) Use a suitable shared library mechanism for linking with the
299
+    Library.  A suitable mechanism is one that (1) uses at run time a
300
+    copy of the library already present on the user's computer system,
301
+    rather than copying library functions into the executable, and (2)
302
+    will operate properly with a modified version of the library, if
303
+    the user installs one, as long as the modified version is
304
+    interface-compatible with the version that the work was made with.
305
+
306
+    c) Accompany the work with a written offer, valid for at
307
+    least three years, to give the same user the materials
308
+    specified in Subsection 6a, above, for a charge no more
309
+    than the cost of performing this distribution.
310
+
311
+    d) If distribution of the work is made by offering access to copy
312
+    from a designated place, offer equivalent access to copy the above
313
+    specified materials from the same place.
314
+
315
+    e) Verify that the user has already received a copy of these
316
+    materials or that you have already sent this user a copy.
317
+
318
+  For an executable, the required form of the "work that uses the
319
+Library" must include any data and utility programs needed for
320
+reproducing the executable from it.  However, as a special exception,
321
+the materials to be distributed need not include anything that is
322
+normally distributed (in either source or binary form) with the major
323
+components (compiler, kernel, and so on) of the operating system on
324
+which the executable runs, unless that component itself accompanies
325
+the executable.
326
+
327
+  It may happen that this requirement contradicts the license
328
+restrictions of other proprietary libraries that do not normally
329
+accompany the operating system.  Such a contradiction means you cannot
330
+use both them and the Library together in an executable that you
331
+distribute.
332
+
333
+  7. You may place library facilities that are a work based on the
334
+Library side-by-side in a single library together with other library
335
+facilities not covered by this License, and distribute such a combined
336
+library, provided that the separate distribution of the work based on
337
+the Library and of the other library facilities is otherwise
338
+permitted, and provided that you do these two things:
339
+
340
+    a) Accompany the combined library with a copy of the same work
341
+    based on the Library, uncombined with any other library
342
+    facilities.  This must be distributed under the terms of the
343
+    Sections above.
344
+
345
+    b) Give prominent notice with the combined library of the fact
346
+    that part of it is a work based on the Library, and explaining
347
+    where to find the accompanying uncombined form of the same work.
348
+
349
+  8. You may not copy, modify, sublicense, link with, or distribute
350
+the Library except as expressly provided under this License.  Any
351
+attempt otherwise to copy, modify, sublicense, link with, or
352
+distribute the Library is void, and will automatically terminate your
353
+rights under this License.  However, parties who have received copies,
354
+or rights, from you under this License will not have their licenses
355
+terminated so long as such parties remain in full compliance.
356
+
357
+  9. You are not required to accept this License, since you have not
358
+signed it.  However, nothing else grants you permission to modify or
359
+distribute the Library or its derivative works.  These actions are
360
+prohibited by law if you do not accept this License.  Therefore, by
361
+modifying or distributing the Library (or any work based on the
362
+Library), you indicate your acceptance of this License to do so, and
363
+all its terms and conditions for copying, distributing or modifying
364
+the Library or works based on it.
365
+
366
+  10. Each time you redistribute the Library (or any work based on the
367
+Library), the recipient automatically receives a license from the
368
+original licensor to copy, distribute, link with or modify the Library
369
+subject to these terms and conditions.  You may not impose any further
370
+restrictions on the recipients' exercise of the rights granted herein.
371
+You are not responsible for enforcing compliance by third parties with
372
+this License.
373
+
374
+  11. If, as a consequence of a court judgment or allegation of patent
375
+infringement or for any other reason (not limited to patent issues),
376
+conditions are imposed on you (whether by court order, agreement or
377
+otherwise) that contradict the conditions of this License, they do not
378
+excuse you from the conditions of this License.  If you cannot
379
+distribute so as to satisfy simultaneously your obligations under this
380
+License and any other pertinent obligations, then as a consequence you
381
+may not distribute the Library at all.  For example, if a patent
382
+license would not permit royalty-free redistribution of the Library by
383
+all those who receive copies directly or indirectly through you, then
384
+the only way you could satisfy both it and this License would be to
385
+refrain entirely from distribution of the Library.
386
+
387
+If any portion of this section is held invalid or unenforceable under any
388
+particular circumstance, the balance of the section is intended to apply,
389
+and the section as a whole is intended to apply in other circumstances.
390
+
391
+It is not the purpose of this section to induce you to infringe any
392
+patents or other property right claims or to contest validity of any
393
+such claims; this section has the sole purpose of protecting the
394
+integrity of the free software distribution system which is
395
+implemented by public license practices.  Many people have made
396
+generous contributions to the wide range of software distributed
397
+through that system in reliance on consistent application of that
398
+system; it is up to the author/donor to decide if he or she is willing
399
+to distribute software through any other system and a licensee cannot
400
+impose that choice.
401
+
402
+This section is intended to make thoroughly clear what is believed to
403
+be a consequence of the rest of this License.
404
+
405
+  12. If the distribution and/or use of the Library is restricted in
406
+certain countries either by patents or by copyrighted interfaces, the
407
+original copyright holder who places the Library under this License may add
408
+an explicit geographical distribution limitation excluding those countries,
409
+so that distribution is permitted only in or among countries not thus
410
+excluded.  In such case, this License incorporates the limitation as if
411
+written in the body of this License.
412
+
413
+  13. The Free Software Foundation may publish revised and/or new
414
+versions of the Lesser General Public License from time to time.
415
+Such new versions will be similar in spirit to the present version,
416
+but may differ in detail to address new problems or concerns.
417
+
418
+Each version is given a distinguishing version number.  If the Library
419
+specifies a version number of this License which applies to it and
420
+"any later version", you have the option of following the terms and
421
+conditions either of that version or of any later version published by
422
+the Free Software Foundation.  If the Library does not specify a
423
+license version number, you may choose any version ever published by
424
+the Free Software Foundation.
425
+
426
+  14. If you wish to incorporate parts of the Library into other free
427
+programs whose distribution conditions are incompatible with these,
428
+write to the author to ask for permission.  For software which is
429
+copyrighted by the Free Software Foundation, write to the Free
430
+Software Foundation; we sometimes make exceptions for this.  Our
431
+decision will be guided by the two goals of preserving the free status
432
+of all derivatives of our free software and of promoting the sharing
433
+and reuse of software generally.
434
+
435
+                            NO WARRANTY
436
+
437
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
438
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
439
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
440
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
441
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
442
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
443
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
444
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
445
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
446
+
447
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
448
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
449
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
450
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
451
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
452
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
453
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
454
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
455
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
456
+DAMAGES.
457
+
458
+                     END OF TERMS AND CONDITIONS
459
+
460
+           How to Apply These Terms to Your New Libraries
461
+
462
+  If you develop a new library, and you want it to be of the greatest
463
+possible use to the public, we recommend making it free software that
464
+everyone can redistribute and change.  You can do so by permitting
465
+redistribution under these terms (or, alternatively, under the terms of the
466
+ordinary General Public License).
467
+
468
+  To apply these terms, attach the following notices to the library.  It is
469
+safest to attach them to the start of each source file to most effectively
470
+convey the exclusion of warranty; and each file should have at least the
471
+"copyright" line and a pointer to where the full notice is found.
472
+
473
+    <one line to give the library's name and a brief idea of what it does.>
474
+    Copyright (C) <year>  <name of author>
475
+
476
+    This library is free software; you can redistribute it and/or
477
+    modify it under the terms of the GNU Lesser General Public
478
+    License as published by the Free Software Foundation; either
479
+    version 2.1 of the License, or (at your option) any later version.
480
+
481
+    This library is distributed in the hope that it will be useful,
482
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
483
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
484
+    Lesser General Public License for more details.
485
+
486
+    You should have received a copy of the GNU Lesser General Public
487
+    License along with this library; if not, write to the Free Software
488
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
489
+
490
+Also add information on how to contact you by electronic and paper mail.
491
+
492
+You should also get your employer (if you work as a programmer) or your
493
+school, if any, to sign a "copyright disclaimer" for the library, if
494
+necessary.  Here is a sample; alter the names:
495
+
496
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
497
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
498
+
499
+  <signature of Ty Coon>, 1 April 1990
500
+  Ty Coon, President of Vice
501
+
502
+That's all there is to it!

+ 23
- 0
packaging/debian/README.md View File

@@ -0,0 +1,23 @@
1
+# How to compile a Deb package
2
+
3
+Use these instructions to build your own Deb package from your local sources.
4
+For the latest official packages go to [Debian](http://packages.debian.org/arduino-mk)
5
+or [Ubuntu](https://launchpad.net/ubuntu/+source/arduino-mk) or use apt.
6
+
7
+First install the dependencies as root:
8
+
9
+    apt-get build-dep arduino-mk
10
+    apt-get install arduino-core build-essential dpkg-dev fakeroot devscripts
11
+
12
+Fetch the Debian source:
13
+
14
+    apt-get source arduino-mk
15
+
16
+Make any local changes to want within the arduino-mk-* directory and update the package version:
17
+
18
+    cd arduino-mk-*
19
+    dch -i
20
+
21
+Then compile. This will create a binary Deb:
22
+
23
+    dpkg-buildpackage -b

+ 39
- 0
packaging/fedora/README.md View File

@@ -0,0 +1,39 @@
1
+# How to compile an RPM
2
+
3
+First install the dependencies as root:
4
+
5
+    yum install arduino-core rpm-build
6
+
7
+From the top-level Arduino-Makefile directory you've checked out of github, run the following (as unprivileged user) to create a compressed tarball using the naming conventions required by rpmbuild:
8
+
9
+    git archive HEAD --prefix=arduino-mk-1.3.4/ -o ../arduino-mk-1.3.4.tar.gz
10
+
11
+If you don't already have a rpmbuild setup (e.g. you've not installed the SRPM) you will need to create the directories:
12
+
13
+    mkdir -p ~/rpmbuild/{SOURCES,SPECS}
14
+
15
+Then copy the tarball and specfile into those directories:
16
+
17
+    cp ../arduino-mk-1.3.4.tar.gz ~/rpmbuild/SOURCES/
18
+    cp packaging/fedora/arduino-mk.spec ~/rpmbuild/SPECS/
19
+
20
+Then compile. This will create a binary and source RPM:
21
+
22
+    cd ~/rpmbuild/SPECS/
23
+    rpmbuild -ba arduino-mk.spec
24
+
25
+Fedora's AVR compilers use ccache, so you may have to override some of the paths to the AVR tools in your sketch's Makefile, for example:
26
+
27
+```Makefile
28
+OVERRIDE_EXECUTABLES = 1
29
+CC      = /usr/lib64/ccache/$(CC_NAME)
30
+CXX     = /usr/lib64/ccache/$(CXX_NAME)
31
+AS      = /usr/bin/$(AS_NAME)
32
+OBJCOPY = /usr/bin/$(OBJCOPY_NAME)
33
+OBJDUMP = /usr/bin/$(OBJDUMP_NAME)
34
+AR      = /usr/bin/$(AR_NAME)
35
+SIZE    = /usr/bin/$(SIZE_NAME)
36
+NM      = /usr/bin/$(NM_NAME)
37
+```
38
+
39
+Or if you don't want to use ccache, then just set ```AVR_TOOLS_PATH=/usr``` and none of the above will be necessary.

+ 70
- 0
packaging/fedora/arduino-mk.spec View File

@@ -0,0 +1,70 @@
1
+Name:			arduino-mk
2
+Version:		1.3.4
3
+Release:		1%{dist}
4
+Summary:		Program your Arduino from the command line
5
+Packager:		Simon John <git@the-jedi.co.uk>
6
+URL:            https://github.com/sudar/Arduino-Makefile
7
+Source:         %{name}-%{version}.tar.gz
8
+Group:			Development/Tools
9
+License:		LGPLv2+
10
+BuildRoot:		%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
11
+BuildArch:		noarch
12
+Requires:		arduino-core pyserial
13
+BuildRequires:	arduino-core
14
+
15
+%description
16
+Arduino is an open-source electronics prototyping platform based on 
17
+flexible, easy-to-use hardware and software. It's intended for artists, 
18
+designers, hobbyists, and anyone interested in creating interactive 
19
+objects or environments.
20
+
21
+This package will install a Makefile to allow for CLI programming of the 
22
+Arduino platform.
23
+
24
+%prep
25
+%setup -q
26
+
27
+%install
28
+mkdir -p %{buildroot}/%{_datadir}/arduino
29
+mkdir -p %{buildroot}/%{_bindir}
30
+mkdir -p %{buildroot}/%{_mandir}/man1
31
+mkdir -p %{buildroot}/%{_docdir}/%{name}/examples
32
+install -m 755 -d %{buildroot}/%{_docdir}/%{name}
33
+install -m 755 -d %{buildroot}/%{_docdir}/%{name}/examples
34
+for dir in `find examples -type d` ; do install -m 755 -d %{buildroot}/%{_docdir}/%{name}/$dir ; done
35
+for file in `find examples -type f ! -name .gitignore` ; do install -m 644 $file %{buildroot}/%{_docdir}/%{name}/$file ; done
36
+install -m 644 *.mk arduino-mk-vars.md %{buildroot}/%{_datadir}/arduino
37
+install -m 644 licence.txt %{buildroot}/%{_docdir}/%{name}
38
+install -m 755 bin/ard-reset-arduino %{buildroot}/%{_bindir}/ard-reset-arduino
39
+install -m 644 ard-reset-arduino.1 %{buildroot}/%{_mandir}/man1
40
+
41
+%clean
42
+rm -rf %{buildroot}
43
+
44
+%files
45
+%defattr(-,root,root,-)
46
+%{_bindir}/ard-reset-arduino
47
+%{_mandir}/man1/ard-reset-arduino.1*
48
+%{_datadir}/arduino/*.mk
49
+%{_datadir}/arduino/arduino-mk-vars.md
50
+%doc %{_docdir}/%{name}/licence.txt
51
+%docdir %{_docdir}/%{name}/examples
52
+%{_docdir}/%{name}/examples
53
+
54
+%changelog
55
+* Sat Apr 12 2014 Simon John <git@the-jedi.co.uk>
56
+- Put manpage back.
57
+* Fri Apr 04 2014 Simon John <git@the-jedi.co.uk>
58
+- Removed BuildRequires of python3/pyserial.
59
+* Wed Apr 02 2014 Simon John <git@the-jedi.co.uk>
60
+- Added BuildRequires of python3-pyserial. Need to look into Requires.
61
+* Mon Mar 24 2014 Simon John <git@the-jedi.co.uk>
62
+- Replaced perl/help2man with pyserial for reset script.
63
+* Tue Feb 04 2014 Simon John <git@the-jedi.co.uk>
64
+- Added arduino-mk-vars.md to the files to be installed/packaged.
65
+* Sat Feb 01 2014 Simon John <git@the-jedi.co.uk>
66
+- Updated version.
67
+* Mon Jan 13 2014 Simon John <git@the-jedi.co.uk>
68
+- Removed arduino-mk subdirectory
69
+* Mon Dec 30 2013 Simon John <git@the-jedi.co.uk>
70
+- Initial release.

Loading…
Cancel
Save