LIBPATH = /misc/tcs/language/lib/
CC = gcc
CPP = g++
CFLAGS = -O2 -Wall -DMORFANALYS -DLIBPATH=\"$(LIBPATH)\" -DDEFAULTCODE=4 # UTF8CODE

all:	stava taggstava testaapi testataggapi testsplit

stava:	stava.c suffix.o rattstava.o libstava.h stava.h
	$(CC) $(CFLAGS) stava.c suffix.o rattstava.o -o stava

taggstava:	stava.c suffix.c stavaconstants.h
	$(CC) $(CFLAGS) -DTAGGSTAVA stava.c suffix.c -o taggstava

stava.o: stava.c stava.h stavaconstants.h libstava.h
	$(CC) $(CFLAGS) -DAPI -c stava.c

suffix.o: suffix.c suffix.h stava.h stavaconstants.h
rattstava.o: rattstava.c rattstava.h stava.h suffix.h

testsplit.o: testsplit.c split_compounds.h libstava.h

testaapi: testaapi.c stava.o suffix.o rattstava.o libstava.h
	$(CC) $(CFLAGS) -DAPI stava.o testaapi.c suffix.o rattstava.o -o testaapi

testsplit: testsplit.o stava.o suffix.o rattstava.o libstava.h split_compounds.h split_compounds.cc
	$(CPP) $(CFLAGS) -DAPI split_compounds.cc stava.o testsplit.o suffix.o rattstava.o -o testsplit

testataggapi: stava.c suffix.c testataggapi.c
	$(CC) -c $(CFLAGS) -DAPI -DTAGGSTAVA stava.c -o taggstavaapi.o
	$(CC) -c $(CFLAGS) -DAPI -DTAGGSTAVA suffix.c -o suffixapi.o
	$(CC) $(CFLAGS) -DTAGGSTAVA testataggapi.c taggstavaapi.o suffixapi.o -o testataggapi

clean:
	rm -f testaapi testsplit stava taggstava testataggapi *.o
