# 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.3 90/10/08 21:15:10 lee Exp $

#
# $Log:	Makefile,v $
# 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 TestSix TryNum NumberTest
TESTPROGS = MaxWid TryHash put trywid dbmtry TryRoot TestSix 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
TEXTLIB=../lib/liblqtext.a

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

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

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

depend:
	mkdep $(CFLAGS) *.c

MaxWid: MaxWid.o $(TEXTLIB) $(LIAMLIB) $(DBMLIBS)
	$(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) $(DBMLIBS)
	$(CC) $(CFLAGS) -o TryRoot TryRoot.o $(TEXTLIB) $(LIAMLIB) $(DBMLIBS)

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

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

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

SixBit.c: ../liblqtext/SixBit.c
	cp ../liblqtext/SixBit.c .

TestSix: SixBit.c
	$(CC) $(CFLAGS) -DTESTSIX SixBit.c -o TestSix
	/bin/rm -f SixBit.c

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.

MaxWid.o: MaxWid.c ../h/globals.h /usr/include/stdio.h
TryHash.o: TryHash.c /usr/include/stdio.h ../h/globals.h
TryNum.o: TryNum.c /usr/include/stdio.h ../h/globals.h ../h/numbers.h
TryNum.o: ../h/emalloc.h
TryRoot.o: TryRoot.c /usr/include/stdio.h /usr/include/ctype.h
TryRoot.o: /usr/include/sys/types.h /usr/include/sys/sysmacros.h
TryRoot.o: ../h/fileinfo.h ../h/wordinfo.h ../h/pblock.h ../h/wordrules.h
dbmtry.o: dbmtry.c ../h/globals.h /usr/include/stdio.h /usr/include/fcntl.h
dbmtry.o: /usr/include/sys/fcntlcom.h /usr/include/sys/types.h
dbmtry.o: /usr/include/sys/sysmacros.h ../h/smalldb.h ../h/ozmadbm.h ../h/db.h
lqmalloc.o: lqmalloc.c /usr/include/stdio.h
put.o: put.c /usr/include/stdio.h /usr/include/ctype.h
size.o: size.c /usr/include/sys/types.h /usr/include/sys/sysmacros.h
size.o: /usr/include/sys/mman.h /usr/include/sys/types.h
size.o: /usr/include/sys/stat.h /usr/include/fcntl.h
size.o: /usr/include/sys/fcntlcom.h /usr/include/stdio.h
trywid.o: trywid.c ../h/globals.h /usr/include/sys/types.h
trywid.o: /usr/include/sys/sysmacros.h /usr/include/stdio.h ../h/fileinfo.h
trywid.o: ../h/wordinfo.h ../h/pblock.h

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
