# Makefile for LQ-Text, a full text retrieval package by Liam R. Quin
# This Makefile belongs in the "src/lqtext" directory.
#
# Note that most of the actual configuration is done in ../Makefile and
# in ../h/global.h, and not here.

# Makefile -- Copyright 1990 Liam R. Quin.  All Rights Reserved.
# This code is NOT in the public domain.
# See the file ../COPYRIGHT for full details.
#
# $Id: Makefile,v 1.5 91/03/03 00:19:26 lee Rel1-10 $


PWD=lqtext

TARGETS = lqaddfile lqfile lqword lqphrase lqshow lqkwik lq
BINFILES =lqaddfile lqfile lqword lqshow lqphrase lqkwik

DESTDIR=../bin
MODE=755
RANLIB=echo

EXTRA=-I../h

all: $(TARGETS)

# 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

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

# The following are for "make depend" and for sabre to load...
DEPENDFILES = ReadAhead.c SixBit.c fileindex.c lqaddfile.c lqphrase.c \
	      lqshow.c lqword.c sizes.c wordtable.c

# MALLFILES=/usr/lib/debug/malloc.o /usr/lib/debug/mallocmap.o
MALLFILES = 

install: all
	for i in $(BINFILES); do cp "$$i" $(DESTDIR); \
	strip "$(DESTDIR)/$$i" ; \
	done ; \
	mv lq $(DESTDIR)/lq; chmod $(MODE) $(DESTDIR)/lq;

.SUFFIXES: .c .o .src .obj

.c.src:
	#load $(CFLAGS) $<

.o.obj:
	#load $(CFLAGS) $<

# If you are going to use saber on these, you should name the programs.
saber_src:

saber_obj:

lq: lq.sh
	cp lq.sh lq
	chmod +x lq

lqshow: lqshow.o $(TEXTLIB)
	$(CC) $(CFLAGS) -o lqshow lqshow.o $(TEXTLIB) $(TERMCAP) $(DBMLIBS)

lqaddfile: lqaddfile.o wordtable.o $(TEXTLIB)
	$(CC) $(CFLAGS) -o lqaddfile lqaddfile.o wordtable.o \
			$(TEXTLIB) $(MALLOC) $(DBMLIBS) $(MALLFILES)

lqfile: fileindex.o $(TEXTLIB)
	$(CC) $(CFLAGS) -o lqfile fileindex.o $(TEXTLIB) $(MALLOC) $(DBMLIBS)
	
lqword: lqword.o $(TEXTLIB)
	$(CC) $(CFLAGS) -o lqword lqword.o $(TEXTLIB) $(MALLOC) $(DBMLIBS)

lqkwik: lqkwik.o $(TEXTLIB)
	$(CC) $(CFLAGS) -o lqkwik lqkwik.o $(TEXTLIB) $(MALLOC) $(DBMLIBS)

lqphrase: lqphrase.o $(TEXTLIB)
	$(CC) $(CFLAGS) -o lqphrase lqphrase.o $(TEXTLIB) $(DBMLIBS)

lint: AddFile.Lint News.Lint FileInfo.Lint Phrase.Lint

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

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

depend:
	mkdep $(CFLAGS) *.c

#
# $Log:	Makefile,v $
# Revision 1.5  91/03/03  00:19:26  lee
# added lqkwik
# 
# Revision 1.4  90/10/06  00:50:42  lee
# Prepared for first beta release.
# 
# Revision 1.3  90/10/05  23:54:57  lee
# deleted mkdep output.
# 
# Revision 1.2  90/09/28  21:54:01  lee
# No longer uses OWNER.
# 
# Revision 1.1  90/08/09  19:17:39  lee
# Initial revision
# 
 
# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

