ispprog/Makefile

52 lines
1.1 KiB
Makefile
Raw Normal View History

2006-05-05 19:02:04 +02:00
PRG = ispprog
OBJ = ispprog.o
MCU_TARGET = atmega16
OPTIMIZE = -Os
DEFS =
LIBS =
# You should not have to change anything below here.
CC = avr-gcc
# Override is only needed by avr-lib build system.
override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) $(DEFS)
override LDFLAGS = -Wl,-Map,$(PRG).map
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
SIZE = avr-size
2007-10-05 23:12:54 +02:00
all: $(PRG).elf lst text
2006-05-05 19:02:04 +02:00
$(SIZE) -x -A $(PRG).elf
$(PRG).elf: $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
clean:
2012-12-31 13:16:35 +01:00
rm -rf *.o $(PRG).lst $(PRG).map $(PRG).elf $(PRG).hex $(PRG).bin
2006-05-05 19:02:04 +02:00
lst: $(PRG).lst
%.lst: %.elf
$(OBJDUMP) -h -S $< > $@
# Rules for building the .text rom images
2007-10-05 23:12:54 +02:00
text: hex bin
2006-05-05 19:02:04 +02:00
hex: $(PRG).hex
bin: $(PRG).bin
%.hex: %.elf
$(OBJCOPY) -j .text -j .data -O ihex $< $@
%.bin: %.elf
$(OBJCOPY) -j .text -j .data -O binary $< $@
install: text
2007-10-05 23:12:54 +02:00
# uisp -dprog=stk200 --erase --upload if=$(PRG).hex --verify
2011-06-25 16:19:18 +02:00
avrdude -p m16 -c butterfly -b 19200 -P /dev/ttyUSB0 -U flash:w:$(PRG).hex