Trying to get avr-objdump to generate a listing that interleaves the assembly with the source code. I've tried a bunch of debugging arguments in different configurations but I can't seem to get it. The best I could do was getting it to interleave the object with line numbers from the assembly (avr-objdump -lS spi.o)
Here's my current Makefile:
PREFIX=avr-
CC=${PREFIX}gcc
OBJCOPY=${PREFIX}objcopy
BIN=knightrider
MCU=attiny85
OBJS=../src/tinySPI.o src/knightrider.o
PROG?=atmelice_isp
PORT?=usb
CFLAGS=-g -mmcu=${MCU} -ffunction-sections -fdata-sections
LDFLAGS=-mmcu=${MCU} -Wl,--gc-sections
${BIN}.hex: ${BIN}.elf
@mkdir -p bin
${OBJCOPY} -O ihex -R .eeprom build/$< bin/$@
${BIN}.elf: ${OBJS}
@mkdir -p build
${CC} ${LDFLAGS} -o build/$@ $?
install: ${BIN}.hex
avrdude -c ${PROG} -P ${PORT} -p ${MCU} -U flash:w:${BIN}.hex:i -qq
clean:
rm -f build/*
rm -f bin/*
fuses:
avrdude -c ${PROG} -P ${PORT} -p ${MCU} -U lfuse:w:0x62:m -U hfuse:w:0xDF:m -U efuse:w:0xFF:i -qq
What would I need to change in order to run avr-objdump and get an interleaved listing of an .o and its corresponding .c (e.g. spi.o and spi.c)?