VERSION=1.0.0
ARCHDIR=archives/
ARCHNAME=tokipona-parser-$(VERSION)
ARCHFILES=\
	bison-parser-convert.php arraydebug.php \
	parser.cc \
	tokipona.y \
	parserdefs.hh \
	autoptr \
	\
	parser-core.cc tokendefs.hh \
	\
	Makefile.sets configure \
	Makefile.sets.in

include Makefile.sets

OPTIM += -fno-inline -O2

project: parser-core.o parser.o
	$(CXX) -o $@ $^ $(LDLIBS) $(LDFLAGS)

parser-core.o: parser-core.cc


parser-core.cc: bison-parser-convert.php tokipona.output
	php "$<" \
		| grep -v '^#line' \
		> "$@"

# Note: We use Bison, but we don't use the C file generated
#       by Bison. Instead, we use the state transition information
#       generated by Bison, and use our own program to convert
#       it into C++ code.
tokipona.output: tokipona.y
	bison -dv "$<"
	rm -f tokipona.tab.c tokipona.tab.h


include depfun.mak
