Commit graph

180 commits

Author SHA1 Message Date
Sudar
1012f765fe Tag v0.10.6 for release 2013-06-14 17:49:02 +05:30
Sudar
328800411a Merge pull request #72 from matthijskooijman/indent-fix
Don't indent variable assignments with tabs
2013-06-14 04:24:03 -07:00
Matthijs Kooijman
ffdfa7d170 Don't indent variable assignments with tabs
This causes make to consider the line part of the preceding recipe,
causing the variable to remain unset and the preceding recipe to break.
In this case, this was the recipe for user libraries with .c files,
which is uncommon enough for this to go unnoticed.

This was broken in 3bce1d88 (Allow adding extra common dependencies).
2013-06-14 12:49:12 +02:00
Sudar
60ca7d2852 Move reseting Leonardo logic to ard-reset-arduino
ard-reset-leonardo which was used for reseting Leonardo was written in
Python. Now the logic is added inside the ard-reset-arduino perl script
itself.

Fix #62

Squashed commit of the following:

commit a63366980f
Author: Simon John <git@the-jedi.co.uk>
Date:   Fri Jun 14 11:36:00 2013 +0200

    who put a space in the shebangs?!

commit c798eb26ea
Author: Simon John <git@the-jedi.co.uk>
Date:   Fri Jun 14 11:10:12 2013 +0200

    replaced ard-reset-leonardo with an update to ard-reset-arduino
    which is now called from Arduino.mk with the --leonardo flag

    removed some trailing whitespace

    upped version string in Arduino.mk
2013-06-14 16:09:38 +05:30
Sudar
9b38631d61 Merge pull request #70 from matthijskooijman/libs-fix
Fix directory creation for library source files
2013-06-13 20:12:30 -07:00
Matthijs Kooijman
4e6c776425 Fix directory creation for library source files
In commit 3bce1d88 (Allow adding extra common dependencies), the way
$(OBJDIR) was created changed. Instead of having some ad-hoc mkdir calls
around, all relevant rules were made to depend on the directory instead.

However, this change didn't take into account that the object files for
libraries live instead a subdirectory of $(OBJDIR), which was no longer
automatically created. This made compilation of all libraries fail, on a
clean build directory.

Fixing the rules to depend on $(dir $@) or $(dir %) doesn't work, since
those function calls are expanded by making upon reading the file, not
later when the rule is actually matched.

Therefore, this commit restores the previous explicit mkdir calls for
library object files. The non-library objects files, which do not live
in a subdirectory, still use the dependency approach as before.

Fixes: #58
2013-06-13 23:05:57 +02:00
Simon John
4118af0c42 Make serial baudrate detection work in Mac
Replace regex used for detecting serial baudrate.
New regex is tested in both debian and mountain lion.

