Commit graph

163 commits

Author SHA1 Message Date
Gabrielius Mickevicius
3442ef8e6d Let 'build.core' from boards.txt change ARDUINO_CORE_PATH
This is support for https://code.google.com/p/arduino-tiny
The arduino-tiny project provides a boards.txt file and a whole
separate Arduino core modified to work with attinies.
Arduino.mk will now switch to that core if it finds a
'build.core' parameter in boards.txt and a folder in
$(ALTERNATE_CORE_PATH)/cores by that name.
2014-12-30 17:45:36 +02:00
Gabrielius Mickevicius
3754e5c012 Let user skip MONITOR_PORT existance check
Define FORCE_MONITOR_PORT to enable.
Useful if one uses 'ssh root@remotemachine avrdude' instead of the
usual AVRDUDE command.
2014-12-28 23:26:35 +02:00
Phil Hord
d998de8d84 Do not add '.' to gcc includes search path
Include files are searched for in the include search path made up
from, among other places, the -I switches given to the gcc compiler.
The . (dot) used for the current directory is not in the search
path when the IDE builds the project and does not seem to be needed
in any reasonable case.  Maybe it was included because someone thought
it meant to "search in the same directory as the file being compiled",
but I cannot tell because the switch was already included in the first
commit in this repo.  In any case, the current file directory is already
searched by gcc before the search path is consulted, in any case, so
this switch is not needed to cause this behavior.

Including the "-I."  switch causes compiles to fail when libraries
include a header which is coincidentally named the same as one of the
user headers.  For example, if the user has a Udp.h file in his sketch
folder, the compile will fail if it includes the EthernetUdp.h file.

A simple example is the examples/WebServer code. It fails if you do
this:

   touch examples/WebServer/Udp.h
   make -C examples/WebServer

But it builds ok from the IDE which does not include "." in the
search path.

Similarly, HelloWorld fails for the same reason if you do this:

   touch examples/HelloWorld/Print.h
   make -C examples/HelloWorld

Remove the -I. switch from the CPPFLAGS directive altogether to
prevent this include filename confusion and to more closely model
the behavior of the IDE.  Fixes #303.

It may also work to move the -I. to the end of the search path,
but this still would compile differently from the IDE and so it
is considered not to be a useful feature to retain in any case.

--

I did not add a test case here because it's not clear to me how it
should be added.  Should I modify HelloWorld as described above,
or should I add examples/TestSearchPath/ with the same files
explicitly for this test?  It would be clearer for me if there
was an explicit "tests" directory independent from "examples".
2014-12-07 18:53:03 -05:00
Simon John
9c9491d1cc Moved location of avrdude and avrdude.conf for 1.5.8 on Linux (only!)
Subject to change during the beta phase, as its already different
than 1.5.6, also may change when packaged for Debian (usually symlinked)

Fixes issue #301
2014-12-03 22:38:50 +00:00
Simon John
b45a163b9d Removed all double-quoting except for comments/echo's
Double-quoting was added in 7618da7 to allow for spaces in paths,
that was a bad idea as:

 1. most GNU Make functions can't handle spaces
 2. it breaks variable expansion on Linux/OSX e.g. ~/sketchbook
 3. Windows doesn't like double-quotes - see d5c7ed1

So basically, don't put spaces in your paths, as most Make functions
can't handle them, even if escaped, and its a bit dangerous when
shelling out to grep etc.

Single-quoting is no better either.
2014-11-29 22:31:49 +00:00
Peter Mosmans
78452da702 Added support for PuTTY on Windows
Use MONITOR_CMD=putty
The optional parameter MONITOR_PARMS can be used as well
2014-11-23 20:38:38 +10:00
Peter Mosmans
5f1a5a2ac0 Improved Windows (Cygwin/MSYS) support
Changed RESET_CMD structure under Cygwin
Changed behaviour of get_monitor_port under Windows

