## Copyright (c) 1991-2000 Doshita Lab. Speech Group, Kyoto University
## Copyright (c) 2001 Shikano-lab., NAIST
##   All rights reserved

## Makefile for mkfa, DFA compiler
## *** Needs GNU bison and flex ***
SHELL=/bin/sh
.SUFFIXES:
.SUFFIXES: .c .o
.c.o:
	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<

CC=@CC@
CFLAGS=@CFLAGS@
CPPFLAGS=@CPPFLAGS@ @DEFS@
LDFLAGS=@LDFLAGS@ @LIBS@ -ll
RM=@RM@ -f
BISON=@BISON@
FLEX=@FLEX@
prefix=@prefix@
exec_prefix=@exec_prefix@
INSTALL=@INSTALL@

######################################################################
YACS = gram.y
FLEXS = gram.l
OBJS = gram.tab.o main.o voca.o nfa.o dfa.o triplet.o

TARGET = mkfa

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) $(CFLAGS) $(CPPFLAGS) -o $(TARGET) $(OBJS) $(LDFLAGS)

gram.tab.c: $(YACS)
	$(BISON) $(YACS)

lex.yy.c: $(FLEXS)
	$(FLEX) $(FLEXS)

install:
	${INSTALL} -d @bindir@
	@INSTALL_PROGRAM@ $(TARGET) @bindir@

clean:
	$(RM) gram.tab.h gram.tab.c lex.yy.c $(OBJS) $(TARGET) *~ core

distclean: clean
	$(RM) Makefile

# dependencies
gram.tab.o : gram.tab.c lex.yy.c mkfa.h
gram.tab.c : gram.y
$(OBJS) : mkfa.h
