improved debug output
This commit is contained in:
parent
a8177deb21
commit
76385bc076
19
Makefile
19
Makefile
|
@ -45,11 +45,11 @@ OBJ = $(SRC:.c=.o)
|
||||||
# listing files.
|
# listing files.
|
||||||
LST = $(SRC:.c=.lst)
|
LST = $(SRC:.c=.lst)
|
||||||
|
|
||||||
all: compile $(TARGET).lst flash
|
all: compile flash
|
||||||
$(info EEPROM has to be programmed separately)
|
$(info EEPROM has to be programmed separately)
|
||||||
|
|
||||||
debug: CFLAGS += -DDEBUG
|
debug: CFLAGS += -DDEBUG
|
||||||
debug: all
|
debug: map lst all
|
||||||
|
|
||||||
# reset board by setting DTR
|
# reset board by setting DTR
|
||||||
# the capacitor on DTR with create a pulse on RESET
|
# the capacitor on DTR with create a pulse on RESET
|
||||||
|
@ -60,11 +60,11 @@ reset:
|
||||||
|
|
||||||
# flash the device using the internal bootloader
|
# flash the device using the internal bootloader
|
||||||
flash: $(TARGET).hex reset
|
flash: $(TARGET).hex reset
|
||||||
$(FLASHER) -U flash:w:$(TARGET).hex:i
|
$(FLASHER) -U flash:w:$<:i
|
||||||
|
|
||||||
# write EEPROM on the device
|
# write EEPROM on the device
|
||||||
eeprom: $(TARGET)_eeprom.hex reset
|
eeprom: $(TARGET)_eeprom.hex reset
|
||||||
$(FLASHER) -U eeprom:w:$(TARGET)_eeprom.hex:i
|
$(FLASHER) -U eeprom:w:$<:i
|
||||||
|
|
||||||
# write bootloader and fuses
|
# write bootloader and fuses
|
||||||
bootloader:
|
bootloader:
|
||||||
|
@ -76,13 +76,22 @@ bootloader:
|
||||||
compile: $(TARGET).elf
|
compile: $(TARGET).elf
|
||||||
$(SIZE) --format=avr --mcu=$(DEVICE) $(TARGET).elf
|
$(SIZE) --format=avr --mcu=$(DEVICE) $(TARGET).elf
|
||||||
|
|
||||||
|
# C + ASM file
|
||||||
|
lst: $(TARGET).lst
|
||||||
|
|
||||||
|
# contains global and static variables
|
||||||
|
map: $(TARGET).map
|
||||||
|
|
||||||
# compile source files
|
# compile source files
|
||||||
%.o: %.c %.h
|
%.o: %.c %.h
|
||||||
$(CC) $(CFLAGS) -c -o $@ $<
|
$(CC) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
# link compiled files
|
# link compiled files
|
||||||
%.elf: $(OBJ)
|
%.elf: $(OBJ)
|
||||||
$(CC) $(LDFLAGS) -o $@ $(OBJ)
|
$(CC) $(LDFLAGS) -o $@ $^
|
||||||
|
|
||||||
|
$(TARGET).map: $(OBJ)
|
||||||
|
$(CC) $(LDFLAGS) -Wl,-Map=$@,--cref -o /dev/null $^
|
||||||
|
|
||||||
# create extended listing for additional information
|
# create extended listing for additional information
|
||||||
%.lst: %.elf
|
%.lst: %.elf
|
||||||
|
|
Loading…
Reference in New Issue