#
# $Id: Makefile.cygwin,v 1.7 2005/05/10 11:46:23 olafs Exp $
#

include ../../Makefile.cygwin.include
TOP = ../..

CC=$(CXX)

YACC = bison
LEX = flex

LDFLAGS = -s
CFLAGS += -Wall

#LDFLAGS = -s
#CFLAGS += -Wall -O6

CXXFLAGS = $(CFLAGS)

YFLAGS = -d
LFLAGS =
#YFLAGS += -v -t
#LFLAGS += -d

all: agfl-lexer.exe
	cp agfl-lexer.exe $(TOP)/agfl-binary/bin
clean:
	rm -f *.o
	rm -f *.a
	rm -f *.exe

OBJS = affixtab.o \
       avltrie.o \
       datparser.o \
       entry.o \
       field.o \
       id.o \
       lexaffixnamelist.o \
       lexentrylist.o \
       lexentrylistidx.o \
       lexfileio.o \
       lexintaffixlist.o \
       lexnontermlist.o \
       lextextaffixlist.o \
       lifparser.o \
       options.o \
       paramtab.o \
       parser.o \
       parserinterface.o \
       pool.o \
       scanner.o

agfl-lexer.exe: agfl-lexer
agfl-lexer: $(OBJS) lexgen.o
	$(CXX) $(OBJS) lexgen.o $(LDFLAGS) $(LEXICONLIB) $(ABASELIB) -o agfl-lexer.exe

parser.h parser.c: parser.y
	$(YACC) $(YFLAGS) -o parser.c $<

# Cheat with FlexLexer, since it is in the Cygwin include dir,
# not in that of MinGW.
scanner.c: scanner.l parser.c parser.h parser.y
	$(LEX) $(LFLAGS) -o$@ $<
	cp /usr/include/FlexLexer.h .

