# Makefile for LQ-Text, a full text retrieval package by Liam R. Quin
# This Makefile belongs in the "src/test" directory.
#
# Note that most of the actual configuration is done in ../Makefile and
# in ../h/global.h, and not here.
#
# $Id: Makefile,v 1.5 92/02/15 06:57:39 lee Exp $

PWD=test

# no rules for the first 4 yet, sorry
TARGETS = MaxWid TryHash put trywid dbmtry TryRoot NumberTest # put4
TESTPROGS = MaxWid TryHash put trywid dbmtry TryRoot NumberTest # put4

TESTBIN=../testbin

EXTRA=-I../h

all: $(TARGETS)

saber_src:

saber_obj:

# for ndbm (simplest), leave empty or use -lndbm if you need it
# for sdbm (best so far), use ../lib/libsdbm.a
# for gdbm... well, I dunno.
DBMLIBS=../lib/libsdbm.a
# DBMLIBS=-lndbm
# DBMLIBS=ndbm.o bcopy.o

LIAMLIB=../lib/liblq.a ../lib/liblqerror.a
TEXTLIB=../lib/liblqtext.a

install: all
	@test -d $(TESTBIN) || mkdir $(TESTBIN)
	for i in $(TESTPROGS); do cp "$$i" $(TESTBIN); \
	strip "$(TESTBIN)/$$i" ; \
	done

tidy:
	/bin/rm -f *.o core

clean: tidy
	/bin/rm -f $(TARGETS) $(TEST) numbers.c

depend:
	mkdep $(CFLAGS) *.c

MaxWid: MaxWid.o $(TEXTLIB) $(LIAMLIB)
	$(CC) $(CFLAGS) -o MaxWid MaxWid.o $(TEXTLIB) $(LIAMLIB) $(DBMLIBS)

TryHash: TryHash.o $(TEXTLIB) $(LIAMLIB)
	$(CC) $(CFLAGS) -o TryHash TryHash.o $(TEXTLIB)

TryNum: TryNum.o $(TEXTLIB) $(LIAMLIB)
	$(CC) $(CFLAGS) -o TryNum TryNum.o $(TEXTLIB) $(LIAMLIB)

TryRoot: TryRoot.o $(TEXTLIB) $(LIAMLIB)
	$(CC) $(CFLAGS) -o TryRoot TryRoot.o $(TEXTLIB) $(LIAMLIB) $(DBMLIBS)

dbmtry: dbmtry.o $(TEXTLIB) $(LIAMLIB)
	$(CC) $(CFLAGS) -o dbmtry dbmtry.o $(TEXTLIB) $(LIAMLIB) $(DBMLIBS)

put: put.o
	$(CC) $(CFLAGS) -o put put.o

put4: put4.o
	$(CC) $(CFLAGS) -o put4 put4.o $(TEXTLIB) $(LIAMLIB) $(DBMLIBS)

trywid: trywid.o $(TEXTLIB) $(LIAMLIB)
	$(CC) $(CFLAGS) -o trywid trywid.o $(TEXTLIB) $(LIAMLIB) $(DBMLIBS)

numbers.c: ../liblqtext/numbers.c
	/bin/rm -f numbers.c
	cp ../liblqtext/numbers.c .

NumberTest: NumberTest.o
	$(CC) $(CFLAGS) -DTESTNUMBERS -o NumberTest NumberTest.o $(TEXTLIB) $(LIAMLIB) $(DBMLIBS)

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