fix #52 - serial monitor baudrate detection
2013-06-13 21:02:00 +05:30
Simon John
d8c357f6d6 Change the way AUTO_ARDUINO_VERSION is computed
adds another pass to sed to remove the '1:' from debian version numbers
2013-06-13 17:02:15 +05:30
Simon John
d10066072f fixed whitespace and /dev/null redirection 2013-06-13 09:38:27 +02:00
Sudar
e0c8d608de Correct the build directory name in comments 2013-06-12 12:47:34 +05:30
Sudar
2ff244eeaf Release v0.10.5 2013-06-11 16:16:05 +05:30
Sudar
f26a134418 Add support for leonardo.
Leonardo board requires a new way of handling board reset.
There is a new script which does the reset differently for leonardo boards.
close #30 and close #44
2013-06-11 15:46:22 +05:30
Sudar
365118e6a5 Enhanced support for programming using Arduino as ISP. Fixes #56 2013-06-09 17:18:12 +05:30
Sudar
2d77e43216 Enhanced config detection messages 2013-06-09 17:13:04 +05:30
Sudar
70986c14f6 Strip extra whitespace from the variable. Fixes #57 2013-06-09 13:12:19 +05:30
Sudar
36c32e75cc Added leonardo support. Took Code from @guicho271828 2013-06-08 17:26:24 +05:30
Sudar
ca49da9f1d Moved comments outside the rule. Otherwise the comments were getting printed 2013-06-08 16:32:43 +05:30
Sudar
11a416e9e9 Fixed some typos in comments 2013-06-06 07:56:08 +05:30
Sudar
722238b95e Reformatted file and changed some wrong tabs into spaces 2013-06-02 21:33:42 +05:30
Sudar
05b15fe67e Added ifndef ARDUINO_VAR_PATH for compiling for the attiny 2013-05-31 19:13:17 +05:30
Sudar
3bce1d88d7 Allow adding extra common dependencies 2013-05-31 18:34:44 +05:30
Sudar
d1b6fe3cdf Formatting and typo fixes 2013-05-31 17:43:00 +05:30
Sudar
47b2dca1ef Add USB_VID and USB_PID to CPPFLAGS only if the board is Leonardo. Fixes #43 and fixes #51 2013-05-31 17:10:49 +05:30
Sudar
dc3ec57330 Added information about the changes that went in v0.10.4 2013-05-31 09:42:44 +05:30
Sudar
d8bac0fb14 Moved all version information and change log into HISTORY.md file 2013-05-31 09:29:36 +05:30
Matthijs Kooijman
4ea3ab7884 Enable dependency tracking for libraries and core
This makes sure a library or core file gets rebuild when a header file
it depends on is changed, preventing weird surprises when the
application is recompiled with the new header values but the library
isn't.

For most users, this won't be strictly needed, but anyone working on a
library or even the Arduino core, this is must to prevent surprises or
needing a make clean between every build attempt.
2013-05-30 21:22:54 +02:00
Matthijs Kooijman
b96e03dde1 Fix creating of $(OBJDIR) in a proper way
This adds a dependency on $(OBJDIR) for every rule that creates a file
inside $(OBJDIR) but does not already depend on any file within
$(OBJDIR). All other dependencies on $(OBJDIR) are removed.

These dependencies are added after a | to tell make that this is a
"order-only prerequisite". This means that the file inside $(OBJDIR)
needs $(OBJDIR) to be present but if $(OBJDIR) changes (which happens
whenever a file _inside_ the directory is touched!), there is no need to
recompile the file within $(OBJDIR).

Implementing this using a generic implicit rule like:

$(OBJDIR)/%: | $(OBJDIR)

doesn't work, since make doesn't merge the prerequisites of multiple
implicit rules like it does for explicit rules. We could use
$(LOCAL_OBJS) and friends to create explicit rules to do something like
the above, but just adding the dependencies on all rules seems more
explicit and future-proof.
2013-05-30 21:22:52 +02:00
Paul Brook
4fdd1765e6 Rewrite dependency code
Commit originally by: Paul Brook <paul@codesourcery.com>
Port to newer version and commit message by: Matthijs Kooijman <matthijs@stdin.nl>

Instead of generating a big list of dependencies at the start, now
dependency files are generated whenever a .o file is compiled. This
works, since if the .o file does not exist, it should be compiled and
make does not need to know about its dependencies. If the .o (and thus
the .d) file does exist, the .d file contains all the dependencies used
to compile the .o file. If none of those changed, the .o file does not
need a recompile, but also the .d file is still accurate (in particular,
the dependency list cannot change without one of the dependent .h files
or the .cpp file itself changing).

This helps to remove a lot of duplication in the code, since now only a
single commandline is needed for both compilation and dependency
generation. It will probably also run a bit faster now.

Note that this commit breaks the creation of $(OBJDIR) since this
"accidentally" always worked before because $(DEPFILE) was created
before anything else. That will be fixed next.
2013-05-30 21:21:54 +02:00
Matthijs Kooijman
1f043bb819 Compile .ino and .pde files directly
Before, they were copied to a .cpp file to add the Arduino.h/WProgram.h
include. However, this would cause the compiler error messages to not refer to
the right filename, making it hard to use the compiler output in an editor like
vim to point out errors.

