Update from Sudar/master
This commit is contained in:
commit
249c1348d3
7 changed files with 75 additions and 37 deletions
32
Arduino.mk
32
Arduino.mk
|
@ -279,6 +279,12 @@ else
|
||||||
$(call show_config_variable,ARDUINO_DIR,[USER])
|
$(call show_config_variable,ARDUINO_DIR,[USER])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CURRENT_OS),WINDOWS)
|
||||||
|
ifneq ($(shell echo $(ARDUINO_DIR) | egrep '^(/|[a-zA-Z]:\\)'),)
|
||||||
|
echo $(error On Windows, ARDUINO_DIR must be a relative path)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# Default TARGET to pwd (ex Daniele Vergini)
|
# Default TARGET to pwd (ex Daniele Vergini)
|
||||||
|
|
||||||
|
@ -784,12 +790,16 @@ SYS_INCLUDES = $(patsubst %,-I%,$(SYS_LIBS))
|
||||||
USER_INCLUDES = $(patsubst %,-I%,$(USER_LIBS))
|
USER_INCLUDES = $(patsubst %,-I%,$(USER_LIBS))
|
||||||
LIB_C_SRCS = $(wildcard $(patsubst %,%/*.c,$(SYS_LIBS)))
|
LIB_C_SRCS = $(wildcard $(patsubst %,%/*.c,$(SYS_LIBS)))
|
||||||
LIB_CPP_SRCS = $(wildcard $(patsubst %,%/*.cpp,$(SYS_LIBS)))
|
LIB_CPP_SRCS = $(wildcard $(patsubst %,%/*.cpp,$(SYS_LIBS)))
|
||||||
|
LIB_AS_SRCS = $(wildcard $(patsubst %,%/*.S,$(SYS_LIBS)))
|
||||||
USER_LIB_CPP_SRCS = $(wildcard $(patsubst %,%/*.cpp,$(USER_LIBS)))
|
USER_LIB_CPP_SRCS = $(wildcard $(patsubst %,%/*.cpp,$(USER_LIBS)))
|
||||||
USER_LIB_C_SRCS = $(wildcard $(patsubst %,%/*.c,$(USER_LIBS)))
|
USER_LIB_C_SRCS = $(wildcard $(patsubst %,%/*.c,$(USER_LIBS)))
|
||||||
|
USER_LIB_AS_SRCS = $(wildcard $(patsubst %,%/*.S,$(USER_LIBS)))
|
||||||
LIB_OBJS = $(patsubst $(ARDUINO_LIB_PATH)/%.c,$(OBJDIR)/libs/%.o,$(LIB_C_SRCS)) \
|
LIB_OBJS = $(patsubst $(ARDUINO_LIB_PATH)/%.c,$(OBJDIR)/libs/%.o,$(LIB_C_SRCS)) \
|
||||||
$(patsubst $(ARDUINO_LIB_PATH)/%.cpp,$(OBJDIR)/libs/%.o,$(LIB_CPP_SRCS))
|
$(patsubst $(ARDUINO_LIB_PATH)/%.cpp,$(OBJDIR)/libs/%.o,$(LIB_CPP_SRCS)) \
|
||||||
|
$(patsubst $(ARDUINO_LIB_PATH)/%.S,$(OBJDIR)/libs/%.o,$(LIB_AS_SRCS))
|
||||||
USER_LIB_OBJS = $(patsubst $(USER_LIB_PATH)/%.cpp,$(OBJDIR)/libs/%.o,$(USER_LIB_CPP_SRCS)) \
|
USER_LIB_OBJS = $(patsubst $(USER_LIB_PATH)/%.cpp,$(OBJDIR)/libs/%.o,$(USER_LIB_CPP_SRCS)) \
|
||||||
$(patsubst $(USER_LIB_PATH)/%.c,$(OBJDIR)/libs/%.o,$(USER_LIB_C_SRCS))
|
$(patsubst $(USER_LIB_PATH)/%.c,$(OBJDIR)/libs/%.o,$(USER_LIB_C_SRCS)) \
|
||||||
|
$(patsubst $(USER_LIB_PATH)/%.S,$(OBJDIR)/libs/%.o,$(USER_LIB_AS_SRCS))
|
||||||
|
|
||||||
# Dependency files
|
# Dependency files
|
||||||
DEPS = $(LOCAL_OBJS:.o=.d) $(LIB_OBJS:.o=.d) $(USER_LIB_OBJS:.o=.d) $(CORE_OBJS:.o=.d)
|
DEPS = $(LOCAL_OBJS:.o=.d) $(LIB_OBJS:.o=.d) $(USER_LIB_OBJS:.o=.d) $(CORE_OBJS:.o=.d)
|
||||||
|
@ -862,8 +872,14 @@ ifeq ($(CURRENT_OS), WINDOWS)
|
||||||
COM_PORT_ID = $(subst com,,$(MONITOR_PORT))
|
COM_PORT_ID = $(subst com,,$(MONITOR_PORT))
|
||||||
COM_STYLE_MONITOR_PORT = com$(COM_PORT_ID)
|
COM_STYLE_MONITOR_PORT = com$(COM_PORT_ID)
|
||||||
DEVICE_PATH = /dev/ttyS$(shell awk 'BEGIN{ print $(COM_PORT_ID) - 1 }')
|
DEVICE_PATH = /dev/ttyS$(shell awk 'BEGIN{ print $(COM_PORT_ID) - 1 }')
|
||||||
else
|
endif
|
||||||
|
|
||||||
|
ifdef ARDUINO_PORT
|
||||||
DEVICE_PATH = $(MONITOR_PORT)
|
DEVICE_PATH = $(MONITOR_PORT)
|
||||||
|
else
|
||||||
|
# If no port is specified, try to guess it from wildcards.
|
||||||
|
DEVICE_PATH = $(firstword $(wildcard \
|
||||||
|
/dev/ttyACM? /dev/ttyUSB? /dev/tty.usbserial* /dev/tty.usbmodem*))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Returns the Arduino port (first wildcard expansion) if it exists, otherwise it errors.
|
# Returns the Arduino port (first wildcard expansion) if it exists, otherwise it errors.
|
||||||
|
@ -925,6 +941,10 @@ $(OBJDIR)/libs/%.o: $(ARDUINO_LIB_PATH)/%.cpp
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CC) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
$(CC) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
||||||
|
|
||||||
|
$(OBJDIR)/libs/%.o: $(ARDUINO_LIB_PATH)/%.S
|
||||||
|
@$(MKDIR) $(dir $@)
|
||||||
|
$(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/libs/%.o: $(USER_LIB_PATH)/%.cpp
|
$(OBJDIR)/libs/%.o: $(USER_LIB_PATH)/%.cpp
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
$(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
||||||
|
@ -933,6 +953,10 @@ $(OBJDIR)/libs/%.o: $(USER_LIB_PATH)/%.c
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
$(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
|
$(OBJDIR)/libs/%.o: $(USER_LIB_PATH)/%.S
|
||||||
|
@$(MKDIR) $(dir $@)
|
||||||
|
$(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
|
||||||
|
|
||||||
ifdef COMMON_DEPS
|
ifdef COMMON_DEPS
|
||||||
COMMON_DEPS := $(COMMON_DEPS) $(MAKEFILE_LIST)
|
COMMON_DEPS := $(COMMON_DEPS) $(MAKEFILE_LIST)
|
||||||
else
|
else
|
||||||
|
@ -1227,7 +1251,7 @@ size: $(TARGET_HEX)
|
||||||
$(call avr_size,$(TARGET_ELF),$(TARGET_HEX))
|
$(call avr_size,$(TARGET_ELF),$(TARGET_HEX))
|
||||||
|
|
||||||
show_boards:
|
show_boards:
|
||||||
@$(CAT) $(BOARDS_TXT) | grep -E "^[[:alnum:]]" | cut -d . -f 1 | uniq
|
@$(CAT) $(BOARDS_TXT) | grep -E "^[[:alnum:]]+.name" | sort -uf | sed 's/.name=/:/' | column -s: -t
|
||||||
|
|
||||||
monitor:
|
monitor:
|
||||||
$(MONITOR_CMD) $(call get_monitor_port) $(MONITOR_BAUDRATE)
|
$(MONITOR_CMD) $(call get_monitor_port) $(MONITOR_BAUDRATE)
|
||||||
|
|
|
@ -6,6 +6,10 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it
|
||||||
|
|
||||||
### 1.3.4 (In development)
|
### 1.3.4 (In development)
|
||||||
- Tweak: Allow spaces in "Serial.begin (....)". (Issue #190) (https://github.com/pdav)
|
- Tweak: Allow spaces in "Serial.begin (....)". (Issue #190) (https://github.com/pdav)
|
||||||
|
- Add: Add support for compiling assembler code. (Issue #195) (https://github.com/hrobeers)
|
||||||
|
- Add: Try to guess port from wildcards if not specified. (Issue #197) (https://github.com/tuzz)
|
||||||
|
- Fix: Check that on windows ARDUINO_DIR (and MPIDE_DIR) is a relative path. (Issue #201 and #202) (https://github.com/sej7278)
|
||||||
|
- Add: List board name as well as tag in `make show_boards`. (Issue #204) (https://github.com/sej7278)
|
||||||
|
|
||||||
### 1.3.3 (2014-04-12)
|
### 1.3.3 (2014-04-12)
|
||||||
- Fix: Make a new manpage for ard-reset-arduino. Fixes issue #188 (https://github.com/sej7278)
|
- Fix: Make a new manpage for ard-reset-arduino. Fixes issue #188 (https://github.com/sej7278)
|
||||||
|
|
22
README.md
22
README.md
|
@ -21,7 +21,7 @@ in the build process. Changes in `*.h` files lead to recompilation of sources wh
|
||||||
### Through package
|
### Through package
|
||||||
|
|
||||||
If you're using FreeBSD, Debian or Ubuntu, you can find this in the `arduino-mk`
|
If you're using FreeBSD, Debian or Ubuntu, you can find this in the `arduino-mk`
|
||||||
package and can be installed using `apt-get` or `aptitude`.
|
package which can be installed using `apt-get` or `aptitude`.
|
||||||
|
|
||||||
### From source
|
### From source
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ On Mac using MacPorts:
|
||||||
|
|
||||||
On Windows:
|
On Windows:
|
||||||
|
|
||||||
You need to install Cygwin and its packages for Make, Perl and the next Serial library.
|
You need to install Cygwin and its packages for Make, Perl and the following Serial library.
|
||||||
|
|
||||||
pySerial can be downloaded from PyPi
|
pySerial can be downloaded from PyPi
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ On other systems:
|
||||||
|
|
||||||
You can also find more [detailed instructions in this guide](http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile).
|
You can also find more [detailed instructions in this guide](http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile).
|
||||||
|
|
||||||
You can also checkout the sample makefiles inside the `examples/` folder or take a look at a *real* [Makefile-example](examples/MakefileExample/Makefile-example.mk).
|
You can also checkout the sample makefiles inside the `examples/` directory, e.g. [Makefile-example](examples/MakefileExample/Makefile-example.mk).
|
||||||
|
|
||||||
Download a copy of this repo some where in your system or install it through a package.
|
Download a copy of this repo some where in your system or install it through a package.
|
||||||
|
|
||||||
|
@ -95,21 +95,21 @@ On Windows (using cygwin), you might want to set:
|
||||||
MONITOR_PORT = com3
|
MONITOR_PORT = com3
|
||||||
BOARD_TAG = mega2560
|
BOARD_TAG = mega2560
|
||||||
|
|
||||||
It is recommended in Windows that you create a symbolic link directory for avoiding problem with folder naming conventions on Windows. Specially if your your Arduino folder is in:
|
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:
|
||||||
|
|
||||||
c:\Program Files (x86)\Arduino
|
c:\Program Files (x86)\Arduino
|
||||||
|
|
||||||
You will get problem for the special characters on the folder name. More details about this can be found on https://github.com/sudar/Arduino-Makefile/issues/94
|
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)
|
||||||
|
|
||||||
For creating a symbolic link you have to use the command “mklink” on Windows, e.g.
|
To create a symbolic link, you can use the command “mklink” on Windows, e.g.
|
||||||
|
|
||||||
mklink /d c:\Arduino c:\Program Files (x86)\Arduino
|
mklink /d c:\Arduino c:\Program Files (x86)\Arduino
|
||||||
|
|
||||||
At the end the variables end up being.
|
After which, the variables should be:
|
||||||
|
|
||||||
ARDUINO_DIR=../../../../../Arduino
|
ARDUINO_DIR=../../../../../Arduino
|
||||||
|
|
||||||
Instead of
|
Instead of:
|
||||||
|
|
||||||
ARDUINO_DIR=../../../../../Program\ Files\ \(x86\)/Arduino
|
ARDUINO_DIR=../../../../../Program\ Files\ \(x86\)/Arduino
|
||||||
|
|
||||||
|
@ -132,10 +132,10 @@ You can specify space separated list of libraries that are needed for your sketc
|
||||||
|
|
||||||
The libraries will be searched in the following places in the following order.
|
The libraries will be searched in the following places in the following order.
|
||||||
|
|
||||||
- `/libraries` folder inside your sketchbook folder. Sketchbook folder will be auto detected from your Arduino preference file. You can also manually set it through `ARDUINO_SKETCHBOOK`.
|
- `/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`.
|
||||||
- `/libraries` folder inside your Arduino folder, which is read from `ARDUINO_DIR`.
|
- `/libraries` directory inside your Arduino directory, which is read from `ARDUINO_DIR`.
|
||||||
|
|
||||||
The libraries inside user folder will take precedence over libraries present in Arduino core folder.
|
The libraries inside user directories will take precedence over libraries present in Arduino core directory.
|
||||||
|
|
||||||
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))
|
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))
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
.TH ARD-RESET-ARDUINO "1" "April 2014" "ard-reset-arduino 1.3.3" "Arduino CLI Reset"
|
.TH ARD-RESET-ARDUINO "1" "April 2014" "ard-reset-arduino 1.3.3" "Arduino CLI Reset"
|
||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
ard-reset-arduino \- Reset Arduino board
|
ard-reset-arduino - Reset Arduino board
|
||||||
|
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B ard-reset-arduino
|
.B ard-reset-arduino
|
||||||
|
@ -12,21 +12,21 @@ To reset Arduinos, we either pulse the DTR line or open the USB port
|
||||||
at 1200 baud and close it again.
|
at 1200 baud and close it again.
|
||||||
|
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.B --verbose
|
.B \-\-verbose
|
||||||
Watch what's going on on STDERR.
|
Watch what's going on on STDERR.
|
||||||
|
|
||||||
.B --period
|
.B \-\-period
|
||||||
Specify the DTR pulse width in seconds.
|
Specify the DTR pulse width in seconds.
|
||||||
|
|
||||||
.B --caterina
|
.B \-\-caterina
|
||||||
Reset a Leonardo, Micro, Robot, LilyPadUSB or similar 32u4-based device.
|
Reset a Leonardo, Micro, Robot, LilyPadUSB or similar 32u4-based device.
|
||||||
|
|
||||||
.SH EXAMPLES
|
.SH EXAMPLES
|
||||||
ard-reset-arduino /dev/ttyACM0
|
ard-reset-arduino /dev/ttyACM0
|
||||||
.PP
|
.PP
|
||||||
ard-reset-arduino --verbose --period=0.1 /dev/cu.usb*
|
ard-reset-arduino \-\-verbose \-\-period=0.1 /dev/cu.usb*
|
||||||
.PP
|
.PP
|
||||||
ard-reset-arduino --verbose --caterina /dev/ttyUSB0
|
ard-reset-arduino \-\-verbose \-\-caterina /dev/ttyUSB0
|
||||||
|
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
There are no known bugs in this application. Please report problems
|
There are no known bugs in this application. Please report problems
|
||||||
|
|
|
@ -129,7 +129,7 @@ ARDUINO_VERSION = 105
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
### ARDUINO_VERSION
|
### ARDUINO_SKETCHBOOK
|
||||||
|
|
||||||
**Description:**
|
**Description:**
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ Usually can be auto-detected from the Arduino `preferences.txt` file or the defa
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
```Makefile
|
```Makefile
|
||||||
ARDUINO_VERSION = ~/sketches
|
ARDUINO_SKETCHBOOK = ~/sketches
|
||||||
```
|
```
|
||||||
|
|
||||||
**Requirement:** *Optional*
|
**Requirement:** *Optional*
|
||||||
|
|
|
@ -47,6 +47,12 @@ else
|
||||||
$(call show_config_variable,MPIDE_DIR,[USER])
|
$(call show_config_variable,MPIDE_DIR,[USER])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CURRENT_OS),WINDOWS)
|
||||||
|
ifneq ($(shell echo $(ARDUINO_DIR) | egrep '^(/|[a-zA-Z]:\\)'),)
|
||||||
|
echo $(error On Windows, MPIDE_DIR must be a relative path)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ifndef MPIDE_PREFERENCES_PATH
|
ifndef MPIDE_PREFERENCES_PATH
|
||||||
AUTO_MPIDE_PREFERENCES_PATH := $(firstword \
|
AUTO_MPIDE_PREFERENCES_PATH := $(firstword \
|
||||||
$(call dir_if_exists,$(HOME)/.mpide/preferences.txt) \
|
$(call dir_if_exists,$(HOME)/.mpide/preferences.txt) \
|
||||||
|
|
|
@ -24,6 +24,7 @@ Then compile. This will create a binary and source RPM:
|
||||||
|
|
||||||
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:
|
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:
|
||||||
|
|
||||||
|
```Makefile
|
||||||
OVERRIDE_EXECUTABLES = 1
|
OVERRIDE_EXECUTABLES = 1
|
||||||
CC = /usr/lib64/ccache/$(CC_NAME)
|
CC = /usr/lib64/ccache/$(CC_NAME)
|
||||||
CXX = /usr/lib64/ccache/$(CXX_NAME)
|
CXX = /usr/lib64/ccache/$(CXX_NAME)
|
||||||
|
@ -33,3 +34,6 @@ Fedora's AVR compilers use ccache, so you may have to override some of the paths
|
||||||
AR = /usr/bin/$(AR_NAME)
|
AR = /usr/bin/$(AR_NAME)
|
||||||
SIZE = /usr/bin/$(SIZE_NAME)
|
SIZE = /usr/bin/$(SIZE_NAME)
|
||||||
NM = /usr/bin/$(NM_NAME)
|
NM = /usr/bin/$(NM_NAME)
|
||||||
|
```
|
||||||
|
|
||||||
|
Or if you don't want to use ccache, then just set ```AVR_TOOLS_PATH=/usr``` and none of the above will be necessary.
|
||||||
|
|
Loading…
Reference in a new issue