SixBit.o: SixBit.c ../h/globals.h /usr/include/stdio.h /usr/include/string.h
SixBit.o: /usr/include/ctype.h ../h/wordrules.h
fileindex.o: fileindex.c ../h/globals.h /usr/include/stdio.h
fileindex.o: /usr/include/sys/types.h /usr/include/sys/sysmacros.h
fileindex.o: /usr/include/malloc.h ../h/emalloc.h ../h/fileinfo.h
lqaddfile.o: lqaddfile.c /usr/include/stdio.h /usr/include/malloc.h
lqaddfile.o: /usr/include/ctype.h /usr/include/sys/types.h
lqaddfile.o: /usr/include/sys/sysmacros.h /usr/include/sys/stat.h
lqaddfile.o: /usr/include/strings.h ../h/globals.h ../h/fileinfo.h
lqaddfile.o: ../h/wordinfo.h ../h/pblock.h ../h/wordrules.h ../h/filter.h
lqaddfile.o: ../h/emalloc.h
lqkwik.o: lqkwik.c ../h/globals.h /usr/include/malloc.h /usr/include/fcntl.h
lqkwik.o: /usr/include/sys/fcntlcom.h /usr/include/ctype.h
lqkwik.o: /usr/include/sys/types.h /usr/include/sys/sysmacros.h
lqkwik.o: /usr/include/sys/stat.h /usr/include/stdio.h ../h/fileinfo.h
lqkwik.o: ../h/wordinfo.h ../h/pblock.h ../h/wordrules.h ../h/pblock.h
lqkwik.o: ../h/emalloc.h
lqphrase.o: lqphrase.c ../h/globals.h /usr/include/stdio.h /usr/include/fcntl.h
lqphrase.o: /usr/include/sys/fcntlcom.h /usr/include/sys/types.h
lqphrase.o: /usr/include/sys/sysmacros.h /usr/include/malloc.h ../h/emalloc.h
lqphrase.o: ../h/fileinfo.h ../h/wordinfo.h ../h/pblock.h ../h/pblock.h
lqphrase.o: ../h/phrase.h
lqshow.o: lqshow.c ../h/globals.h /usr/include/curses.h /usr/include/stdio.h
lqshow.o: /usr/include/sgtty.h /usr/include/sys/ioctl.h
lqshow.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h
lqshow.o: /usr/include/sys/ttold.h /usr/include/sys/ioccom.h
lqshow.o: /usr/include/sys/ttycom.h /usr/include/sys/filio.h
lqshow.o: /usr/include/sys/ioccom.h /usr/include/sys/sockio.h
lqshow.o: /usr/include/sys/ioccom.h /usr/include/malloc.h /usr/include/fcntl.h
lqshow.o: /usr/include/sys/fcntlcom.h /usr/include/ctype.h
lqshow.o: /usr/include/sys/types.h /usr/include/sys/sysmacros.h
lqshow.o: /usr/include/sys/stat.h ../h/fileinfo.h ../h/wordinfo.h ../h/pblock.h
lqshow.o: ../h/wordrules.h ../h/pblock.h ../h/emalloc.h
lqword.o: lqword.c ../h/globals.h /usr/include/stdio.h /usr/include/sys/types.h
lqword.o: /usr/include/sys/sysmacros.h /usr/include/malloc.h
lqword.o: /usr/include/fcntl.h /usr/include/sys/fcntlcom.h /usr/include/ctype.h
lqword.o: ../h/fileinfo.h ../h/wordinfo.h ../h/pblock.h ../h/smalldb.h
lqword.o: ../h/ozmadbm.h ../h/db.h ../h/pblock.h ../h/wordrules.h
lqword.o: ../h/emalloc.h
sizes.o: sizes.c ../h/globals.h /usr/include/stdio.h /usr/include/sys/types.h
sizes.o: /usr/include/sys/sysmacros.h ../h/fileinfo.h ../h/wordinfo.h
sizes.o: ../h/pblock.h ../h/pblock.h ../h/wordrules.h ../h/wordindex.h
wordtable.o: wordtable.c ../h/globals.h /usr/include/stdio.h
wordtable.o: /usr/include/malloc.h /usr/include/ctype.h
wordtable.o: /usr/include/sys/types.h /usr/include/sys/sysmacros.h
wordtable.o: /usr/include/fcntl.h /usr/include/sys/fcntlcom.h ../h/smalldb.h
wordtable.o: ../h/ozmadbm.h ../h/db.h ../h/fileinfo.h ../h/wordinfo.h
wordtable.o: ../h/pblock.h ../h/pblock.h ../h/wordrules.h ../h/emalloc.h

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
