From 7c73209f04dcd8aa3188f22a9998e5d9c5a68759 Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Tue, 9 Jul 2013 16:20:39 -0400 Subject: [PATCH] Allow objects to be in arbitrary subdirectories. --- arduino-mk/Arduino.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index 7c45bc5..8231148 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -854,33 +854,42 @@ endif # normal local sources $(OBJDIR)/%.o: %.c $(COMMON_DEPS) | $(OBJDIR) + $(MKDIR) $(dir $@) $(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@ $(OBJDIR)/%.o: %.cc $(COMMON_DEPS) | $(OBJDIR) + $(MKDIR) $(dir $@) $(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ $(OBJDIR)/%.o: %.cpp $(COMMON_DEPS) | $(OBJDIR) + $(MKDIR) $(dir $@) $(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ $(OBJDIR)/%.o: %.S $(COMMON_DEPS) | $(OBJDIR) + $(MKDIR) $(dir $@) $(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@ $(OBJDIR)/%.o: %.s $(COMMON_DEPS) | $(OBJDIR) + $(MKDIR) $(dir $@) $(CC) -c $(CPPFLAGS) $(ASFLAGS) $< -o $@ # the pde -> o file $(OBJDIR)/%.o: %.pde $(COMMON_DEPS) | $(OBJDIR) + $(MKDIR) $(dir $@) $(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ # the ino -> o file $(OBJDIR)/%.o: %.ino $(COMMON_DEPS) | $(OBJDIR) + $(MKDIR) $(dir $@) $(CXX) -x c++ -include Arduino.h -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ # generated assembly $(OBJDIR)/%.s: %.pde $(COMMON_DEPS) | $(OBJDIR) + $(MKDIR) $(dir $@) $(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -S -fverbose-asm $(CPPFLAGS) $(CXXFLAGS) $< -o $@ $(OBJDIR)/%.s: %.ino $(COMMON_DEPS) | $(OBJDIR) + $(MKDIR) $(dir $@) $(CXX) -x c++ -include Arduino.h -MMD -S -fverbose-asm $(CPPFLAGS) $(CXXFLAGS) $< -o $@ #$(OBJDIR)/%.lst: $(OBJDIR)/%.s @@ -888,13 +897,16 @@ $(OBJDIR)/%.s: %.ino $(COMMON_DEPS) | $(OBJDIR) # core files $(OBJDIR)/%.o: $(ARDUINO_CORE_PATH)/%.c $(COMMON_DEPS) | $(OBJDIR) + $(MKDIR) $(dir $@) $(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@ $(OBJDIR)/%.o: $(ARDUINO_CORE_PATH)/%.cpp $(COMMON_DEPS) | $(OBJDIR) + $(MKDIR) $(dir $@) $(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ # various object conversions $(OBJDIR)/%.hex: $(OBJDIR)/%.elf $(COMMON_DEPS) + $(MKDIR) $(dir $@) $(OBJCOPY) -O ihex -R .eeprom $< $@ @$(ECHO) $(call avr_size,$<,$@) @@ -906,13 +918,16 @@ else endif $(OBJDIR)/%.eep: $(OBJDIR)/%.elf $(COMMON_DEPS) + $(MKDIR) $(dir $@) -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ --change-section-lma .eeprom=0 -O ihex $< $@ $(OBJDIR)/%.lss: $(OBJDIR)/%.elf $(COMMON_DEPS) + $(MKDIR) $(dir $@) $(OBJDUMP) -h --source --demangle --wide $< > $@ $(OBJDIR)/%.sym: $(OBJDIR)/%.elf $(COMMON_DEPS) + $(MKDIR) $(dir $@) $(NM) --size-sort --demangle --reverse-sort --line-numbers $< > $@ ########################################################################