summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2011-11-18 05:13:03 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2011-11-18 05:13:03 +0100
commitfcf04bcd0a6536870bc3c7f0e620c0640c17f03c (patch)
tree2675544fbb35dfb9ea01ac8e94b4ac4f814acb89
parent26d405b852fa15aa1fa5427a89c8b439406ad37e (diff)
downloadarduino-mk-fcf04bcd0a6536870bc3c7f0e620c0640c17f03c.tar.gz
arduino-mk-fcf04bcd0a6536870bc3c7f0e620c0640c17f03c.tar.xz
arduino-mk-fcf04bcd0a6536870bc3c7f0e620c0640c17f03c.zip
build core.a with all arduino libs and use it for linking
this is needed (at least for me) to get it working, if using the single object files, the arduino will get into a restart loop
-rw-r--r--Arduino.mk12
1 files changed, 8 insertions, 4 deletions
diff --git a/Arduino.mk b/Arduino.mk
index a70d5ce..e55b683 100644
--- a/Arduino.mk
+++ b/Arduino.mk
@@ -247,11 +247,12 @@ CORE_CPP_SRCS = $(wildcard $(ARDUINO_CORE_PATH)/*.cpp)
CORE_OBJ_FILES = $(CORE_C_SRCS:.c=.o) $(CORE_CPP_SRCS:.cpp=.o)
CORE_OBJS = $(patsubst $(ARDUINO_CORE_PATH)/%, \
$(OBJDIR)/%,$(CORE_OBJ_FILES))
+CORE_ARCHIVE = $(OBJDIR)/core.a
endif
endif
# all the objects!
-OBJS = $(LOCAL_OBJS) $(CORE_OBJS) $(LIB_OBJS)
+OBJS = $(LOCAL_OBJS) $(LIB_OBJS)
########################################################################
# Rules for making stuff
@@ -410,8 +411,11 @@ all: $(OBJDIR) $(TARGET_HEX)
$(OBJDIR):
mkdir $(OBJDIR)
-$(TARGET_ELF): $(OBJS)
- $(CC) $(LDFLAGS) -o $@ $(OBJS) $(SYS_OBJS) -lc
+$(CORE_ARCHIVE): $(CORE_OBJS)
+ $(AR) rcs $@ $^
+
+$(TARGET_ELF): $(OBJS) $(CORE_ARCHIVE)
+ $(CC) $(LDFLAGS) -o $@ $(OBJS) $(CORE_ARCHIVE) $(SYS_OBJS) -lc
$(DEP_FILE): $(OBJDIR) $(DEPS)
cat $(DEPS) > $(DEP_FILE)
@@ -445,7 +449,7 @@ ispload: $(TARGET_HEX)
-U lock:w:$(ISP_LOCK_FUSE_POST):m
clean:
- $(REMOVE) $(OBJS) $(TARGETS) $(DEP_FILE) $(DEPS)
+ $(REMOVE) $(OBJS) $(CORE_OBJS) $(TARGETS) $(DEP_FILE) $(DEPS) $(CORE_ARCHIVE)
depends: $(DEPS)
cat $(DEPS) > $(DEP_FILE)