23 lines
569 B

  1. #AVR-GCC Makefile
  2. PROJECT = planefinder
  3. SOURCES = src/main.c
  4. CC = avr-gcc
  5. OBJCOPY = avr-objcopy
  6. MMCU = attiny13
  7. DUMMY_BINARY:=$(shell mkdir -p binary)
  8. CFLAGS = -mmcu=$(MMCU) -Wall -Os -std=gnu99
  9. binary/$(PROJECT).hex: binary/$(PROJECT).out
  10. $(OBJCOPY) -j .text -O ihex binary/$(PROJECT).out binary/$(PROJECT).hex
  11. binary/$(PROJECT).out: $(SOURCES)
  12. $(CC) $(CFLAGS) -I./ -o binary/$(PROJECT).out $(SOURCES)
  13. program: binary/$(PROJECT).hex
  14. avrdude -p t13 -c usbasp -e -U flash:w:binary/$(PROJECT).hex
  15. clean:
  16. rm -f binary/$(PROJECT).out
  17. rm -f binary/$(PROJECT).hex