# Makefile DEVICE = attiny88 CLOCK = 4000000 PROGRAMMER = -c buspirate -P /dev/ttyUSB0 OBJECTS = reflow.o display.o font.o i2c.o menu.o spi.o therm.o timer.o config.o beep.o control.o fields.o profile.o SRC = $(OBJECTS:%.o=%.c) #FUSES = -U lfuse:w:0xEC:m -U hfuse:w:0xDF:m -U efuse:w:0xFF:m -U lock:w:0xFF:m FUSES = -U lfuse:w:0xEC:m -U hfuse:w:0xDF:m -U efuse:w:0x07:m # For computing fuse byte values for other devices and options see # the fuse bit calculator at http://www.engbedded.com/fusecalc/ #AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE) AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE) -V # Don't use -Werror in the link stage to avoid a compiler bug which is fixed in gcc 4.8.3 CFLAGS = -Werror COMPILE = avr-gcc -std=c99 -Wall -Wl,-Map,$@.map -Os -g -DF_CPU=$(CLOCK) -mmcu=$(DEVICE) -mcall-prologues -flto -fuse-linker-plugin # symbolic targets: all: reflow.hex .c.o: $(COMPILE) $(CFLAGS) -c $< -o $@ .S.o: $(COMPILE) -x assembler-with-cpp -c $< -o $@ .c.s: $(COMPILE) $(CFLAGS) -S $< -o $@ flash: $(AVRDUDE) -U flash:w:reflow.hex:i fuse: $(AVRDUDE) $(FUSES) install: all flash fuse # if you use a bootloader, change the command below appropriately: load: all bootloadHID reflow.hex clean: rm -f reflow.hex reflow.elf $(OBJECTS) # file targets: #reflow.elf: $(SRC) # $(COMPILE) $(LDFLAGS) -o reflow.elf $(SRC) reflow.elf: $(OBJECTS) $(COMPILE) $(LDFLAGS) -o reflow.elf $(OBJECTS) reflow.hex: reflow.elf rm -f reflow.hex avr-objcopy -j .text -j .data -O ihex reflow.elf reflow.hex avr-size --format=avr --mcu=$(DEVICE) reflow.elf # If you have an EEPROM section, you must also create a hex file for the # EEPROM and add it to the "flash" target. # Targets for code debugging and analysis: disasm: reflow.elf avr-objdump -d reflow.elf cpp: $(COMPILE) -E reflow.c