5x7led/Makefile

46 lines
976 B
Makefile
Raw Normal View History

2010-03-12 20:36:58 +01:00
PRG = 5x7test
OBJ = 5x7test.o
2010-03-13 00:01:50 +01:00
MCU_TARGET = atmega168
2010-03-12 20:36:58 +01:00
OPTIMIZE = -Os
DEFS =
LIBS =
# Override is only needed by avr-lib build system.
override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) $(DEFS)
override LDFLAGS = -Wl,-Map,$(PRG).map
CC = avr-gcc
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
SIZE = avr-size
all: $(PRG).elf lst text
$(SIZE) -x -A $(PRG).elf
$(PRG).elf: $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
clean:
rm -rf *.o *.lst *.map $(PRG).elf *.hex *.bin
lst: $(PRG).lst
%.lst: %.elf
$(OBJDUMP) -h -S $< > $@
text: hex bin
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: all
2010-03-13 00:01:50 +01:00
# avrdude -p 2313 -c avr910 -b 115200 -P /dev/ttyUSB0 -e -V -U flash:w:$(PRG).hex
avrdude -c dragon_isp -P usb -p m168 -e -V -U flash:w:$(PRG).hex