|
@@ -704,11 +704,11 @@ sym: $(BUILD_DIR)/$(TARGET).sym
|
704
|
704
|
# Do not try to reset an Arduino if it's not one
|
705
|
705
|
upload: $(BUILD_DIR)/$(TARGET).hex
|
706
|
706
|
ifeq (${AVRDUDE_PROGRAMMER}, arduino)
|
707
|
|
- stty hup < $(UPLOAD_PORT); true
|
|
707
|
+ stty hup < $(UPLOAD_PORT); true
|
708
|
708
|
endif
|
709
|
|
- $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)
|
|
709
|
+ $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)
|
710
|
710
|
ifeq (${AVRDUDE_PROGRAMMER}, arduino)
|
711
|
|
- stty -hup < $(UPLOAD_PORT); true
|
|
711
|
+ stty -hup < $(UPLOAD_PORT); true
|
712
|
712
|
endif
|
713
|
713
|
|
714
|
714
|
# Display size of file.
|
|
@@ -716,10 +716,10 @@ HEXSIZE = $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex
|
716
|
716
|
ELFSIZE = $(SIZE) $(SIZE_FLAGS) $(BUILD_DIR)/$(TARGET).elf; \
|
717
|
717
|
$(SIZE) $(BUILD_DIR)/$(TARGET).elf
|
718
|
718
|
sizebefore:
|
719
|
|
- $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(HEXSIZE); echo; fi
|
|
719
|
+ $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(HEXSIZE); echo; fi
|
720
|
720
|
|
721
|
721
|
sizeafter: build
|
722
|
|
- $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
|
722
|
+ $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
723
|
723
|
|
724
|
724
|
|
725
|
725
|
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
|
@@ -731,71 +731,71 @@ COFFCONVERT=$(OBJCOPY) --debugging \
|
731
|
731
|
|
732
|
732
|
|
733
|
733
|
coff: $(BUILD_DIR)/$(TARGET).elf
|
734
|
|
- $(COFFCONVERT) -O coff-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof
|
|
734
|
+ $(COFFCONVERT) -O coff-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof
|
735
|
735
|
|
736
|
736
|
|
737
|
737
|
extcoff: $(TARGET).elf
|
738
|
|
- $(COFFCONVERT) -O coff-ext-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof
|
|
738
|
+ $(COFFCONVERT) -O coff-ext-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof
|
739
|
739
|
|
740
|
740
|
|
741
|
741
|
.SUFFIXES: .elf .hex .eep .lss .sym .bin
|
742
|
742
|
.PRECIOUS: .o
|
743
|
743
|
|
744
|
744
|
.elf.hex:
|
745
|
|
- $(Pecho) " COPY $@"
|
746
|
|
- $P $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
|
745
|
+ $(Pecho) " COPY $@"
|
|
746
|
+ $P $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
747
|
747
|
|
748
|
748
|
.elf.bin:
|
749
|
|
- $(Pecho) " COPY $@"
|
750
|
|
- $P $(OBJCOPY) -O binary -R .eeprom $< $@
|
|
749
|
+ $(Pecho) " COPY $@"
|
|
750
|
+ $P $(OBJCOPY) -O binary -R .eeprom $< $@
|
751
|
751
|
|
752
|
752
|
.elf.eep:
|
753
|
|
- -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
|
753
|
+ -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
754
|
754
|
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
755
|
755
|
|
756
|
756
|
# Create extended listing file from ELF output file.
|
757
|
757
|
.elf.lss:
|
758
|
|
- $(OBJDUMP) -h -S $< > $@
|
|
758
|
+ $(OBJDUMP) -h -S $< > $@
|
759
|
759
|
|
760
|
760
|
# Create a symbol table from ELF output file.
|
761
|
761
|
.elf.sym:
|
762
|
|
- $(NM) -n $< > $@
|
|
762
|
+ $(NM) -n $< > $@
|
763
|
763
|
|
764
|
764
|
# Link: create ELF output file from library.
|
765
|
765
|
|
766
|
766
|
$(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
|
767
|
|
- $(Pecho) " CXX $@"
|
768
|
|
- $P $(CC) $(LD_PREFIX) $(ALL_CXXFLAGS) -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX)
|
|
767
|
+ $(Pecho) " CXX $@"
|
|
768
|
+ $P $(CC) $(LD_PREFIX) $(ALL_CXXFLAGS) -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX)
|
769
|
769
|
|
770
|
770
|
# Object files that were found in "src" will be stored in $(BUILD_DIR)
|
771
|
771
|
# in directories that mirror the structure of "src"
|
772
|
772
|
|
773
|
773
|
$(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
|
774
|
|
- $(Pecho) " CC $<"
|
775
|
|
- $P $(CC) -MMD -c $(ALL_CFLAGS) $(CWARN) $< -o $@
|
|
774
|
+ $(Pecho) " CC $<"
|
|
775
|
+ $P $(CC) -MMD -c $(ALL_CFLAGS) $(CWARN) $< -o $@
|
776
|
776
|
|
777
|
777
|
$(BUILD_DIR)/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
|
778
|
|
- $(Pecho) " CXX $<"
|
779
|
|
- $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $(CXXWARN) $< -o $@
|
|
778
|
+ $(Pecho) " CXX $<"
|
|
779
|
+ $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $(CXXWARN) $< -o $@
|
780
|
780
|
|
781
|
781
|
# Object files for Arduino libs will be created in $(BUILD_DIR)/arduino
|
782
|
782
|
|
783
|
783
|
$(BUILD_DIR)/arduino/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
|
784
|
|
- $(Pecho) " CC $<"
|
785
|
|
- $P $(CC) -MMD -c $(ALL_CFLAGS) $(LIBWARN) $< -o $@
|
|
784
|
+ $(Pecho) " CC $<"
|
|
785
|
+ $P $(CC) -MMD -c $(ALL_CFLAGS) $(LIBWARN) $< -o $@
|
786
|
786
|
|
787
|
787
|
$(BUILD_DIR)/arduino/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
|
788
|
|
- $(Pecho) " CXX $<"
|
789
|
|
- $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $(LIBWARN) $< -o $@
|
|
788
|
+ $(Pecho) " CXX $<"
|
|
789
|
+ $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $(LIBWARN) $< -o $@
|
790
|
790
|
|
791
|
791
|
$(BUILD_DIR)/arduino/%.o: %.S $(MAKEFILE)
|
792
|
|
- $(Pecho) " CXX $<"
|
793
|
|
- $P $(CXX) -MMD -c $(ALL_ASFLAGS) $< -o $@
|
|
792
|
+ $(Pecho) " CXX $<"
|
|
793
|
+ $P $(CXX) -MMD -c $(ALL_ASFLAGS) $< -o $@
|
794
|
794
|
|
795
|
795
|
# Target: clean project.
|
796
|
796
|
clean:
|
797
|
|
- $(Pecho) " RMDIR $(BUILD_DIR)/"
|
798
|
|
- $P rm -rf $(BUILD_DIR)
|
|
797
|
+ $(Pecho) " RMDIR $(BUILD_DIR)/"
|
|
798
|
+ $P rm -rf $(BUILD_DIR)
|
799
|
799
|
|
800
|
800
|
|
801
|
801
|
.PHONY: all build elf hex eep lss sym program coff extcoff clean depend sizebefore sizeafter
|