lw35-upgrade/printer/avr/Makefile
Markus Koch 35268c53ae printer: avr: Update to new hardware
* Update I/O constraints
* Remove SPI code (some left for future reference)
* Launch test code instead of printer program
2019-11-10 18:11:09 +01:00

28 lines
584 B
Makefile

MCU=atmega8
PDEV=/dev/ttyUSB0
CFLAGS=-g -Wall -mcall-prologues -mmcu=$(MCU) -O2 -DF_CPU=16000000
LDFLAGS=-Wl,-gc-sections -Wl,-relax
CC=avr-gcc
TARGET=main
OBJECT_FILES=main.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 $@
avr-size -C --mcu=atmega8 main.obj
program: $(TARGET).obj
avrdude -p $(MCU) -P $(PDEV) -c arduino -b 19200 -U flash:w:$(TARGET).hex
fuse:
avrdude -p m8 -c usbasp -U lfuse:w:0xe4:m -U hfuse:w:0xd9:m
.phony: program fuse