
# Documentation of the WAIS system
#   brewster 2/91
#   warnock  11/94

RM = /bin/rm 
RMFLAGS = -f
AR = ar 
ARFLAGS = r
#TOP=

default: textfromman indexem

text =	waisindex.txt waisq.txt waissearch.txt \
	waisserver.txt xwais.txt xwaisq.txt	

waisindex.txt: $(TOP)/man/waisindex.l
	nroff -man $(TOP)/man/waisindex.l | sed -e 's/_//g' > waisindex.txt

waisq.txt: $(TOP)/man/waisq.l
	nroff -man $(TOP)/man/waisq.l | sed -e 's/_//g' > waisq.txt

waissearch.txt: $(TOP)/man/waissearch.l
	nroff -man $(TOP)/man/waissearch.l | sed -e 's/_//g' > waissearch.txt

waisserver.txt: $(TOP)/man/waisserver.l	
	nroff -man $(TOP)/man/waisserver.l | sed -e 's/_//g' > waisserver.txt

xwais.txt: $(TOP)/man/xwais.l
	nroff -man $(TOP)/man/xwais.l | sed -e 's/_//g' > xwais.txt

xwaisq.txt: $(TOP)/man/xwaisq.l
	nroff -man $(TOP)/man/xwaisq.l | sed -e 's/_//g' > xwaisq.txt

textfromman: $(text)


indexem:	$(TOP)/wais-sources/wais-docs.dct

$(TOP)/wais-sources/wais-docs.dct: $(text)
	$(TOP)/bin/waisindex -d $(TOP)/wais-sources/wais-docs -t text *.txt
	$(TOP)/bin/waisindex -d $(TOP)/wais-sources/test -t bio *.bio

clean:
	$(RM) $(RMFLAGS) *~
	$(RM) $(RMFLAGS) \#*\#
	$(RM) $(RMFLAGS) waisindex.txt waisq.txt waisserver.txt \
		 waissearch.txt xwais.txt xwaisq.txt
	$(RM) $(RMFLAGS) $(TOP)/wais-sources/wais-docs.*
	$(RM) $(RMFLAGS) $(TOP)/wais-sources/*~
	$(RM) $(RMFLAGS) $(TOP)/wais-sources/*#
	$(RM) $(RMFLAGS) SearchLog
