41 lines
833 B
Makefile
Executable File
41 lines
833 B
Makefile
Executable File
# Include environment config
|
|
include Makefile.config
|
|
|
|
# Project specific settings
|
|
TARGET = midifs
|
|
MCU = t2313
|
|
|
|
help:
|
|
@echo
|
|
@echo "Availiable targets:"
|
|
@echo " help Displays this help"
|
|
@echo
|
|
@echo " compile Compiles source code"
|
|
@echo " info Outputs device memory information"
|
|
@echo " program Programs the device"
|
|
@echo " clean Deletes temporary files"
|
|
@echo
|
|
@echo " all Compile, info, program, clean"
|
|
@echo
|
|
|
|
# Some C flags
|
|
CFLAGS=-g -Os -Wall -mcall-prologues -mmcu=attiny2313
|
|
|
|
all: compile info program clean
|
|
|
|
compile: $(TARGET).hex
|
|
|
|
info:
|
|
avr-size $(TARGET).hex
|
|
|
|
program: compile
|
|
@$(AVRDUDE) -p $(MCU) -c $(PGMDEV) -P $(PGMOPT) -U flash:w:$(TARGET).hex:i
|
|
|
|
%.obj : %.o
|
|
$(CC) $(CFLAGS) $< -o $@
|
|
|
|
%.hex : %.obj
|
|
@$(OBJ2HEX) -R .eeprom -O ihex $< $@
|
|
|
|
clean:
|
|
@$(REMOVE) *.hex *.obj *.o
|