By using gcc's -include option, there is no need to modify the ino/pde
file before compiling. However, we will need to explicitely tell gcc
that the source file is c++, because of the non-standard extensions.
2013-05-30 19:27:11 +02:00
Matthijs Kooijman
97fa5ae161 Let the Makefile decide which include to use for .pde files
Previously, the C preprocessor would pick either Arduino.h or WProgram.h
based on a define. Now, the Makefile makes the decision earlier. This
prevents having to duplicate the #if line in the next commit.
2013-05-30 19:27:11 +02:00
Matthijs Kooijman
1329730dfe Don't try to read version.txt when it does not exist
This can happen for example when the arduino directory is a checkout
from git instead of a released version. Before, cat would show an error
which is now prevented. The version still defaults to 100 just like
before.
2013-05-30 19:27:11 +02:00
Matthijs Kooijman
ae10f71dd4 Output configuration info only once
Before, the configuration info would be shown again when running a
recursive make call, or when make restarted after regenerating the
dependencies file. Now, it only shows the info the first time.

Closes: #46
2013-05-30 19:27:11 +02:00
Matthijs Kooijman
5ea2437311 Fix raw_upload and reset for normal uploads
In commit 90e3c9ad (Fix upload in case of parallelized make), some
dependencies were shuffled to (I assume) prevent the reset from
happening before or at the same time as the upload when running a
parallel make. However, this introduced two problems:
 - The upload and raw_upload became effectively the same, and both of
   them did a reset (even though raw_upload should do the upload without
   a reset).
 - The reset target does not depend on $(TARGET_HEX) or verify_size, so
   in a parallel make the reset is executed before / at the same time as
   the actual compilation (since the reset doesn't seem to be needed for
   at least the Arduino Uno, apparently avrdude handles this, this
   probably wasn't noticed by anyone).

Because we can't force a specific ordering of dependencies in parallel
make and because adding dependencies to the reset target doesn't seem
appropriate (you should be able to do a "make reset" without needing to
compile everything first), this commit changes the uploading to call
$(MAKE) again to do the actual upload.

The current approach ensures that:
 - raw_upload does a compile, size check and upload and upload does the
   same plus a reset.
 - A reset is not done if the compilation fails or the size check fails.
 - verify_size is called only once.
2013-05-30 19:27:10 +02:00
Matthijs Kooijman
c64f38ae6d Check that there is exactly one .pde or .ino file
When there are none (and no .cpp files either), the build would stall
trying to cat all the .d files together (which would result in cat
getting no arguments and thus waiting for input on stdin).

When there are multiple .ino and/or .pde files, the build could
technically work out, the Arduino IDE concatenates all .ino / .pde files
together and compiles them as a single compile unit, so unless we
implement that as well, it's better to just error out.
2013-05-30 13:14:20 +02:00
Matthijs Kooijman
e1bed90404 Let MONITOR_BAUDRATE detection also look in .pde files
Before, it would only look in .ino files. If you had no .ino file but
only a .pde file, this would cause the build to hang, since grep would
be waiting for input on its stdin.
2013-05-30 13:09:15 +02:00
Matthijs Kooijman
05ce9fd14b When detecting MONITOR_BAUDRATE, use $(LOCAL_INO_SRCS)
Now that this detection code is moved down a bit, it can use the same
.ino list as all the other code.
2013-05-30 13:08:02 +02:00
Matthijs Kooijman
14fd6e7126 Move MONITOR_BAUDRATE detection further down
No changes are made to the code, it is only moved. This allows it to use
LOCAL_INO_SRCS and LOCAL_INO_PDE_SRCS in the next commit.
2013-05-30 12:55:10 +02:00
Daniel Esteban Nombela
79243b8397 Added ifndef ARDUINO_VAR_PATH for compiling for the attiny 2013-02-10 15:13:44 +01:00
gabriel
3d4ec88dfd Allow adding extra common dependencies 2013-01-31 22:14:07 +01:00
Sudar
e9f5897d19 Fixed the automatic baudrate detection script that was broken if the line already had the tab character 2013-01-03 22:31:24 +05:30
Sudar
0966e8e5f3 Auto detect sketchbook location even in MAC 2012-12-23 15:42:30 +05:30
gabriel
e3b86053eb merge changes from https://github.com/sudar 2012-12-16 17:06:23 +01:00
Sudar
4446705995 Merged changes from https://github.com/alohr 2012-12-15 19:54:02 +05:30
Sudar
addd140302 Enabled warnings 2012-12-15 19:35:58 +05:30
Adam Dunlap
9ebae306d0 Show original line number for error messages 2012-12-15 19:31:37 +05:30
Sudar
3afe25ba5a Added verify_size action 2012-12-15 18:57:08 +05:30
Sudar
2ffdb5b480 Merged all changes from rpavlik 2012-12-15 18:00:52 +05:30
Sudar
c039f5f39b Merged all commits from upstream 2012-12-15 17:29:59 +05:30
gabriel
86165af726 make build dir (OBJDIR) changeable 2012-12-14 23:10:03 +01:00
gabriel
168292425f add eeprom upload support 2012-11-17 22:18:56 +01:00
Fabio Pugliese Ornellas
bfd9dac216 Added dummy file to verify_size to avoid always being run. 2012-11-12 22:13:03 -02:00
Fabio Pugliese Ornellas
b5448a64dc Added sketch size verification. 2012-11-12 21:34:51 -02:00
gabriel
1e078625cb removing -w from CPPFLAGS (warnings can be usefull) 2012-11-06 14:33:10 +01:00
Jan Gosmann
90e3c9ad0b Fix upload in case of parallelized make. 2012-11-02 12:51:53 +01:00
Ryan Pavlik
edd514d65c Make the makefile error if the arduino port is not present. 2012-11-01 10:57:11 -05:00
Ryan Pavlik
ee98d0c89b Make everybody depend on the makefile, in case cflags are changed, etc. 2012-11-01 10:34:09 -05:00
Ryan Pavlik
a814a9c276 Be able to silence configuration output 2012-11-01 10:33:46 -05:00
Jan Gosmann
bc8caf8358 Fixing problem of hanging upload. 2012-11-01 12:03:32 +01:00
Andreas Lohr
adbd6532f9 set USB_VID and USB_PID only for leonardo boards 2012-10-07 10:28:10 +02:00
Ryan Pavlik
84648978fb Provide symbol_sizes and generated_assembly targets.
Also update existing auxiliary targets with help, and
make the .PHONY list complete and in order.
2012-09-20 11:30:46 -05:00
Ryan Pavlik
6041f6201d Change .sym output 2012-09-20 11:29:36 -05:00
Ryan Pavlik
05a31db481 Make disasm more helpful 2012-09-20 11:29:26 -05:00
Ryan Pavlik
24c2366f26 Use variables instead of hardcoded commands 2012-09-20 11:29:15 -05:00
Ryan Pavlik
87060fa5c2 Add knowledge of device-specific assembler 2012-09-20 11:28:42 -05:00
Martin Oldfield
184230fcf2 Added changelog 2012-09-17 18:08:22 +01:00
Martin Oldfield
869b5d8516 Added support for the USB PID/VID needed for the Leonardo, as per patches from Dan Villiom Podlaski Christiansen and Marc Plano-Lesay 2012-09-17 17:06:48 +01:00
Martin Oldfield
9395817c96 Only set AVRDUDE_CONF if it's not set, as per Tom Hall's patch 2012-09-17 16:38:46 +01:00
Martin Oldfield
03c80333a4 Only set OBJDIR if it is not already set; if we do set it make it $BOARD_TAG dependent. This follows comments from Matthias Urlichs and Scott Howard 2012-09-17 16:29:31 +01:00
Martin Oldfield
22b4a0834a Fixed ARDUNIO/ARDUINO typo in README.md as per Kalin Kozhuharov's comment 2012-09-17 16:25:21 +01:00
Martin Oldfield
b15aa4e88f Made the size target look at the ELF file, not the hex, as per Jared Szechy's patch. Craig Leres made a similar comment 2012-09-17 16:25:08 +01:00
Adam Dunlap
d8530a16e8 Making other *FLAGS += rather than = 2012-08-27 13:08:48 -07:00
Ryan Pavlik
aaed1fc6fa Make listing files more useful 2012-08-23 12:39:42 -05:00
Ryan Pavlik
06bc8d6aa3 Allow passing extra flags 2012-08-23 12:39:31 -05:00
jeffkowalski
ee0cb6e764 detabbed changelog, and appended my contributions 2012-08-18 23:36:40 -07:00
jeffkowalski
fc968b9191 Libraries may also contain subdirectory called "utility", containing
header files to be included and source files to be built.  Modified
SYS_LIBS and USER_LIBS to accomodate those directories if they exist.
2012-08-18 23:00:39 -07:00
jeffkowalski
486be238ba Added autodetection of ARDMK_DIR 2012-08-18 20:30:25 -07:00
jeffkowalski
d09a316d7a Added autodetection of ARDUINO_SKETCHBOOK, by looking to match IDE's
setting in $(HOME)/.arduino/preferences.txt before setting default of
$(HOME)/sketchbook.
2012-08-18 19:24:07 -07:00
jeffkowalski
eef73003c9 added auto-detection of ARDUINO_LIBS referenced in LOCAL_SRCS 2012-08-18 18:16:44 -07:00
Sudar
b74f2efbce Automatically read the BAUDRATE from sketch. Works only in linux for now 2012-07-15 13:56:13 +05:30
Sudar
eed8c52ffd Automatically read the BAUDRATE from sketch. Works only in linux for now 2012-07-15 13:25:45 +05:30
Sudar
4dc7457265 Don't include dependent makefile when doing make clean 2012-07-14 12:22:34 +05:30
Sudar
94fa378eaa Fixed line spacing and added doc block which got removed in the earlier commit 2012-07-14 12:21:54 +05:30
Sudar
ad005789a0 Changed bytes option for the head shell command, so that it works in Mac as well 2012-07-13 22:56:48 +05:30
Sudar
aabe3d2c58 Updated Readme 2012-07-13 22:52:27 +05:30
Sudar
75cdb933c3 Merged changes from https://github.com/rpavlik/Arduino-Makefile 2012-07-13 22:36:54 +05:30
Sudar
e470b070c3 Merged from https://github.com/gaftech/Arduino-Makefile/ 2012-07-13 21:52:59 +05:30
Gabriel
8d16c45b8d modified 'make size' behaviour 2012-07-06 15:52:42 +05:30
Gabriel
0068267fea allow user to choose source files 2012-07-06 15:02:43 +05:30
Sudar
fcdaa4b3bf Updated Readme and added the list of changes done in this fork 2012-07-06 12:12:43 +05:30
Ryan Pavlik
c93c8e16a5 Improved library finding logic.
Look first in the user dir. Any not found there are sought in the
system (Arduino) dir. If any are not found, error out right away
with a useful message. Show all libraries and where they were found
(user or system) in the config info.
2012-07-05 15:02:24 -05:00
Ryan Pavlik
6c7a8bad60 rename functions to allow nicer output.
This also lets us restore the non-overridable detection of avr-size type.
2012-07-05 15:01:11 -05:00
Ryan Pavlik
e6ac1cae3a Simplify user and system libraries 2012-07-05 14:39:50 -05:00
Ryan Pavlik
940a6b6ecc Simplify finding arduino dir 2012-07-05 14:39:32 -05:00
Ryan Pavlik
744cb5350d Clarify by adding (space-based) indentation.
Helps simplify understanding all the nested conditionals.
2012-07-05 14:04:35 -05:00
Ryan Pavlik
49cca1da11 Less shell-based implementation of dir_if_exists 2012-07-05 13:59:12 -05:00
Ryan Pavlik
1f1f438227 Clean up and improve displayed output. 2012-07-05 13:58:54 -05:00
Ryan Pavlik
13000c35ca Add info about setting USER_LIB_PATH and ARDMK_DIR relative to source. 2012-07-05 12:58:32 -05:00
Ryan Pavlik
6ab91c23be Clarify where we actually look for libs 2012-07-05 12:58:05 -05:00
Ryan Pavlik
229187d26c add the size and disasm targets to the docs 2012-07-05 12:57:45 -05:00
Ryan Pavlik
2a5e7fd242 Fix typo in docs 2012-07-05 12:57:32 -05:00