Allow objects to be in arbitrary subdirectories.
This commit is contained in:
parent
474da2ced4
commit
7c73209f04
1 changed files with 15 additions and 0 deletions
|
@ -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 $< > $@
|
||||
|
||||
########################################################################
|
||||
|
|
Loading…
Reference in a new issue