58 lines
2.0 KiB
Makefile
Executable File

#############################################################################
# MIDI Footswitch #
# Copyright (C) 2014-2018 Stefan Kalscheuer #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation version 3. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
#############################################################################
# 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