#
#    Copyright (C) 2017 Milan Kupcevic
#
#    You can redistribute and/or modify this software under the
#    terms of the GNU General Public License version 3, or any later 
#    version as published by the Free Software Foundation.
#
#    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 <http://www.gnu.org/licenses/>.
#
#    GPLv3+
#

MCU = atmega48
F_CPU = 10000000

AVR_DEBUG_FLAG = -gdwarf-2

CPPFLAGS = -pthread $(shell pkg-config --cflags glu)
ADD_LIBS = $(shell pkg-config --libs glu) -lglut
LDFLAGS = -pthread

BINS = charlcd
AVR_BINS = atmega48_charlcd.axf

all: $(BINS) $(AVR_BINS)

OBJS_charlcd = charlcd.o ac_input.o hd44780.o hd44780_glut.o
OBJS_atmega48_charlcd = atmega48_charlcd.avro

OBJS = $(OBJS_charlcd) $(OBJS_atmega48_charlcd) *.vcd

charlcd: $(OBJS_charlcd)
atmega48_charlcd.axf: $(OBJS_atmega48_charlcd)

include ../makefile.common
