# Top level make of the WAIS system
#   brewster 2/91
#   jonathan 6/91

# $Log:	Makefile-release,v $
# Revision 1.5  92/02/27  10:07:24  jonathan
# got rid of automatic setting of TOP.  Used Simon's approach instead.
# 
# Revision 1.4  92/02/13  12:27:53  jonathan
# Removed references to seeker.
# 
# Revision 1.3  92/02/13  12:05:17  jonathan
# Removed release targets.
# 
# Revision 1.2  92/02/13  11:57:56  jonathan
# Added $Log for RCS.
# 
#
# common customizations:
# see the CFLAGS variable for pointers.
#
# to do:
# create the scripts, install the pointer to this version if it is the
# newest.

RELEASE = wais-8-b4.1

RM = /bin/rm -f
AR = ar

# on SGIs set this to true
RANLIB = ranlib

CC = cc

# set this for your site.  This syntax only works in SunOS
# for other UNIX-like OS's set this to this directory.
#TOP:sh = pwd
# or fill in the blank for other OS's
#TOP = ?
comment-me:
	@echo You must set "\$$(TOP)" to point to the wais src directory

SUPDIR = $(TOP)/ir

# for old BSD add -DBSD
# for System V add -DSYSV 
# for XENIX add -M3e -Zi
# for a little better security in the server, add -DSECURE_SERVER
# this sets the server user id to -u argument after startup.
# for relevance feedaback in the search engine, add -DRELEVANCE_FEEDBACK
# USG for Unix Dirent in lib
# for SGIs running IRIX 4.0.1, add -cckr
CFLAGS = -g -I$(SUPDIR) -I../ir -DSECURE_SERVER -DRELEVANCE_FEEDBACK -DUSG

# this is a pretty good guess at the MAKE command.  -e seems to be
# SunOS specific too, so remove it for ULTRIX.

MAKE = make -e -k CC=$(CC) "CFLAGS=$(CFLAGS)" TOP=$(TOP)

default: lib ir ui bin doc x tags
	@echo "Welcome to WAIS"

lib::
	cd lib; $(MAKE) 

ir::
	cd ir; $(MAKE) 

ui::
	cd ui; $(MAKE)

# ULTRIX doesn't have an env command, so this doesn't work.
# try going to the x directory and just doing a make -k
# you may have to edit the CFLAGS in the Makefile yourself.

x::
	cd x; (env TOP=$(TOP) CC=$(CC) "CFLAGS=$(CFLAGS)" ./makex.sh)

bin::
	cd bin; $(MAKE)

doc::
	cd doc; $(MAKE)

test::
	@echo $(MAKE)

# to make the emacs tags table for meta-.:
tags: 	
	etags -f TAGS ir/*.[ch]
	etags -af TAGS ui/*.[ch]
	etags -af TAGS x/*.[ch]

# Remove objects and library.
clean:
	$(RM) *~
	$(RM) \#*\#
	$(RM) core
	$(RM) TAGS
	$(RM) -r SearchLog
	$(RM) wais-sources/wais-docs*
	cd lib; make $@
	cd ir; make $@
	cd ui; make  $@
	cd bin; make  $@
	cd doc; make  $@
	cd x; make $@

rlocks:
	$@
	cd lib; $@
	cd ir; $@
	cd ui;  $@
	cd bin;  $@
	cd doc;  $@
	cd x; $@



