mirror of
https://github.com/cclassic/hcs12ss59t
synced 2024-11-22 02:15:05 +01:00
21 lines
441 B
Makefile
21 lines
441 B
Makefile
MCU=atmega8
|
|
CFLAGS=-g -Wall -mcall-prologues -mmcu=$(MCU) -Os -DF_CPU=8000000
|
|
LDFLAGS=-Wl,-gc-sections -Wl,-relax
|
|
CC=avr-gcc
|
|
TARGET=main
|
|
OBJECT_FILES=main.o hcs12ss59t.o vfd_fun.o
|
|
|
|
all: $(TARGET).hex
|
|
|
|
clean:
|
|
rm -f *.o *.hex *.obj *.hex
|
|
|
|
%.hex: %.obj
|
|
avr-objcopy -R .eeprom -O ihex $< $@
|
|
|
|
%.obj: $(OBJECT_FILES)
|
|
$(CC) $(CFLAGS) $(OBJECT_FILES) $(LDFLAGS) -o $@
|
|
|
|
program: $(TARGET).hex
|
|
avrdude -p $(MCU) -c usbasp -U flash:w:$(TARGET).hex
|