DEVICE_PATH always becomes/dev/ttyS[0-9] on Windows
MONITOR_PORT always becomes com[0-9] on Windows
2014-11-23 19:56:49 +10:00
Simon John
0df314249a Fix speed regression since 8d443f62c, faster than 1.3.4 now
Audited *some* use of := vs. =, when calling shell/foreach/wildcard,
could probably do with more looking into.
2014-11-10 23:19:00 +00:00
Thomas Hebb
05b57c3cc3 Allow avrdude to erase the chip before programming during ispload
We currently pass the -D (do not erase) option to avrdude
unconditionally in order to work around an Arduino Mega bootloader bug.
However, this has the side-effect of breaking the ispload target for all
non-XMEGA chips, since a write operation on these chips essentially ANDs
the new program with the existing memory contents. If the memory is not
first erased to contain only 0xff, the resulting image is garbage. This
patch makes it so we pass -D when we're using the Arduino bootloader but
don't pass it when we're using ISP directly.
2014-11-07 22:47:08 -05:00
Simon John
713997d602 Made CXX compile *.cpp files instead of CC.
Fixes issue #285
2014-11-05 15:09:43 +00:00
Sudar
73f08aad76 Merge pull request #282 from sej7278/master
Add "avrispmkii" to the list of ISP's that don't have a port.

Fix #279
2014-10-24 09:03:17 +05:30
Sudar
3eee9851bb Merge pull request #281 from stepcut/teensy.mk
Add support for Teensyduino 3.x
2014-10-24 09:02:51 +05:30
Simon John
a2c8fe5196 Add's "avrispmkii" to the list of ISP's that don't have a port,
defaults to reading communication_type from avrdude.conf, which
is "usb" usually, rather than setting the -P flag which is the
user override.
2014-10-23 23:44:14 +01:00
stepcut
6534cf8f15 move ARDUINO_DIR auto-detection into Common.mk. This allows Teensy.mk to use auto-detected location. 2014-10-22 15:27:59 -05:00
Sudar
8d443f62c8 Merge pull request #277 from lukasz-e/arduino-1.5.x-libs
Arduino 1.5.x libs - handle new library layout (issue #275) and hardware/vendor specific libs (issue #276)
2014-10-14 08:44:24 +05:30
Lukasz Engel
922a8d59bd do not print default (empty) ARDUINO_PLATFORM_LIB_PATH value for arduino 1.0.x 2014-10-13 21:36:29 +02:00
Lukasz Engel
c7219a12b9 remove unwanted TABs 2014-10-12 19:32:55 +02:00
Simon John
d5c7ed15f7 Replaced double quotes with singles when passing arguments to
avr-objcopy. Windows doesn't seem to like double quotes.

Fixes issue #272, thanks @vogt31337
2014-10-12 09:04:57 +01:00
Lukasz Engel
7b74e100ce Arduino 1.5.x - support new library layout and plaform specific system libs
- Add support for 1.5.x library layout.
  (https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification)

- Allow using Arduino 1.5.x platform specific system libraries.
  Arduino 1.5.x has additional directories for platform (vendor/architecture)
  specific libraries - look there when searching for libraries.
2014-10-11 23:56:02 +02:00
Simon John
6be2614c30 Removed Travis-CI references from all examples. Regular users
are not affected by test scripts/makefiles.

Added makefile and gcc version info to config output.

Tested on Arduino 1.0.6
2014-09-21 19:36:50 +01:00
Simon John
9a6b0ef75f Added *.cpp to extensions supported by "make generate_assembly" 2014-08-29 09:56:52 +02:00
Simon John
aa879d8db8 Allow libraries/sketches to have the same name as system libs,
e.g. main or Wire

Doesn't seem to work with main.cpp but main.ino works.

Fixes issue #229 and #244
2014-08-29 09:56:52 +02:00
Simon John
1239263896 Fix regex for "make show_boards" on 1.5
In 1.5.6 the Due board has an underscore, this regex tweak allows for:

arduino_due_x_dbg  Arduino Due (Programming Port)
arduino_due_x      Arduino Due (Native USB Port)
2014-08-17 19:29:43 +02:00
Simon John
421a40e261 allows "make clean" to be extended in the user's local makefile to clean
other files out, e.g. backup/git files
2014-08-16 19:31:07 +02:00
ladislas
51e65b0a08 add CFLAGS_STD and CXXFLAGS_STD defaults 2014-08-13 17:52:32 +02:00
Sudar
209446c944 Revert "Using CFLAGS_STD and CPPFLAGS_STD" 2014-08-13 10:13:16 +05:30
ladislas
a5b84b1722 create CPPFLAGS_STD and make both CFLAGS_STD and CPPFLAGS_STD avalaible for CFLAGS and CXXFLAGS 2014-08-12 18:11:24 +02:00
Simon John
2f4d6c11f0 Fix CFLAGS vs CXXFLAGS typo 2014-08-01 12:17:06 +02:00
ladislas
dfc7382368 Remove "./" in "make clean" to clean any OBJDIR & change "tinyladi" to "ladislas" in HISTORY.md 2014-07-15 10:25:38 +02:00
Simon John
8cdae73deb Made all the changes into one commit that could be a patch for master 2014-07-12 19:05:35 +02:00
Sudar
542529ae4f Bump up version to v1.3.4 for release 2014-07-12 21:00:51 +05:30
Simon John
437a0f54b5 Build core objects in subdirectory, fixes issue #82 2014-06-30 09:03:15 +02:00
Simon John
7618da7f5f Added quotes around greps/cats to help alleviate possible problems
with spaces in directory/file-names.

Removed $TARGETS as it was an unsafe wildcard and was only used
in "make clean" which itself has been simplified to just delete
the $OBJDIR rather than waste time deleting individual files.
2014-06-29 00:14:18 +02:00
Simon John
e5b8125469 Really fix $MONITOR_PORT detection
Fixes issue #215
2014-06-21 12:32:34 +02:00
Simon John
583a9e4950 Fixed $MONITOR_PORT detection, thanks choffmann 2014-06-15 17:56:52 +02:00
Ronan Barzic
05a0c7d377 Make Arduino.mk compatible with Flymake
If Flymake is configured to parse .ino files the same way as for c/c++
files, it creates a temporary file (_flymake.ino) in the same directory
as the original file. It fails with the current Arduino.mk because of
the check for multiple .ino files. This fix removes the check
only when flymake is calling the Makefile (Flymake will call make with
the variable CHK_SOURCES set to the temporary file name)

To make Flymake working with .ino file :

Add :
check-syntax:
	$(CXX_NAME) -c -include Arduino.h   -x c++ $(CXXFLAGS)   $(CPPFLAGS)  -fsyntax-only $(CHK_SOURCES)

in the project Makefile after the inclusion of the Arduino.mk file

Edit the flymake configuration :
M-x customize-option RET
flymake-allowed-file-name-masks RET (using auto completion !)

Add the line :

("\\.ino\\'" flymake-simple-make-init)

Then click on "Apply and Save" button

Fix #211
2014-06-10 16:05:08 +05:30
Simon John
cc93d7b0b2 Add missing newlines at end of some echo's (issue #207)
Whilst doing that, i noticed that there were some missing
targets to "make help" so added those in and re-ordered
and re-worded some of the targets to make more sense
e.g. all of the upload's are together, all of the
assemblers are together etc.
2014-05-27 11:25:23 +01:00
Simon John
f5efbe5533 Fixed alpha sort on those crazy Macs ;-) 2014-05-23 09:29:41 +01:00
Simon John
82afb2769f "make show_boards" now lists the board name as well as board tag.
also is alphabetically sorted by tag now.

