#
#  Lepron
#
#   Copyright (C) 2021 Stephen Hewitt, cambridgeclarion.org
#
#   This file is part of Lepron, a project to develop pronounceable
#   pseudowords for representing binary strings
#
#   Lepron is free software: you can redistribute it and/or modify
#   it under the terms of version 3 of the GNU General Public License as
#   published by the Free Software Foundation.
#
#   Lepron 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 Licence
#   along with this programme.  If not, see <https://www.gnu.org/licenses/>.
#
#   A copy of the licence was included in the original release in a
#   file called "COPYING" with the following SHA256 cryptographic hash
#   3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986

CFLAGS=-g -Wreturn-type
MAKEFLAGS=-r

all: encode

%.o: %.cc
	g++ -c -std=c++11 -O0 $(CFLAGS) -o $@ $*.cc

COMMON_OBJS=\
grammar.o \

TERMINALS_OBJS=\
lepron.o

clean:
	rm -f encode $(COMMON_OBJS) $(TERMINALS_OBJS) terminals.gh

encode: $(COMMON_OBJS)
	g++ -std=c++11 $(COMMON_OBJS) $(CFLAGS) $(LDFLAGS) -o $@

terminals: $(TERMINALS_OBJS)
	g++ -std=c++11  $(TERMINALS_OBJS) $(LDFLAGS) -o $@

terminals.gh: terminals
	cat 256v1.sw | ./terminals  > $@

grammar.o: terminals.gh grammar.h
