#
#    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 = atmega32
F_CPU = 737280

AVR_DEBUG_FLAG = -gdwarf-2
AVR_CC_FLAG = -std=gnu99

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

BINS = ssd1306demo
AVR_BINS = atmega32_ssd1306.axf

all: $(BINS) $(AVR_BINS)

OBJS_ssd1306demo = ssd1306demo.o ac_input.o ssd1306_virt.o ssd1306_glut.o
OBJS_atmega32_ssd1306 = atmega32_ssd1306.avro ssd1306.avro images.avro

OBJS = $(OBJS_ssd1306demo) $(OBJS_atmega32_ssd1306) *.vcd

ssd1306demo: $(OBJS_ssd1306demo)
atmega32_ssd1306.axf: $(OBJS_atmega32_ssd1306)

include ../makefile.common