Fixes #204
2014-05-22 23:35:43 +01:00
Simon John
634bd9bc9c Some language clean up 2014-05-21 00:14:46 +01:00
Simon John
9a45b80017 Check that on windows ARDUINO_DIR (and MPIDE_DIR) is a relative path.
Checks for paths starting with / e.g. /cydrive/arduino or a
drive letter e.g. C:\Program Files\Arduino

Fix #201
Fix #202
2014-05-20 12:12:14 +05:30
Chris Patuzzo
70dfdcc7eb If no port is specified, try to guess it from wildcards
Fix #197
2014-05-03 09:01:24 +05:30
hrobeers
041d54d9ab Add support for assembler code in libraries
Fix #195
2014-04-25 14:31:32 +05:30
Pierre DAVID
aa4c96ce50 Allow spaces in "Serial.begin (....)"
Fix #190
Fix #191
2014-04-14 12:24:13 +05:30
Simon John
b42d05d8b1 Bump up version to v1.3.3 for release
Fix #189
2014-04-13 09:56:32 +05:30
EAGMnor
32d35da2a0 Tweak AVRdude conf file detection in windows
On windows the AVRdude configuration file is now detected properly. The
comments and `README` are updated as well.

Fix #187
2014-04-11 20:24:17 +05:30
Julien Ridoux
ffde764ada Add phony target to run pre-build hook script
Fix #176
2014-03-20 11:17:14 -07:00
Geoff Holden
ce89531226 Fix: Consider usb... to be a valid ISP_PORT
AVRDUDE requires -P usb to be passed as an argument for some ISP
devices, and it is also required in the case where you have multiple
usbtiny or usbasp devices connected at once to select a specific one.

