Merge remote-tracking branch 'sudar/master'
This commit is contained in:
commit
6c5589bd3c
11 changed files with 146 additions and 81 deletions
124
Arduino.mk
124
Arduino.mk
|
@ -19,7 +19,7 @@
|
||||||
#
|
#
|
||||||
# Original Arduino adaptation by mellis, eighthave, oli.keller
|
# Original Arduino adaptation by mellis, eighthave, oli.keller
|
||||||
#
|
#
|
||||||
# Current version: 1.5
|
# Current version: 1.5.1
|
||||||
#
|
#
|
||||||
# Refer to HISTORY.md file for complete history of changes
|
# Refer to HISTORY.md file for complete history of changes
|
||||||
#
|
#
|
||||||
|
@ -45,11 +45,16 @@
|
||||||
# that things are canonically arranged beneath the directories defined
|
# that things are canonically arranged beneath the directories defined
|
||||||
# above.
|
# above.
|
||||||
#
|
#
|
||||||
# On the Mac you might want to set:
|
# On the Mac with IDE 1.0 you might want to set:
|
||||||
#
|
#
|
||||||
# ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java
|
# ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java
|
||||||
# ARDMK_DIR = /usr/local
|
# ARDMK_DIR = /usr/local
|
||||||
#
|
#
|
||||||
|
# On the Mac with IDE 1.5+ you might want to set:
|
||||||
|
#
|
||||||
|
# ARDUINO_DIR = /Applications/Arduino.app/Contents/Java
|
||||||
|
# ARDMK_DIR = /usr/local
|
||||||
|
#
|
||||||
# On Linux, you might prefer:
|
# On Linux, you might prefer:
|
||||||
#
|
#
|
||||||
# ARDUINO_DIR = /usr/share/arduino
|
# ARDUINO_DIR = /usr/share/arduino
|
||||||
|
@ -266,7 +271,9 @@ endif
|
||||||
# Default TARGET to pwd (ex Daniele Vergini)
|
# Default TARGET to pwd (ex Daniele Vergini)
|
||||||
|
|
||||||
ifndef TARGET
|
ifndef TARGET
|
||||||
TARGET = $(notdir $(CURDIR))
|
space :=
|
||||||
|
space +=
|
||||||
|
TARGET = $(notdir $(subst $(space),_,$(CURDIR)))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -317,11 +324,11 @@ endif
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# 1.5.x vendor - defaults to arduino
|
# 1.5.x vendor - defaults to arduino
|
||||||
ifndef VENDOR
|
ifndef ARDMK_VENDOR
|
||||||
VENDOR = arduino
|
ARDMK_VENDOR = arduino
|
||||||
$(call show_config_variable,VENDOR,[DEFAULT])
|
$(call show_config_variable,ARDMK_VENDOR,[DEFAULT])
|
||||||
else
|
else
|
||||||
$(call show_config_variable,VENDOR,[USER])
|
$(call show_config_variable,ARDMK_VENDOR,[USER])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -450,11 +457,12 @@ ifndef AVR_TOOLS_DIR
|
||||||
else
|
else
|
||||||
$(call show_config_variable,AVR_TOOLS_DIR,[USER])
|
$(call show_config_variable,AVR_TOOLS_DIR,[USER])
|
||||||
|
|
||||||
# Check in Windows as Cygwin is being used, that the configuration file for the AVRDUDE is set
|
# ensure we can still find avrdude.conf
|
||||||
# Check if it works on MAC
|
|
||||||
ifeq ($(CURRENT_OS),WINDOWS)
|
|
||||||
ifndef AVRDUDE_CONF
|
ifndef AVRDUDE_CONF
|
||||||
|
ifeq ($(shell expr $(ARDUINO_VERSION) '>' 157), 1)
|
||||||
AVRDUDE_CONF = $(AVR_TOOLS_DIR)/etc/avrdude.conf
|
AVRDUDE_CONF = $(AVR_TOOLS_DIR)/etc/avrdude.conf
|
||||||
|
else
|
||||||
|
AVRDUDE_CONF = $(AVR_TOOLS_DIR)/../avrdude.conf
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -471,7 +479,7 @@ $(call show_config_variable,ARDUINO_LIB_PATH,[COMPUTED],(from ARDUINO_DIR))
|
||||||
ifndef ARDUINO_PLATFORM_LIB_PATH
|
ifndef ARDUINO_PLATFORM_LIB_PATH
|
||||||
ifeq ($(shell expr $(ARDUINO_VERSION) '>' 150), 1)
|
ifeq ($(shell expr $(ARDUINO_VERSION) '>' 150), 1)
|
||||||
# only for 1.5
|
# only for 1.5
|
||||||
ARDUINO_PLATFORM_LIB_PATH = $(ARDUINO_DIR)/hardware/$(VENDOR)/$(ARCHITECTURE)/libraries
|
ARDUINO_PLATFORM_LIB_PATH = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/libraries
|
||||||
$(call show_config_variable,ARDUINO_PLATFORM_LIB_PATH,[COMPUTED],(from ARDUINO_DIR))
|
$(call show_config_variable,ARDUINO_PLATFORM_LIB_PATH,[COMPUTED],(from ARDUINO_DIR))
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
|
@ -508,14 +516,14 @@ ifdef ALTERNATE_CORE_PATH
|
||||||
else
|
else
|
||||||
|
|
||||||
ifndef ARDUINO_VAR_PATH
|
ifndef ARDUINO_VAR_PATH
|
||||||
ARDUINO_VAR_PATH = $(ARDUINO_DIR)/hardware/$(VENDOR)/$(ARCHITECTURE)/variants
|
ARDUINO_VAR_PATH = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/variants
|
||||||
$(call show_config_variable,ARDUINO_VAR_PATH,[COMPUTED],(from ARDUINO_DIR))
|
$(call show_config_variable,ARDUINO_VAR_PATH,[COMPUTED],(from ARDUINO_DIR))
|
||||||
else
|
else
|
||||||
$(call show_config_variable,ARDUINO_VAR_PATH,[USER])
|
$(call show_config_variable,ARDUINO_VAR_PATH,[USER])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef BOARDS_TXT
|
ifndef BOARDS_TXT
|
||||||
BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(VENDOR)/$(ARCHITECTURE)/boards.txt
|
BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/boards.txt
|
||||||
$(call show_config_variable,BOARDS_TXT,[COMPUTED],(from ARDUINO_DIR))
|
$(call show_config_variable,BOARDS_TXT,[COMPUTED],(from ARDUINO_DIR))
|
||||||
else
|
else
|
||||||
$(call show_config_variable,BOARDS_TXT,[USER])
|
$(call show_config_variable,BOARDS_TXT,[USER])
|
||||||
|
@ -560,7 +568,7 @@ endif
|
||||||
|
|
||||||
ifndef PARSE_BOARD
|
ifndef PARSE_BOARD
|
||||||
# result = $(call READ_BOARD_TXT, 'boardname', 'parameter')
|
# result = $(call READ_BOARD_TXT, 'boardname', 'parameter')
|
||||||
PARSE_BOARD = $(shell grep -v '^\#' $(BOARDS_TXT) | grep $(1).$(2)= | cut -d = -f 2 )
|
PARSE_BOARD = $(shell grep -v '^\#' $(BOARDS_TXT) | grep "^[ \t]*$(1).$(2)=" | cut -d = -f 2)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# If NO_CORE is set, then we don't have to parse boards.txt file
|
# If NO_CORE is set, then we don't have to parse boards.txt file
|
||||||
|
@ -701,16 +709,16 @@ else
|
||||||
$(call show_config_variable,OBJDIR,[USER])
|
$(call show_config_variable,OBJDIR,[USER])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Now that we have ARDUINO_DIR, VENDOR, ARCHITECTURE and CORE,
|
# Now that we have ARDUINO_DIR, ARDMK_VENDOR, ARCHITECTURE and CORE,
|
||||||
# we can set ARDUINO_CORE_PATH.
|
# we can set ARDUINO_CORE_PATH.
|
||||||
ifndef ARDUINO_CORE_PATH
|
ifndef ARDUINO_CORE_PATH
|
||||||
ifeq ($(strip $(CORE)),)
|
ifeq ($(strip $(CORE)),)
|
||||||
ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/$(VENDOR)/$(ARCHITECTURE)/cores/arduino
|
ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/cores/arduino
|
||||||
$(call show_config_variable,ARDUINO_CORE_PATH,[DEFAULT])
|
$(call show_config_variable,ARDUINO_CORE_PATH,[DEFAULT])
|
||||||
else
|
else
|
||||||
ARDUINO_CORE_PATH = $(ALTERNATE_CORE_PATH)/cores/$(CORE)
|
ARDUINO_CORE_PATH = $(ALTERNATE_CORE_PATH)/cores/$(CORE)
|
||||||
ifeq ($(wildcard $(ARDUINO_CORE_PATH)),)
|
ifeq ($(wildcard $(ARDUINO_CORE_PATH)),)
|
||||||
ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/$(VENDOR)/$(ARCHITECTURE)/cores/$(CORE)
|
ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/cores/$(CORE)
|
||||||
$(call show_config_variable,ARDUINO_CORE_PATH,[COMPUTED],(from ARDUINO_DIR, BOARD_TAG and boards.txt))
|
$(call show_config_variable,ARDUINO_CORE_PATH,[COMPUTED],(from ARDUINO_DIR, BOARD_TAG and boards.txt))
|
||||||
else
|
else
|
||||||
$(call show_config_variable,ARDUINO_CORE_PATH,[COMPUTED],(from ALTERNATE_CORE_PATH, BOARD_TAG and boards.txt))
|
$(call show_config_variable,ARDUINO_CORE_PATH,[COMPUTED],(from ALTERNATE_CORE_PATH, BOARD_TAG and boards.txt))
|
||||||
|
@ -763,9 +771,9 @@ LOCAL_AS_SRCS ?= $(wildcard *.S)
|
||||||
LOCAL_SRCS = $(LOCAL_C_SRCS) $(LOCAL_CPP_SRCS) \
|
LOCAL_SRCS = $(LOCAL_C_SRCS) $(LOCAL_CPP_SRCS) \
|
||||||
$(LOCAL_CC_SRCS) $(LOCAL_PDE_SRCS) \
|
$(LOCAL_CC_SRCS) $(LOCAL_PDE_SRCS) \
|
||||||
$(LOCAL_INO_SRCS) $(LOCAL_AS_SRCS)
|
$(LOCAL_INO_SRCS) $(LOCAL_AS_SRCS)
|
||||||
LOCAL_OBJ_FILES = $(LOCAL_C_SRCS:.c=.o) $(LOCAL_CPP_SRCS:.cpp=.o) \
|
LOCAL_OBJ_FILES = $(LOCAL_C_SRCS:.c=.c.o) $(LOCAL_CPP_SRCS:.cpp=.cpp.o) \
|
||||||
$(LOCAL_CC_SRCS:.cc=.o) $(LOCAL_PDE_SRCS:.pde=.o) \
|
$(LOCAL_CC_SRCS:.cc=.cc.o) $(LOCAL_PDE_SRCS:.pde=.pde.o) \
|
||||||
$(LOCAL_INO_SRCS:.ino=.o) $(LOCAL_AS_SRCS:.S=.o)
|
$(LOCAL_INO_SRCS:.ino=.ino.o) $(LOCAL_AS_SRCS:.S=.S.o)
|
||||||
LOCAL_OBJS = $(patsubst %,$(OBJDIR)/%,$(LOCAL_OBJ_FILES))
|
LOCAL_OBJS = $(patsubst %,$(OBJDIR)/%,$(LOCAL_OBJ_FILES))
|
||||||
|
|
||||||
ifeq ($(words $(LOCAL_SRCS)), 0)
|
ifeq ($(words $(LOCAL_SRCS)), 0)
|
||||||
|
@ -797,13 +805,14 @@ ifeq ($(strip $(NO_CORE)),)
|
||||||
CORE_C_SRCS = $(wildcard $(ARDUINO_CORE_PATH)/*.c)
|
CORE_C_SRCS = $(wildcard $(ARDUINO_CORE_PATH)/*.c)
|
||||||
CORE_C_SRCS += $(wildcard $(ARDUINO_CORE_PATH)/avr-libc/*.c)
|
CORE_C_SRCS += $(wildcard $(ARDUINO_CORE_PATH)/avr-libc/*.c)
|
||||||
CORE_CPP_SRCS = $(wildcard $(ARDUINO_CORE_PATH)/*.cpp)
|
CORE_CPP_SRCS = $(wildcard $(ARDUINO_CORE_PATH)/*.cpp)
|
||||||
|
CORE_AS_SRCS = $(wildcard $(ARDUINO_CORE_PATH)/*.S)
|
||||||
|
|
||||||
ifneq ($(strip $(NO_CORE_MAIN_CPP)),)
|
ifneq ($(strip $(NO_CORE_MAIN_CPP)),)
|
||||||
CORE_CPP_SRCS := $(filter-out %main.cpp, $(CORE_CPP_SRCS))
|
CORE_CPP_SRCS := $(filter-out %main.cpp, $(CORE_CPP_SRCS))
|
||||||
$(call show_config_info,NO_CORE_MAIN_CPP set so core library will not include main.cpp,[MANUAL])
|
$(call show_config_info,NO_CORE_MAIN_CPP set so core library will not include main.cpp,[MANUAL])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CORE_OBJ_FILES = $(CORE_C_SRCS:.c=.o) $(CORE_CPP_SRCS:.cpp=.o) $(CORE_AS_SRCS:.S=.o)
|
CORE_OBJ_FILES = $(CORE_C_SRCS:.c=.c.o) $(CORE_CPP_SRCS:.cpp=.cpp.o) $(CORE_AS_SRCS:.S=.S.o)
|
||||||
CORE_OBJS = $(patsubst $(ARDUINO_CORE_PATH)/%, \
|
CORE_OBJS = $(patsubst $(ARDUINO_CORE_PATH)/%, \
|
||||||
$(OBJDIR)/core/%,$(CORE_OBJ_FILES))
|
$(OBJDIR)/core/%,$(CORE_OBJ_FILES))
|
||||||
endif
|
endif
|
||||||
|
@ -811,6 +820,7 @@ else
|
||||||
$(call show_config_info,NO_CORE set so core library will not be built,[MANUAL])
|
$(call show_config_info,NO_CORE set so core library will not be built,[MANUAL])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# Determine ARDUINO_LIBS automatically
|
# Determine ARDUINO_LIBS automatically
|
||||||
|
|
||||||
|
@ -953,21 +963,21 @@ LIB_AS_SRCS := $(foreach lib, $(SYS_LIBS), $(call get_library_files,$(l
|
||||||
USER_LIB_CPP_SRCS := $(foreach lib, $(USER_LIBS), $(call get_library_files,$(lib),cpp))
|
USER_LIB_CPP_SRCS := $(foreach lib, $(USER_LIBS), $(call get_library_files,$(lib),cpp))
|
||||||
USER_LIB_C_SRCS := $(foreach lib, $(USER_LIBS), $(call get_library_files,$(lib),c))
|
USER_LIB_C_SRCS := $(foreach lib, $(USER_LIBS), $(call get_library_files,$(lib),c))
|
||||||
USER_LIB_AS_SRCS := $(foreach lib, $(USER_LIBS), $(call get_library_files,$(lib),S))
|
USER_LIB_AS_SRCS := $(foreach lib, $(USER_LIBS), $(call get_library_files,$(lib),S))
|
||||||
LIB_OBJS = $(patsubst $(ARDUINO_LIB_PATH)/%.c,$(OBJDIR)/libs/%.o,$(LIB_C_SRCS)) \
|
LIB_OBJS = $(patsubst $(ARDUINO_LIB_PATH)/%.c,$(OBJDIR)/libs/%.c.o,$(LIB_C_SRCS)) \
|
||||||
$(patsubst $(ARDUINO_LIB_PATH)/%.cpp,$(OBJDIR)/libs/%.o,$(LIB_CPP_SRCS)) \
|
$(patsubst $(ARDUINO_LIB_PATH)/%.cpp,$(OBJDIR)/libs/%.cpp.o,$(LIB_CPP_SRCS)) \
|
||||||
$(patsubst $(ARDUINO_LIB_PATH)/%.S,$(OBJDIR)/libs/%.o,$(LIB_AS_SRCS))
|
$(patsubst $(ARDUINO_LIB_PATH)/%.S,$(OBJDIR)/libs/%.S.o,$(LIB_AS_SRCS))
|
||||||
USER_LIB_OBJS = $(patsubst $(USER_LIB_PATH)/%.cpp,$(OBJDIR)/userlibs/%.o,$(USER_LIB_CPP_SRCS)) \
|
USER_LIB_OBJS = $(patsubst $(USER_LIB_PATH)/%.cpp,$(OBJDIR)/userlibs/%.cpp.o,$(USER_LIB_CPP_SRCS)) \
|
||||||
$(patsubst $(USER_LIB_PATH)/%.c,$(OBJDIR)/userlibs/%.o,$(USER_LIB_C_SRCS)) \
|
$(patsubst $(USER_LIB_PATH)/%.c,$(OBJDIR)/userlibs/%.c.o,$(USER_LIB_C_SRCS)) \
|
||||||
$(patsubst $(USER_LIB_PATH)/%.S,$(OBJDIR)/userlibs/%.o,$(USER_LIB_AS_SRCS))
|
$(patsubst $(USER_LIB_PATH)/%.S,$(OBJDIR)/userlibs/%.S.o,$(USER_LIB_AS_SRCS))
|
||||||
|
|
||||||
ifdef ARDUINO_PLATFORM_LIB_PATH
|
ifdef ARDUINO_PLATFORM_LIB_PATH
|
||||||
PLATFORM_INCLUDES := $(foreach lib, $(PLATFORM_LIBS), $(call get_library_includes,$(lib)))
|
PLATFORM_INCLUDES := $(foreach lib, $(PLATFORM_LIBS), $(call get_library_includes,$(lib)))
|
||||||
PLATFORM_LIB_CPP_SRCS := $(foreach lib, $(PLATFORM_LIBS), $(call get_library_files,$(lib),cpp))
|
PLATFORM_LIB_CPP_SRCS := $(foreach lib, $(PLATFORM_LIBS), $(call get_library_files,$(lib),cpp))
|
||||||
PLATFORM_LIB_C_SRCS := $(foreach lib, $(PLATFORM_LIBS), $(call get_library_files,$(lib),c))
|
PLATFORM_LIB_C_SRCS := $(foreach lib, $(PLATFORM_LIBS), $(call get_library_files,$(lib),c))
|
||||||
PLATFORM_LIB_AS_SRCS := $(foreach lib, $(PLATFORM_LIBS), $(call get_library_files,$(lib),S))
|
PLATFORM_LIB_AS_SRCS := $(foreach lib, $(PLATFORM_LIBS), $(call get_library_files,$(lib),S))
|
||||||
PLATFORM_LIB_OBJS := $(patsubst $(ARDUINO_PLATFORM_LIB_PATH)/%.cpp,$(OBJDIR)/platformlibs/%.o,$(PLATFORM_LIB_CPP_SRCS)) \
|
PLATFORM_LIB_OBJS := $(patsubst $(ARDUINO_PLATFORM_LIB_PATH)/%.cpp,$(OBJDIR)/platformlibs/%.cpp.o,$(PLATFORM_LIB_CPP_SRCS)) \
|
||||||
$(patsubst $(ARDUINO_PLATFORM_LIB_PATH)/%.c,$(OBJDIR)/platformlibs/%.o,$(PLATFORM_LIB_C_SRCS)) \
|
$(patsubst $(ARDUINO_PLATFORM_LIB_PATH)/%.c,$(OBJDIR)/platformlibs/%.c.o,$(PLATFORM_LIB_C_SRCS)) \
|
||||||
$(patsubst $(ARDUINO_PLATFORM_LIB_PATH)/%.S,$(OBJDIR)/platformlibs/%.o,$(PLATFORM_LIB_AS_SRCS))
|
$(patsubst $(ARDUINO_PLATFORM_LIB_PATH)/%.S,$(OBJDIR)/platformlibs/%.S.o,$(PLATFORM_LIB_AS_SRCS))
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -989,7 +999,7 @@ ifndef DEBUG_FLAGS
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# SoftwareSerial requires -Os (some delays are tuned for this optimization level)
|
# SoftwareSerial requires -Os (some delays are tuned for this optimization level)
|
||||||
%SoftwareSerial.o : OPTIMIZATION_FLAGS = -Os
|
%SoftwareSerial.cpp.o : OPTIMIZATION_FLAGS = -Os
|
||||||
|
|
||||||
ifndef MCU_FLAG_NAME
|
ifndef MCU_FLAG_NAME
|
||||||
MCU_FLAG_NAME = mmcu
|
MCU_FLAG_NAME = mmcu
|
||||||
|
@ -1116,7 +1126,7 @@ endif
|
||||||
|
|
||||||
# either calculate parent dir from arduino dir, or user-defined path
|
# either calculate parent dir from arduino dir, or user-defined path
|
||||||
ifndef BOOTLOADER_PARENT
|
ifndef BOOTLOADER_PARENT
|
||||||
BOOTLOADER_PARENT = $(ARDUINO_DIR)/hardware/$(VENDOR)/$(ARCHITECTURE)/bootloaders
|
BOOTLOADER_PARENT = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/bootloaders
|
||||||
$(call show_config_variable,BOOTLOADER_PARENT,[COMPUTED],(from ARDUINO_DIR))
|
$(call show_config_variable,BOOTLOADER_PARENT,[COMPUTED],(from ARDUINO_DIR))
|
||||||
else
|
else
|
||||||
$(call show_config_variable,BOOTLOADER_PARENT,[USER])
|
$(call show_config_variable,BOOTLOADER_PARENT,[USER])
|
||||||
|
@ -1142,39 +1152,39 @@ $(call show_separator)
|
||||||
# easy to change the build options in future
|
# easy to change the build options in future
|
||||||
|
|
||||||
# library sources
|
# library sources
|
||||||
$(OBJDIR)/libs/%.o: $(ARDUINO_LIB_PATH)/%.c
|
$(OBJDIR)/libs/%.c.o: $(ARDUINO_LIB_PATH)/%.c
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
$(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/libs/%.o: $(ARDUINO_LIB_PATH)/%.cpp
|
$(OBJDIR)/libs/%.cpp.o: $(ARDUINO_LIB_PATH)/%.cpp
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
$(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/libs/%.o: $(ARDUINO_LIB_PATH)/%.S
|
$(OBJDIR)/libs/%.S.o: $(ARDUINO_LIB_PATH)/%.S
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
|
$(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/platformlibs/%.o: $(ARDUINO_PLATFORM_LIB_PATH)/%.c
|
$(OBJDIR)/platformlibs/%.c.o: $(ARDUINO_PLATFORM_LIB_PATH)/%.c
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
$(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/platformlibs/%.o: $(ARDUINO_PLATFORM_LIB_PATH)/%.cpp
|
$(OBJDIR)/platformlibs/%.cpp.o: $(ARDUINO_PLATFORM_LIB_PATH)/%.cpp
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
$(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/platformlibs/%.o: $(ARDUINO_PLATFORM_LIB_PATH)/%.S
|
$(OBJDIR)/platformlibs/%.S.o: $(ARDUINO_PLATFORM_LIB_PATH)/%.S
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
|
$(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/userlibs/%.o: $(USER_LIB_PATH)/%.cpp
|
$(OBJDIR)/userlibs/%.cpp.o: $(USER_LIB_PATH)/%.cpp
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
$(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/userlibs/%.o: $(USER_LIB_PATH)/%.c
|
$(OBJDIR)/userlibs/%.c.o: $(USER_LIB_PATH)/%.c
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
$(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/userlibs/%.o: $(USER_LIB_PATH)/%.S
|
$(OBJDIR)/userlibs/%.S.o: $(USER_LIB_PATH)/%.S
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
|
$(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
|
||||||
|
|
||||||
|
@ -1185,33 +1195,33 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# normal local sources
|
# normal local sources
|
||||||
$(OBJDIR)/%.o: %.c $(COMMON_DEPS) | $(OBJDIR)
|
$(OBJDIR)/%.c.o: %.c $(COMMON_DEPS) | $(OBJDIR)
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
$(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/%.o: %.cc $(COMMON_DEPS) | $(OBJDIR)
|
$(OBJDIR)/%.cc.o: %.cc $(COMMON_DEPS) | $(OBJDIR)
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
$(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/%.o: %.cpp $(COMMON_DEPS) | $(OBJDIR)
|
$(OBJDIR)/%.cpp.o: %.cpp $(COMMON_DEPS) | $(OBJDIR)
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
$(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/%.o: %.S $(COMMON_DEPS) | $(OBJDIR)
|
$(OBJDIR)/%.S.o: %.S $(COMMON_DEPS) | $(OBJDIR)
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
|
$(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/%.o: %.s $(COMMON_DEPS) | $(OBJDIR)
|
$(OBJDIR)/%.s.o: %.s $(COMMON_DEPS) | $(OBJDIR)
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CC) -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
|
$(CC) -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
|
||||||
|
|
||||||
# the pde -> o file
|
# the pde -> o file
|
||||||
$(OBJDIR)/%.o: %.pde $(COMMON_DEPS) | $(OBJDIR)
|
$(OBJDIR)/%.pde.o: %.pde $(COMMON_DEPS) | $(OBJDIR)
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
$(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
||||||
|
|
||||||
# the ino -> o file
|
# the ino -> o file
|
||||||
$(OBJDIR)/%.o: %.ino $(COMMON_DEPS) | $(OBJDIR)
|
$(OBJDIR)/%.ino.o: %.ino $(COMMON_DEPS) | $(OBJDIR)
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
$(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
||||||
|
|
||||||
|
@ -1229,15 +1239,15 @@ $(OBJDIR)/%.s: %.cpp $(COMMON_DEPS) | $(OBJDIR)
|
||||||
$(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -S -fverbose-asm $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
$(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -S -fverbose-asm $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
||||||
|
|
||||||
# core files
|
# core files
|
||||||
$(OBJDIR)/core/%.o: $(ARDUINO_CORE_PATH)/%.c $(COMMON_DEPS) | $(OBJDIR)
|
$(OBJDIR)/core/%.c.o: $(ARDUINO_CORE_PATH)/%.c $(COMMON_DEPS) | $(OBJDIR)
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
$(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/core/%.o: $(ARDUINO_CORE_PATH)/%.cpp $(COMMON_DEPS) | $(OBJDIR)
|
$(OBJDIR)/core/%.cpp.o: $(ARDUINO_CORE_PATH)/%.cpp $(COMMON_DEPS) | $(OBJDIR)
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
$(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/core/%.o: $(ARDUINO_CORE_PATH)/%.S $(COMMON_DEPS) | $(OBJDIR)
|
$(OBJDIR)/core/%.S.o: $(ARDUINO_CORE_PATH)/%.S $(COMMON_DEPS) | $(OBJDIR)
|
||||||
@$(MKDIR) $(dir $@)
|
@$(MKDIR) $(dir $@)
|
||||||
$(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
|
$(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@
|
||||||
|
|
||||||
|
@ -1348,12 +1358,10 @@ endif
|
||||||
|
|
||||||
# Bootloader file settings
|
# Bootloader file settings
|
||||||
ifndef AVRDUDE_ISP_BURN_BOOTLOADER
|
ifndef AVRDUDE_ISP_BURN_BOOTLOADER
|
||||||
ifneq ($(strip $(BOOTLOADER_PATH)),)
|
|
||||||
ifneq ($(strip $(BOOTLOADER_FILE)),)
|
ifneq ($(strip $(BOOTLOADER_FILE)),)
|
||||||
AVRDUDE_ISP_BURN_BOOTLOADER += -U flash:w:$(BOOTLOADER_PARENT)/$(BOOTLOADER_PATH)/$(BOOTLOADER_FILE):i
|
AVRDUDE_ISP_BURN_BOOTLOADER += -U flash:w:$(BOOTLOADER_PARENT)/$(BOOTLOADER_PATH)/$(BOOTLOADER_FILE):i
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
# Post fuse settings
|
# Post fuse settings
|
||||||
ifndef AVRDUDE_ISP_FUSES_POST
|
ifndef AVRDUDE_ISP_FUSES_POST
|
||||||
|
@ -1368,7 +1376,7 @@ endif
|
||||||
AVRDUDE_ISP_OPTS = -c $(ISP_PROG) -b $(AVRDUDE_ISP_BAUDRATE)
|
AVRDUDE_ISP_OPTS = -c $(ISP_PROG) -b $(AVRDUDE_ISP_BAUDRATE)
|
||||||
|
|
||||||
ifndef $(ISP_PORT)
|
ifndef $(ISP_PORT)
|
||||||
ifneq ($(strip $(ISP_PROG)),$(filter $(ISP_PROG), usbasp usbtiny gpio linuxgpio avrispmkii))
|
ifneq ($(strip $(ISP_PROG)),$(filter $(ISP_PROG), usbasp usbtiny gpio linuxgpio avrispmkii dragon_isp dragon_dw))
|
||||||
AVRDUDE_ISP_OPTS += -P $(call get_isp_port)
|
AVRDUDE_ISP_OPTS += -P $(call get_isp_port)
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
|
@ -1405,7 +1413,7 @@ pre-build:
|
||||||
$(call runscript_if_exists,$(PRE_BUILD_HOOK))
|
$(call runscript_if_exists,$(PRE_BUILD_HOOK))
|
||||||
|
|
||||||
$(TARGET_ELF): $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS)
|
$(TARGET_ELF): $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS)
|
||||||
$(CC) $(LDFLAGS) -o $@ $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS) -lc -lm
|
$(CC) $(LDFLAGS) -o $@ $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS) -lc -lm $(LINKER_SCRIPTS)
|
||||||
|
|
||||||
$(CORE_LIB): $(CORE_OBJS) $(LIB_OBJS) $(PLATFORM_LIB_OBJS) $(USER_LIB_OBJS)
|
$(CORE_LIB): $(CORE_OBJS) $(LIB_OBJS) $(PLATFORM_LIB_OBJS) $(USER_LIB_OBJS)
|
||||||
$(AR) rcs $@ $(CORE_OBJS) $(LIB_OBJS) $(PLATFORM_LIB_OBJS) $(USER_LIB_OBJS)
|
$(AR) rcs $@ $(CORE_OBJS) $(LIB_OBJS) $(PLATFORM_LIB_OBJS) $(USER_LIB_OBJS)
|
||||||
|
@ -1485,7 +1493,10 @@ 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 '^[a-zA-Z0-9_]+.name' | sort -uf | sed 's/.name=/:/' | column -s: -t
|
@$(CAT) $(BOARDS_TXT) | grep -E '^[a-zA-Z0-9_\-]+.name' | sort -uf | sed 's/.name=/:/' | column -s: -t
|
||||||
|
|
||||||
|
show_submenu:
|
||||||
|
@$(CAT) $(BOARDS_TXT) | grep -E '[a-zA-Z0-9_\-]+.menu.cpu.[a-zA-Z0-9_\-]+=' | sort -uf | sed 's/.menu.cpu./:/' | sed 's/=/:/' | column -s: -t
|
||||||
|
|
||||||
monitor:
|
monitor:
|
||||||
ifeq ($(MONITOR_CMD), 'putty')
|
ifeq ($(MONITOR_CMD), 'putty')
|
||||||
|
@ -1535,6 +1546,7 @@ help:
|
||||||
make reset - reset the Arduino by tickling DTR or changing baud\n\
|
make reset - reset the Arduino by tickling DTR or changing baud\n\
|
||||||
rate on the serial port.\n\
|
rate on the serial port.\n\
|
||||||
make show_boards - list all the boards defined in boards.txt\n\
|
make show_boards - list all the boards defined in boards.txt\n\
|
||||||
|
make show_submenu - list all board submenus defined in boards.txt\n\
|
||||||
make monitor - connect to the Arduino's serial port\n\
|
make monitor - connect to the Arduino's serial port\n\
|
||||||
make size - show the size of the compiled output (relative to\n\
|
make size - show the size of the compiled output (relative to\n\
|
||||||
resources, if you have a patched avr-size).\n\
|
resources, if you have a patched avr-size).\n\
|
||||||
|
|
13
HISTORY.md
13
HISTORY.md
|
@ -4,17 +4,28 @@ A Makefile for Arduino Sketches
|
||||||
The following is the rough list of changes that went into different versions.
|
The following is the rough list of changes that went into different versions.
|
||||||
I tried to give credit whenever possible. If I have missed anyone, kindly add it to the list.
|
I tried to give credit whenever possible. If I have missed anyone, kindly add it to the list.
|
||||||
|
|
||||||
### In Development
|
### 1.5.1 (Debian version: 1.5-3) (2016-02-22)
|
||||||
|
|
||||||
|
- New: Add show_submenu target (https://github.com/drewhutchison)
|
||||||
|
- New: Add AVR Dragon to list of ISP's without a port (https://github.com/mtnocean)
|
||||||
- New: Add more board examples to Blink demo (https://github.com/sej7278)
|
- New: Add more board examples to Blink demo (https://github.com/sej7278)
|
||||||
- New: Add option to split avrdude MCU from avr-gcc MCU (Issue #357) (https://github.com/hhgarnes)
|
- New: Add option to split avrdude MCU from avr-gcc MCU (Issue #357) (https://github.com/hhgarnes)
|
||||||
- New: Add support for /dev/tty.wchusbserial* (comes with cheap clones - DCCduino) (https://github.com/biesiad)
|
- New: Add support for /dev/tty.wchusbserial* (comes with cheap clones - DCCduino) (https://github.com/biesiad)
|
||||||
- New: Add support for picocom as serial monitor (https://github.com/biesiad)
|
- New: Add support for picocom as serial monitor (https://github.com/biesiad)
|
||||||
|
- Tweak: Add support for Adafruit trinket3/trinket5/protrinket3/protrinket5 by improved BOARDS_TXT parsing (Issue #393) (https://github/com/zabereer)
|
||||||
- Tweak: Looks for submenu items first when parsing BOARDS_TXT (Issue #347) (https://github.com/sej7278)
|
- Tweak: Looks for submenu items first when parsing BOARDS_TXT (Issue #347) (https://github.com/sej7278)
|
||||||
- Tweak: Various spelling/grammar/typo fixes (https://github.com/dcousens)
|
- Tweak: Various spelling/grammar/typo fixes (https://github.com/dcousens)
|
||||||
- Tweak: Clarified some 1.5+ issues in docs (Issue #352) (https://github.com/sej7278)
|
- Tweak: Clarified some 1.5+ issues in docs (Issue #352) (https://github.com/sej7278)
|
||||||
- Tweak: Added some more Continuous Integration tests (https://github.com/sej7278)
|
- Tweak: Added some more Continuous Integration tests (https://github.com/sej7278)
|
||||||
- Tweak: Updated Fedora instructions (https://github.com/sej7278)
|
- Tweak: Updated Fedora instructions (https://github.com/sej7278)
|
||||||
|
- Fix: Preserve original extension for object files, support asm sources in core, fixes pulseInASM (Issue #255, #364) (https://github.com/sej7278)
|
||||||
|
- Fix: Make sure TARGET is set correctly when CURDIR contains spaces (https://github.com/svendahlstrand)
|
||||||
|
- Fix: Ensure AVRDUDE_CONF is set when AVR_TOOLS_DIR is, not just on Windows (Issue #381) (https://github.com/sej7278)
|
||||||
|
- Fix: Rename VENDOR to ARDMK_VENDOR to workaround tcsh issue (Issue #386) (https://github.com/sej7278)
|
||||||
|
- Fix: Document OSX 1.0/1.6 ARDUINO_DIR differences (https://github.com/thomaskilian)
|
||||||
|
- Fix: Fix regex to support BOARD_TAGs with hyphens e.g. attiny44-20 (https://github.com/sej7278)
|
||||||
|
- Fix: Remove check for BOOTLOADER_PATH, just check for BOOTLOADER_FILE (Issue #402) (https://github.com/sej7278)
|
||||||
|
- Fix: Port ard-reset-arduino to pyserial 3.0 (#407, #408) (https://github.com/gauteh)
|
||||||
|
|
||||||
### 1.5 (2015-04-07)
|
### 1.5 (2015-04-07)
|
||||||
- New: Add support for new 1.5.x library layout (Issue #275) (https://github.com/lukasz-e)
|
- New: Add support for new 1.5.x library layout (Issue #275) (https://github.com/lukasz-e)
|
||||||
|
|
10
README.md
10
README.md
|
@ -134,7 +134,7 @@ whilst [Blink](examples/Blink/Makefile) demonstrates the minimal settings requir
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
On the Mac you might want to set:
|
On the Mac with IDE 1.0 you might want to set:
|
||||||
|
|
||||||
```make
|
```make
|
||||||
ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java
|
ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java
|
||||||
|
@ -144,6 +144,12 @@ On the Mac you might want to set:
|
||||||
BOARD_TAG = mega2560
|
BOARD_TAG = mega2560
|
||||||
```
|
```
|
||||||
|
|
||||||
|
On the Mac with IDE 1.5+ it's like above but with
|
||||||
|
|
||||||
|
```
|
||||||
|
ARDUINO_DIR = /Applications/Arduino.app/Contents/Java
|
||||||
|
```
|
||||||
|
|
||||||
On Linux (if you have installed through package), you shouldn't need to set anything other than your board type and port:
|
On Linux (if you have installed through package), you shouldn't need to set anything other than your board type and port:
|
||||||
|
|
||||||
```make
|
```make
|
||||||
|
@ -242,7 +248,7 @@ See examples/BlinkTeensy for example usage.
|
||||||
|
|
||||||
## Versioning
|
## Versioning
|
||||||
|
|
||||||
The current version of the makefile is `1.5`. You can find the full history in the [HISTORY.md](HISTORY.md) file
|
The current version of the makefile is `1.5.1`. You can find the full history in the [HISTORY.md](HISTORY.md) file
|
||||||
|
|
||||||
This project adheres to Semantic [Versioning 2.0](http://semver.org/).
|
This project adheres to Semantic [Versioning 2.0](http://semver.org/).
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,9 @@ endif
|
||||||
# include Common.mk now we know where it is
|
# include Common.mk now we know where it is
|
||||||
include $(ARDMK_DIR)/Common.mk
|
include $(ARDMK_DIR)/Common.mk
|
||||||
|
|
||||||
VENDOR = teensy
|
ARDMK_VENDOR = teensy
|
||||||
ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/teensy/cores/teensy3
|
ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/teensy/cores/teensy3
|
||||||
BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(VENDOR)/boards.txt
|
BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/boards.txt
|
||||||
|
|
||||||
ifndef F_CPU
|
ifndef F_CPU
|
||||||
F_CPU=96000000
|
F_CPU=96000000
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.TH ARD-RESET-ARDUINO "1" "April 2015" "ard-reset-arduino 1.5" "Arduino CLI Reset"
|
.TH ARD-RESET-ARDUINO "1" "February 2016" "ard-reset-arduino 1.5.1" "Arduino CLI Reset"
|
||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
ard-reset-arduino - Reset Arduino board
|
ard-reset-arduino - Reset Arduino board
|
||||||
|
|
|
@ -166,7 +166,7 @@ ARCHITECTURE = sam
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
### VENDOR
|
### ARDMK_VENDOR
|
||||||
|
|
||||||
**Description:**
|
**Description:**
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ Defaults to `arduino`
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
```Makefile
|
```Makefile
|
||||||
VENDOR = sparkfun
|
ARDMK_VENDOR = sparkfun
|
||||||
```
|
```
|
||||||
|
|
||||||
**Requirement:** *Optional*
|
**Requirement:** *Optional*
|
||||||
|
@ -281,7 +281,7 @@ BOARD_TAG = uno or mega2560
|
||||||
|
|
||||||
**Description:**
|
**Description:**
|
||||||
|
|
||||||
1.5+ submenu as listed in `boards.txt`
|
1.5+ submenu as listed in `boards.txt` or `make show_submenu`.
|
||||||
|
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
|
@ -378,6 +378,26 @@ OBJDIR = /path/to/my/project-directory/bin
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
### TARGET
|
||||||
|
|
||||||
|
**Description:**
|
||||||
|
|
||||||
|
What name you would like for generated target files.
|
||||||
|
|
||||||
|
Defaults to the name of your current working directory, but with underscores (_) instead of spaces.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
```Makefile
|
||||||
|
TARGET = my-project
|
||||||
|
```
|
||||||
|
|
||||||
|
Will generate targets like `my-project.hex` and `my-project.elf`.
|
||||||
|
|
||||||
|
**Requirement:** *Optional*
|
||||||
|
|
||||||
|
----
|
||||||
|
|
||||||
### ALTERNATE_CORE
|
### ALTERNATE_CORE
|
||||||
|
|
||||||
**Description:**
|
**Description:**
|
||||||
|
|
|
@ -6,6 +6,12 @@ import os.path
|
||||||
import argparse
|
import argparse
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
|
pyserial_version = None
|
||||||
|
try:
|
||||||
|
pyserial_version = int(serial.VERSION[0])
|
||||||
|
except:
|
||||||
|
pyserial_version = 2 # less than 2.3
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Reset an Arduino')
|
parser = argparse.ArgumentParser(description='Reset an Arduino')
|
||||||
parser.add_argument('--caterina', action='store_true', help='Reset a Leonardo, Micro, Robot or LilyPadUSB.')
|
parser.add_argument('--caterina', action='store_true', help='Reset a Leonardo, Micro, Robot or LilyPadUSB.')
|
||||||
parser.add_argument('--verbose', action='store_true', help="Watch what's going on on STDERR.")
|
parser.add_argument('--verbose', action='store_true', help="Watch what's going on on STDERR.")
|
||||||
|
@ -17,7 +23,12 @@ if args.caterina:
|
||||||
if args.verbose: print('Forcing reset using 1200bps open/close on port %s' % args.port[0])
|
if args.verbose: print('Forcing reset using 1200bps open/close on port %s' % args.port[0])
|
||||||
ser = serial.Serial(args.port[0], 57600)
|
ser = serial.Serial(args.port[0], 57600)
|
||||||
ser.close()
|
ser.close()
|
||||||
|
|
||||||
|
if pyserial_version < 3:
|
||||||
ser.setBaudrate (1200)
|
ser.setBaudrate (1200)
|
||||||
|
else:
|
||||||
|
ser.baudrate = 1200
|
||||||
|
|
||||||
ser.open()
|
ser.open()
|
||||||
ser.setRTS(True) # RTS line needs to be held high and DTR low
|
ser.setRTS(True) # RTS line needs to be held high and DTR low
|
||||||
ser.setDTR(False) # (see Arduino IDE source code)
|
ser.setDTR(False) # (see Arduino IDE source code)
|
||||||
|
|
14
chipKIT.mk
14
chipKIT.mk
|
@ -81,7 +81,11 @@ ARDUINO_CORE_PATH = $(ALTERNATE_CORE_PATH)/cores/$(ALTERNATE_CORE)
|
||||||
ARDUINO_PREFERENCES_PATH = $(MPIDE_PREFERENCES_PATH)
|
ARDUINO_PREFERENCES_PATH = $(MPIDE_PREFERENCES_PATH)
|
||||||
ARDUINO_DIR = $(MPIDE_DIR)
|
ARDUINO_DIR = $(MPIDE_DIR)
|
||||||
|
|
||||||
CORE_AS_SRCS = $(ARDUINO_CORE_PATH)/vector_table.S
|
CORE_AS_SRCS = $(ARDUINO_CORE_PATH)/vector_table.S \
|
||||||
|
$(ARDUINO_CORE_PATH)/cpp-startup.S \
|
||||||
|
$(ARDUINO_CORE_PATH)/crti.S \
|
||||||
|
$(ARDUINO_CORE_PATH)/crtn.S \
|
||||||
|
$(ARDUINO_CORE_PATH)/pic32_software_reset.S
|
||||||
|
|
||||||
ARDUINO_VERSION = 23
|
ARDUINO_VERSION = 23
|
||||||
|
|
||||||
|
@ -107,9 +111,11 @@ LDSCRIPT = $(call PARSE_BOARD,$(BOARD_TAG),ldscript)
|
||||||
LDSCRIPT_FILE = $(ARDUINO_CORE_PATH)/$(LDSCRIPT)
|
LDSCRIPT_FILE = $(ARDUINO_CORE_PATH)/$(LDSCRIPT)
|
||||||
|
|
||||||
MCU_FLAG_NAME=mprocessor
|
MCU_FLAG_NAME=mprocessor
|
||||||
LDFLAGS += -T$(ARDUINO_CORE_PATH)/$(LDSCRIPT)
|
LDFLAGS += -mdebugger -mno-peripheral-libs -nostartfiles -Wl,--gc-sections
|
||||||
LDFLAGS += -T$(ARDUINO_CORE_PATH)/chipKIT-application-COMMON.ld
|
LINKER_SCRIPTS += -T $(ARDUINO_CORE_PATH)/$(LDSCRIPT)
|
||||||
CPPFLAGS += -mno-smart-io -fno-short-double
|
LINKER_SCRIPTS += -T $(ARDUINO_CORE_PATH)/chipKIT-application-COMMON.ld
|
||||||
|
CPPFLAGS += -mno-smart-io -fno-short-double -fframe-base-loclist \
|
||||||
|
-g3 -Wcast-align -D_BOARD_MEGA_
|
||||||
CFLAGS_STD =
|
CFLAGS_STD =
|
||||||
|
|
||||||
include $(ARDMK_DIR)/Arduino.mk
|
include $(ARDMK_DIR)/Arduino.mk
|
||||||
|
|
|
@ -15,7 +15,7 @@ ARDMK_DIR = $(PROJECT_DIR)/Arduino-Makefile
|
||||||
### ARDUINO_DIR
|
### ARDUINO_DIR
|
||||||
### Path to the Arduino application and resources directory.
|
### Path to the Arduino application and resources directory.
|
||||||
### On OS X:
|
### On OS X:
|
||||||
ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java
|
ARDUINO_DIR = /Applications/Arduino.app/Contents/Java
|
||||||
### or on Linux: (remove the one you don't want)
|
### or on Linux: (remove the one you don't want)
|
||||||
ARDUINO_DIR = /usr/share/arduino
|
ARDUINO_DIR = /usr/share/arduino
|
||||||
|
|
||||||
|
@ -38,12 +38,12 @@ AVR_TOOLS_DIR = /usr/local
|
||||||
### or on Linux: (remove the one you don't want)
|
### or on Linux: (remove the one you don't want)
|
||||||
AVR_TOOLS_DIR = /usr
|
AVR_TOOLS_DIR = /usr
|
||||||
|
|
||||||
### AVRDDUDE
|
### AVRDUDE
|
||||||
### Path to avrdude directory.
|
### Path to avrdude directory.
|
||||||
### On OS X with `homebrew`:
|
### On OS X with `homebrew`:
|
||||||
AVRDDUDE = /usr/local/bin/avrdude
|
AVRDUDE = /usr/local/bin/avrdude
|
||||||
### or on Linux: (remove the one you don't want)
|
### or on Linux: (remove the one you don't want)
|
||||||
AVRDDUDE = /usr/bin/avrdude
|
AVRDUDE = /usr/bin/avrdude
|
||||||
|
|
||||||
### CFLAGS_STD
|
### CFLAGS_STD
|
||||||
### Set the C standard to be used during compilation. Documentation (https://github.com/WeAreLeka/Arduino-Makefile/blob/std-flags/arduino-mk-vars.md#cflags_std)
|
### Set the C standard to be used during compilation. Documentation (https://github.com/WeAreLeka/Arduino-Makefile/blob/std-flags/arduino-mk-vars.md#cflags_std)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Name: arduino-mk
|
Name: arduino-mk
|
||||||
Version: 1.5
|
Version: 1.5.1
|
||||||
Release: 1%{dist}
|
Release: 1%{dist}
|
||||||
Summary: Program your Arduino from the command line
|
Summary: Program your Arduino from the command line
|
||||||
Packager: Simon John <git@the-jedi.co.uk>
|
Packager: Simon John <git@the-jedi.co.uk>
|
||||||
|
|
|
@ -184,7 +184,6 @@ if [ -z $COMMON_SOURCED ]; then
|
||||||
PIP_SUDO_CMD=$SUDO_CMD
|
PIP_SUDO_CMD=$SUDO_CMD
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$PIP_SUDO_CMD pip install --upgrade setuptools
|
|
||||||
$PIP_SUDO_CMD pip install --src dependencies --pre -Ur $BOOTSTRAP_DIR/pip-requirements.txt
|
$PIP_SUDO_CMD pip install --src dependencies --pre -Ur $BOOTSTRAP_DIR/pip-requirements.txt
|
||||||
|
|
||||||
COMMON_SOURCED=1
|
COMMON_SOURCED=1
|
||||||
|
|
Loading…
Reference in a new issue