From ef521d284a86914bfae292d15e879370a90f149d Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Tue, 3 Dec 2013 11:24:19 -0500 Subject: [PATCH] Include assembly vector table in chipKIT build. * Added build step for assembly files in CORE * Removed duplicate flags from AS build step --- arduino-mk/Arduino.mk | 8 ++++++-- arduino-mk/chipKIT.mk | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index 69f1eca..997a853 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -652,7 +652,7 @@ ifeq ($(strip $(NO_CORE)),) $(call show_config_info,NO_CORE_MAIN_CPP set so core library will not include main.cpp,[MANUAL]) endif - CORE_OBJ_FILES = $(CORE_C_SRCS:.c=.o) $(CORE_CPP_SRCS:.cpp=.o) + CORE_OBJ_FILES = $(CORE_C_SRCS:.c=.o) $(CORE_CPP_SRCS:.cpp=.o) $(CORE_AS_SRCS:.S=.o) CORE_OBJS = $(patsubst $(ARDUINO_CORE_PATH)/%, \ $(OBJDIR)/%,$(CORE_OBJ_FILES)) endif @@ -811,7 +811,7 @@ endif CFLAGS += $(EXTRA_FLAGS) $(EXTRA_CFLAGS) CXXFLAGS += -fno-exceptions $(EXTRA_FLAGS) $(EXTRA_CXXFLAGS) -ASFLAGS += -$(MCU_FLAG_NAME)=$(MCU) -I. -x assembler-with-cpp +ASFLAGS += -x assembler-with-cpp LDFLAGS += -$(MCU_FLAG_NAME)=$(MCU) -Wl,--gc-sections -O$(OPTIMIZATION_LEVEL) $(EXTRA_FLAGS) $(EXTRA_CXXFLAGS) $(EXTRA_LDFLAGS) SIZEFLAGS ?= --mcu=$(MCU) -C @@ -935,6 +935,10 @@ $(OBJDIR)/%.o: $(ARDUINO_CORE_PATH)/%.cpp $(COMMON_DEPS) | $(OBJDIR) @$(MKDIR) $(dir $@) $(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ +$(OBJDIR)/%.o: $(ARDUINO_CORE_PATH)/%.S $(COMMON_DEPS) | $(OBJDIR) + @$(MKDIR) $(dir $@) + $(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@ + # various object conversions $(OBJDIR)/%.hex: $(OBJDIR)/%.elf $(COMMON_DEPS) @$(MKDIR) $(dir $@) diff --git a/arduino-mk/chipKIT.mk b/arduino-mk/chipKIT.mk index 4cb71a2..fd7a0d2 100644 --- a/arduino-mk/chipKIT.mk +++ b/arduino-mk/chipKIT.mk @@ -82,6 +82,8 @@ ARDUINO_CORE_PATH = $(ALTERNATE_CORE_PATH)/cores/$(ALTERNATE_CORE) ARDUINO_PREFERENCES_PATH = $(MPIDE_PREFERENCES_PATH) ARDUINO_DIR = $(MPIDE_DIR) +CORE_AS_SRCS = $(ARDUINO_CORE_PATH)/vector_table.S + ARDUINO_VERSION = 23 CC_NAME = pic32-gcc