# 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 $

#
# $Log:	Makefile,v $
# Revision 1.5  92/02/15  06:57:39  lee
# Added extra libs.
# 
# Revision 1.4  92/01/21  19:15:52  lee
# removed spurious dependencies on $DBMLIB.
# 
# Revision 1.3  90/10/08  21:15:10  lee
# Cope with non-writeable numbers.c and SixBit.c
# 
# Revision 1.2  90/10/06  01:27:05  lee
# Prepared for first Beta release.
# 
# Revision 1.1  90/08/09  19:17:53  lee
# Initial revision
# 
# 
#

PWD=test

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

TESTBIN=../testbin
MODE=755
OWNER=lee

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

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: numbers.o
	$(CC) $(CFLAGS) -DTESTNUMBERS -o NumberTest numbers.c

# 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
