Commit graph

174 commits

Author SHA1 Message Date
Sudar
b78d843357 Print config info about ARDMK_DIR after Common.mk file is included
The show_config_variable macro is available in Common.mk file. So invoke
it for ARDMK_DIR only after Common.mk file is included.

Fix #111
2013-07-28 11:42:20 +05:30
Sudar
82fad52f6c Remove duplicate definition of show_config_variable macro
In 5ed507cf43 as part of #98,
[`show_config_variable` was duplicated in Arduino.mk file](https://github.com/sudar/Arduino-Makefile/pull/98#commitcomment-3561542)

But it was later found that `ARDMK_DIR` is still not getting printed
(issue #111). This commit therefore removes the duplicated macro
definition.
2013-07-28 11:42:20 +05:30
Sudar
65b426e4ad Remove unnecessary checks for ARDMK_DIR
If `ARDMK_DIR` is not defined, then it is assumed to be the directory
where `Arduino.mk` or `chipKIT.mk` is present.

Since this assumption is made, `ARDMK_DIR` will always be set, whether
the user has explicitly set it or not. Therefore checking whether
`ARDMK_DIR` is not set is unnecessary. This commit removes these
unnecessary checks.
2013-07-28 11:42:20 +05:30
Sudar
290a4986d6 Make ARDMK_PATH and ARDMK_DIR backward compatible
When support for ChipKit was added recently (issue #98) it broke the way
ARDMK_PATH and ARDMK_DIR were handled, if the package was installed
through package. It was only working if you have done a git checkout.

This commit fixes it, but searching for `Common.mk` both in
`ARDMK_DIR/arduino-mk` and `ARDMK_DIR/` directories.

Fix #110
2013-07-12 16:07:49 +05:30
Sudar
588f7028b2 Merge pull request #106 from openxc/build-in-subdirs
Allow objects to be in arbitrary subdirectories.
2013-07-11 08:19:37 -07:00
Sudar
81c2f7fe89 Merge branch 'serial-port-variable-name' of git://github.com/openxc/Arduino-Makefile into openxc-serial-port-variable-name 2013-07-10 09:05:52 +05:30
Christopher Peplin
266d629c25 Rename ARDUINO_PORT to MONITOR_PORT to reflect support for other platforms.
This commit includes backwards compatibility with the ARDUINO_PORT flag if
that's set.

Fix #109
2013-07-10 09:05:38 +05:30
Sudar
b76d6bd783 Merge pull request #107 from openxc/chipkit-avrdude
Fix path to avrdude for chipKIT's MPIDE installation.
2013-07-09 20:08:47 -07:00
Sudar
4165bad7d6 Merge pull request #108 from openxc/no-preferences-required
Don't require an IDE preferences file, fallback to default sketchbook.
2013-07-09 19:51:11 -07:00
Christopher Peplin
3c00739165 Don't require an IDE preferences file, fallback to default sketchbook.
It should be possible to use the Makefile without ever running the
Arduino or chipKIT IDE. This change only looks for the preferences file
if the sketchbook path is not defined, and even then, will use the
default skethbook path if the preferences file is unavailable.
2013-07-09 17:03:02 -04:00
Christopher Peplin
18548b4890 Fix path to avrdude for chipKIT's MPIDE installation. 2013-07-09 16:40:27 -04:00
Christopher Peplin
9200fe3d4d Update a call to PARSE_BOARD to Makefile-style in chipKIT file. 2013-07-09 16:29:25 -04:00
Christopher Peplin
7c73209f04 Allow objects to be in arbitrary subdirectories. 2013-07-09 16:20:39 -04:00
Christopher Peplin
474da2ced4 Remove Perl YAML dependency from documentation.
YAML is no longer necessary in Perl since ard-parse-boards was implemented in the Makefile itself.
2013-07-09 13:01:08 -04:00
Sudar
6936a1dcfd Replace Leonardo detection with Caterina detection
Checks bootloader.path for "caterina", instead of checking only for
leonardo

Fix #96
Fix #97
Fix #102
2013-07-09 22:18:46 +05:30
Christopher Peplin
1bc31c814b Compile with debugging symbols only when DEBUG=1.
Fix #101
2013-07-09 21:48:31 +05:30
Christopher Peplin
87e29ea806 Implement ard-parse-boards with shell scripting instead of Perl.
Working towards dropping the dependency on Perl (which very few Windows users
have), this commit implements the required functionality from ard-parse-boards
in a few shell commands from within the Makefile.

Fix #100
2013-07-09 21:45:17 +05:30
Christopher Peplin
df88db2cfb Add support for the Digilent chipKIT platform
This commit modifies a few things in Arduino.mk to be able to support
overriding the necessary configuration options to support the chipKIT build,
and also includes an example sketch configured to build for the Max32 platform.

In addition the following changes were done as well

- Control C standard with a CFLAGS_STD flag, GNU99 by default.
- Duplicate show_config_variable in each sub-makefile.
- Remove redundant output of ARDUINO_PREFERENCES_PATH from config table.
- Defer Priting ARDMK_DIR until Arduino.mk.
- Define names of compiler tools earlier to use for path checking.

Duplicating show_config_variable is unfortunate because the code is duplicated,
but I don't see a good way around it since we need to dupliacate the check
for ARDMK_DIR before we can find Common.mk.

Fix #98
2013-07-09 21:42:05 +05:30
Simon John
14d491c3bd moved reset routines down past where we define CATERINA
my understanding of recursively expanded variables wasn't correct
2013-07-03 09:29:34 +02:00
Simon John
ae3e5c78ac Replace Leonardo detection with Caterina detection
Checks bootloader.path for "caterina"
2013-07-03 00:18:29 +02:00
Sudar
5abf12bdb2 Move wait-for-reconnection logic inside ard-reset-arduino
When a Leonardo based board is reset, the port disappears and we need to
wait till it comes back.

Earlier this logic was handled by a separate shell script. Now the logic
is moved inside the ard-reset-arduino perl script. This is done to
reduce the number of binaries that are needed by the makefile.

Fix #95
2013-07-02 21:48:33 +05:30
Sudar
8a2e251e95 Move binary sketch size verification logic inside makefile
Earlier bin/ard-verify-size shell script was used to validate that the
binary hex file size is less than the flash memory of the target
microcontroller.

This commit removes the dependency on the external shell script, by
moving the binary size verification logic inside the makefile itself.

Fix #54
2013-07-01 21:54:56 +05:30
Sudar
45f230c5c8 Improve avrdude and avrdude_conf path auto detection
In Arduino Linux distribution, avrdude and avrdude.conf files are placed
in different path. This commit improves the autodetection of avrdude
and avrdude.conf paths by considering this fact.

Fix #48
2013-06-29 21:40:36 +05:30
Sudar
96deb9cd06 Add CURRENT_OS macro which has the current os
Right now CURRENT_OS can have one of the following values

- WINDOWS
- LINUX
- MAC
2013-06-29 20:33:58 +05:30
Sudar
bf41775676 Print config info about AVR_TOOLS_DIR always
In 25a31afbd9 a bug was introduced which
prevented the config info for AVR_TOOLS_DIR to be printed when
AVRDUDE_CONF was defined.

This commit moves the config printing statement for AVR_TOOLS_DIR
outside the condition which checks whether AVRDUDE_CONF is defined.
2013-06-29 16:43:52 +05:30
Ralf Doering
25a31afbd9 Don't overwrite AVRDUDE_CONF if AVR_TOOLS_DIR is not set.
If one likes to use avrdude from outside of Arduino together with
Arduino-bundled gcc crosstolchain, the setting of AVRDUDE_CONF got
overwritten.
2013-06-25 20:07:56 +02:00
Ralf Doering
2a52ff7e02 Remove tab from empty line.
If editing and saving Arduino.mk with emacs, emacs complains about
"Suspicious line 1050". This line is empty but contains an extra tab.

Signed-off-by: Ralf Doering <ralf@rdoering.net>
2013-06-25 15:37:42 +02:00
Sudar
700f82b3f1 Remove redundant checks for ARDUINO_DIR 2013-06-23 13:16:37 +05:30
Sudar
7e66672a6c Auto detect alternate core path from sketchbook folder
Fix #86
2013-06-23 13:08:06 +05:30
Sudar
e0856e51d9 Remove "utility" from example makefiles
From commit fc968b9191 files inside
utility are automatically build.

Fix #84
2013-06-22 11:48:26 +05:30
Simon John
c284ec93dd Add support for reseting "Micro" Arduino.
Micro can be reset using Leonardo reset functions itself. So call
Leonardo reset functions for Micro as well.

The reset function seems to have some issues for Micro and is not
100% reliable, like Leonardo. See comments in #30.

Fix #80
Fix #83
2013-06-21 08:37:11 +05:30
Sudar
4e22abe0de Add support for specifying optimization level
Fix #81
2013-06-20 21:56:54 +05:30
Sudar
6cdad1d621 Add $OBJDIR to the list of configuration that gets printed
Fix #77
2013-06-20 21:32:35 +05:30
Sudar
3b35453564 Release v0.12.0 2013-06-20 12:58:57 +05:30
Sudar
8f4bbe114e Deprecate "generated_assembly" target in favour of "generate_assembly"
The deprecated target will be removed in v1.0.0.
Fix #79
2013-06-20 12:51:56 +05:30
Matthijs Kooijman
09840089fd Fix make generated_assembly
Before, .ino and .pde files would be converted to .cpp files and there
is a rule to convert those .cpp files to .s files for make
generated_assembly. However, since 1f043bb (Compile .ino and .pde files
directly) these intermediate .cpp files are no longer generated,
breaking the rule to generate .s files.

This fixes this by also generating .s files from .ino and .pde files
directly.

Closes #76
2013-06-19 23:44:36 +02:00
Matthijs Kooijman
a289fd7132 Let the .pde and .ino rules also depend on $(COMMON_DEPS)
In 1f043bb (Compile .ino and .pde files directly), this dependency was
accidentally dropped from these rules.  This fixes this by adding it
again.
2013-06-19 23:44:36 +02:00
Sudar
109693ad68 Release v0.11.0 2013-06-15 19:48:47 +05:30
Sudar
0028fabc64 Add support for compiling plain AVR C files
To compile plain AVR C files, the variable NO_CORE should be initialized
to a non-empty value.

When NO_CORE is set, the following changes happen
- boards.txt file is not parsed. The user should explicitly set MCU,
  F_CPU, fuse bits etc.
- MONITOR_BAUDRATE is not calculated

Fix #63
2013-06-15 19:30:39 +05:30
Sudar
78f2363dd5 Handle cases where certain fuse bits are not present
Introduce two new variables AVRDUDE_ISP_FUSES_PRE and
AVRDUDE_ISP_FUSES_POST which are set based on whether the fuse bits are
present or not.

avrdude is invoked to set fuse bits only if these new variables are not
empty.

Fix #61
2013-06-15 19:23:26 +05:30
Sudar
ac5a087982 Add the ability to configure avrdude options
A new environmental variable AVRDUDE_OPTS is added, which can be used to
configure the options passed to avrdude.

Fix #53
2013-06-15 19:21:48 +05:30
Sudar
93eaaec5ba Add a warning when HEX_MAXIMUM_SIZE is not specified 2013-06-15 19:14:16 +05:30
Sudar
ad417dbf70 Fix whitespace issues 2013-06-15 17:16:47 +05:30
Sudar
b29a0bed2a Replace hardcoded executables with variable 2013-06-15 17:16:27 +05:30
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