# Makefile for MoA (Morphological Analyzer)
#
# create : 95.8.12 (Sat), bgjang
#   This subdirectory (src) is newly created. And the Makefile
#   in the upper directory is modified for this directory.
# modify :
#
#

CC= cc
MV= mv
RM= /bin/rm
BINDIR= ../../bin
LIBDIR= ../../lib
INCDIR= ../../include
INSTALL= /usr/bin/install

.KEEP_STATE:

# please specify the followings appropriately.
# -DNDEBUG : if you don't want to see 'assert' error.
# -DLEXDEBUG : if you want to the procedure of lex regular expression steps
#              you must modify something in 'lexconv' file, too.
# -DDEBUG : if you want to see all debug messages ... ;)
# -DDEBUGR : if you want to see only result edges.
# -DDEBUGU : if you want to see unknown word processing step.
# -DKTS : if you want to see results like KTS (normal output form)
# -DLOG_STATISTIC : if you want to logging the resource usage by MoA
#

C= -Qoption cpp -B
#D= -g -I$(INCDIR) -I./ -DLOG_STATISTIC -DDEBUG # -DDEBUGR # -DDEBUGU
#D= -O2 -I$(INCDIR) -I./ -DLOG_STATISTIC -DDEBUG # -DDEBUGR # -DDEBUGU
#D= -g -I$(INCDIR) -I./ -DKTS -DLOG_STATISTIC # -DDEBUG # -DDEBUGR # -DDEBUGU
D= -O2 -I$(INCDIR) -I./ -DKTS -DLOG_STATISTIC # -DDEBUG # -DDEBUGR # -DDEBUGU
#P= -pg
CFLAGS= $(C) $(D) $(P)
LDFLAGS= -L/usr/lib -L$(LIBDIR)

LIBS = $(LIBDIR)/libtoken.a $(LIBDIR)/libkimmo.a $(LIBDIR)/libdict.a
SRCS = chart.c MAchart.c MAerror.c MAmain.c MAdo.c \
	orderedSet.c intStack.c irrtbl.c cache.c misc.c
OBJS = chart.o MAchart.o MAerror.o MAmain.o MAdo.o \
	orderedSet.o intStack.o irrtbl.o cache.o misc.o

TSRCS = testOrdered.c
TOBJS = testOrdered.o

all : moa # testOrdered

moa : $(OBJS) $(LIBS)
	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -ltoken -lkimmo -ldict -ll -o $@

testOrdered : testOrdered.o orderedSet.o
	$(CC) $(CFLAGS) $(LDFLAGS) testOrdered.o orderedSet.o -o $@

#
# misc.
#

clean :
	-$(RM) *.o core moa testOrdered Makefile.bak

install : moa
	-$(INSTALL) -d $(BINDIR)
	$(INSTALL) moa $(BINDIR)

depend :
	makedepend -- $(D) -- $(SRCS) $(TSRCS)

FRC :

#
# DO NOT DELETE THIS LINE -- make depend depends on it.

chart.o: /usr/include/stdio.h ../../include/pos.h chart.h
MAchart.o: /usr/include/stdio.h ../../include/token.h common.h
MAchart.o: ../../include/kimmocode.h ../../include/pos.h chart.h MAchart.h
MAchart.o: MAerror.h
MAerror.o: /usr/include/stdio.h /usr/include/varargs.h MAerror.h
MAmain.o: /usr/include/stdio.h /usr/include/assert.h /usr/include/fcntl.h
MAmain.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stdtypes.h
MAmain.o: /usr/include/wchar.h /usr/include/sys/stat.h
MAmain.o: /usr/include/sys/types.h /usr/include/sys/sysmacros.h
MAmain.o: ../../include/MAdict.h version.h common.h ../../include/kimmocode.h
MAmain.o: ../../include/pos.h MAchart.h MAerror.h /usr/include/stdlib.h
MAmain.o: /usr/include/limits.h
MAdo.o: /usr/include/stdio.h /usr/include/assert.h /usr/include/fcntl.h
MAdo.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stdtypes.h
MAdo.o: /usr/include/wchar.h /usr/include/sys/stat.h /usr/include/sys/types.h
MAdo.o: /usr/include/sys/sysmacros.h ../../include/MAdict.h common.h
MAdo.o: ../../include/kimmocode.h ../../include/pos.h irrtbl.h
MAdo.o: ../../include/token.h MAchart.h MAerror.h orderedSet.h
orderedSet.o: orderedSet.h
irrtbl.o: /usr/include/stdio.h irrtbl.h ../../include/pos.h common.h
irrtbl.o: ../../include/kimmocode.h MAchart.h MAerror.h
cache.o: /usr/include/stdio.h chart.h ../../include/pos.h common.h
cache.o: ../../include/kimmocode.h version.h
misc.o: /usr/include/time.h /usr/include/sys/stdtypes.h /usr/include/wchar.h
misc.o: common.h ../../include/kimmocode.h /usr/include/stdio.h
misc.o: ../../include/pos.h
testOrdered.o: orderedSet.h