Fix #167
2014-03-14 16:10:18 -02:30
Simon John
f62b5838df Add -D__PROG_TYPES_COMPAT__ to the avr-g++ compiler flags
This results in just a deprecated warning rather than an error
when using libraries (e.g. jeelib) that still use prog_XXX types

This is how the IDE does it, and means that libraries don't have to
add the #define __PROG_TYPES_COMPAT__ line

Reference: http://www.nongnu.org/avr-libc/user-manual/group__avr__pgmspace.html

Fix #169
2014-02-15 16:57:16 +05:30
Simon John
ff103b244c Add "gpio" to the list of isp's that don't have a port
The gpio programmer type is used on the raspberry pi to upload using
the gpio spi pins via a sysfs interface, with a modified avrdude

Fix #165
Fix #166
2014-02-08 09:59:50 +05:30
Simon John
920c74024e now includes avr-libc/*.c files malloc.c and realloc.c
if bug-reporter confirms this fixes issue #163 then should be ok to merge.
2014-02-05 23:31:12 +00:00
Sudar
e48ae82fbd Bump up version to 1.3.1 for release 2014-02-04 18:29:18 +05:30
Sudar
cff1dec365 Add a new target help_vars
This target can display all variables that can be overridden
2014-02-04 18:27:46 +05:30
Sudar
e8634fb642 Document all the variables that can be overridden in child makefile
Huge thanks to @sej7278 for doing this

Fix #75
2014-02-04 18:26:43 +05:30
Simon John
1893199dad BUNDLED_AVR_TOOLS_DIR is now set correctly using := instead of ?=,
so that installations using only the arduino-core packages that
don't have the $(ARDUINO_DIR)/hardware/tools/avr directory can
still use the avr-g++ tools found in the $PATH (/usr/bin)

Previously BUNDLED_AVR_TOOLS_DIR was set to an empty string as
the directory doesn't exist, which meant that "ifdef BUNDLED_AVR_TOOLS_DIR..."
was set rather than skipping to "else SYSTEMPATH_AVR_TOOLS_DIR...."

No user would set BUNDLED_AVR_TOOLS_DIR so the assignment operator
:= should be used not ?=

Updated the version info/changes in various locations.
2014-02-01 00:41:00 +00:00
Sudar
20b9774645 Bump up version to v1.3.0 for release 2014-01-29 11:53:26 +05:30
Sudar
33813e09d8 Merge pull request #159 from peplin/simpler-crossplatform-paths
Override complete compiler tool paths for chipKIT.
2014-01-28 21:21:57 -08:00
Sudar
afdb27656b Merge pull request #158 from peplin/silent-which
Silence the stderr output from call to `which`.
2014-01-28 21:21:15 -08:00
Christopher Peplin
5445142acf Use more reliable serial device naming in Windows.
* Strip leading "/dev/" from MONITOR_PORT before handing to avrdude in Windows.
* Use the more widely available awk tool instead of bc to subtract 1
    from COM ID (as opposed to `bc`).
* Allow Windows user to specify "com1" or just "1".
* Document MONITOR_PORT format for Windows users.
2014-01-28 10:00:37 -05:00
Christopher Peplin
d3a8fcac00 Silence the stderr output from call to which. 2014-01-28 09:44:08 -05:00
Christopher Peplin
067afbb8e4 Override complete compiler tool paths for chipKIT.
Previously we were setting the AVR tools path to the PIC32 tools path because it
made grabbing the compiling tools easier. Consequently, it made finding the
avrdude path much harder, especially since the avrdude files are in different
locations in the Linux distributions of MPIDE and Arduino.

Instead, we set the AVR tools path to the *correct* path (where *AVR* dude
lives), and totally override the CC, CXX, etc. paths to point to their PIC32
equivalents.
2014-01-28 09:43:33 -05:00
Simon John
d4e0a383ae Simplify package vs git checkout detection
Fix #147
Fix #151
Fix #153

The following are the detailed changes

- Remove ARDMK_PATH, ARDMK_FILE and arduino-mk subdirectory
- Looks for ard-reset-arduino in $PATH or ARDMK_DIR/bin
- Fix git-archive command in RPM SPEC file
- Remove some whitespace
- Remove arduino-mk dir from debian package's arduino-mk.install
- Update docs to reflect the above changes
- Bump Up version to 1.2.0
2014-01-14 14:23:25 +05:30
Simon John
fa6b9215c8 Move files out of arduino-mk subdirectory
fix #152
2014-01-14 14:23:25 +05:30
Renamed from arduino-mk/Arduino.mk (Browse further)