Newer
Older
OBJECTS = main.o clock.o debug.o bus.o status.o utils.o messages.o orders.o thermometer_cold.o thermometer_hot.o median_filter.o leds.o main_timer.o
PORT = usb
# For computing fuse byte values for other devices and options see
# the fuse bit calculator at http://www.engbedded.com/fusecalc/
# Tune the lines below only if you know what you are doing:
LFLAGS =
#LFLAGS = -Wl,-u,vfprintf -lprintf_flt
AVRDUDE = avrdude -v -v $(PROGRAMMER) -p $(DEVICE) -P $(PORT)
COMPILE = avr-gcc -Wall -Os -mmcu=$(DEVICE)
.PHONY: clean all
%.o: %.c common.h commitid.h
$(COMPILE) -c $< -o $@
.S.o:
$(COMPILE) -x assembler-with-cpp -c $< -o $@
# "-x assembler-with-cpp" should not be necessary since this is the
# default
# file type for the .S (with capital S) extension. However, upper case
# characters are not always preserved on Windows. To ensure WinAVR
# compatibility define the file type manually.
flash: all
$(AVRDUDE) -B 60 -e -U flash:w:main.hex:i
# $(AVRDUDE) -U flash:w:main.hex:i
fuse:
$(AVRDUDE) $(FUSES)
# file targets:
main.elf: $(OBJECTS)
$(COMPILE) $(LFLAGS) -o main.elf $(OBJECTS)
main.hex: main.elf
rm -f main.hex
avr-objcopy -j .text -j .data -O ihex main.elf main.hex
avr-size --format=avr --mcu=$(DEVICE) main.elf #configOutput.elf
# If you have an EEPROM section, you must also create a hex file
# for the
# EEPROM and add it to the "flash" target.