#
# UI's for the WAIS system
#  -brewster 2/91
#
# $Log: Makefile,v $
# Revision 1.1  1993/02/16  15:09:27  freewais
# Initial revision
#
# Revision 1.13  92/03/17  14:28:09  jonathan
# Updated for new library schemes.
# 
# Revision 1.12  92/02/15  19:54:54  jonathan
# Added $Log for RCS.  Updated VERSION
# 
#
# added waisq
# - Jonny G 2/91
# added swais (screen-ui)
# - jcurran 6/91
#
# common customizations:
# see the CFLAGS variable for pointers.
#
# SGIs want this uncommented
# SHELL=/bin/sh

RELEASE = freeWAIS-0.5

# For HP-UX build shared library
SHARED =
#SHARED = shared

# Where to install include files
INCDEST = /usr/local/include/wais

# Where to install libraries
LIBDEST = /usr/local/lib/wais

# Libraries to install
LIBINST = client.a client.sl inv.a inv.sl libftw.a libftw.sl sig.a sig.sl \
	wais.a wais.sl
#
# Some default programs
# CC = cc
CC		= gcc
RM		= /bin/rm
MV		= mv
MAKE	= make

#
# Directory definitions
#
# 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
#comment-me:
#       @echo You must set "\$$(TOP)" to point to the freeWAIS src directory

INCLUDE = $(TOP)/include
LIBDIR  = $(TOP)/bin
BINDIR  = $(TOP)/bin
SRCDIR  = $(TOP)/src
UIDIR   = $(SRCDIR)/client/ui

# compiler specific stuff
#
# for old BSD add -DBSD
# for newer BSD that needs to use <sys/dir.h>, add -DBSD43
# for System V add -DSYSV 
# for XENIX add -M3e -Zi
# USG for Unix Dirent in lib
# for SGIs running IRIX 4.0.1, add -cckr
# for NeXTSTEP add -DNeXT and -posix
# for Linux add -DLINUX
#
# 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
#
#   dgg additions
# LITERAL == waisserver, search for "literal strings"
# BOOLEANS == waisserver, search with boolean AND, NOT operators
# PARTIALWORD == waisserver, search for partial words, hum* matches human, 
#   hummingbird, ...
# BIO == waisindex, waisserver changes including symbol indexing & search 
#   & bio data formats
#
# -DTELL_USER lets the server know who you are at connect time
# -DUSE_SYSLOG if you want logging to be done with syslog rather than
#   fprintf
# -DNEED_VSYSLOG if your C library does not have a vsyslog() function
#   in it (and you defined USE_SYSLOG)
# -DDUMPCORE will force the waisserver to dump the core when aborting
#   otherwise the core will not be dumped
# -DEND_MERGE if you want to merge the index files at the end of an
#   index process otherwise they are merged as we go along
# -DSTEM_WORDS to stem words during indexing and queries
#
# Note - the default Porter Stemmer removes trailing e's from words -
# variable becomes variabl  - this can impact the use of literals in
# searches!!!!!!!!!!
#
# -DLIST_STEMS to show stemmed words in server log and indexer output
# -DSOLARIS for SunOS 5.2 (Solaris 2.2) machines.
#
# Use this version of CFLAGS for SGIs with gcc
# CFLAGS = -I$(SUPDIR) -DTELL_USER -DSECURE_SERVER -DRELEVANCE_FEEDBACK -DUSG -DBOOLEANS -DPARTIALWORD -DLITERAL -DSOUND -DBIBDB
#
# Use this version of CFLAGS for DECstation with gcc
# CFLAGS = -ansi -I$(SUPDIR) -DTELL_USER -DUSG -DSECURE_SERVER -DRELEVANCE_FEEDBACK -DBOOLEANS -DPARTIALWORD -DLITERAL -DSOUND -DBIBDB -DULTRIX
#
# Use this version of CFLAGS for DECstation with cc
# CFLAGS = -I$(SUPDIR) -DTELL_USER -DUSG -DSECURE_SERVER -DRELEVANCE_FEEDBACK -DBOOLEANS -DPARTIALWORD -DLITERAL -DSOUND -DBIBDB -DULTRIX
#
# Use this version of CFLAGS for DEC Alpha with gcc
# CFLAGS = -ansi -I$(SUPDIR) -DTELL_USER -DUSG -DSECURE_SERVER -DRELEVANCE_FEEDBACK -DBOOLEANS -DPARTIALWORD -DLITERAL -DSOUND -DBIBDB
#
# Use this version of CFLAGS on Sun with gcc (not Solaris)
# CFLAGS = -ansi -I$(SUPDIR) -DTELL_USER -DUSG -DSECURE_SERVER -DRELEVANCE_FEEDBACK -DBOOLEANS -DPARTIALWORD -DLITERAL -DSOUND -DBIBDB
#
# Use this version of CFLAGS for Linux with gcc
# CFLAGS = -O2 -ansi -m486 -fwritable-strings -I$(SUPDIR) -DTELL_USER -DUSG -DSECURE_SERVER -DRELEVANCE_FEEDBACK -DBOOLEANS -DPARTIALWORD -DLITERAL -DSOUND -DBIBDB -DLINUX
#
# Use this version of CFLAGS for HP/UX
# CFLAGS = -ansi -I$(SUPDIR) -DTELL_USER -DUSG -DSECURE_SERVER -DRELEVANCE_FEEDBACK -DBOOLEANS -DPARTIALWORD -DLITERAL -DSOUND -DBIBDB -Dhpux -D_HPUX_SOURCE
#
# Flag definitions
RMFLAGS = -f

CFLAGS  = -ansi -DUSG -DTELL_USER -DUSG -DSECURE_SERVER -DRELEVANCE_FEEDBACK -DBOOLEANS -DPARTIALWORD -DLITERAL -DSOUND -DBIBDB

# this is for SunOS 4.X
# LFLAGS = -Bstatic
LFLAGS	=

# dealing with taking an intenet name and resolving it.  
# set to -lresolv or nothing
#RESOLVER=	-lresolv 


UI_OBJS = document.o \
	question.o \
	source.o \
	util.o \
	wais-ui.o

default: $(UI_OBJS)

document.o:	document.c
	$(CC) $(CFLAGS) -I$(INCLUDE) -c $?

lisp-ui.o:	lisp-ui.c
	$(CC) $(CFLAGS) -I$(INCLUDE) -c $?

question.o:	question.c
	$(CC) $(CFLAGS) -I$(INCLUDE) -c $?

source.o:	source.c
	$(CC) $(CFLAGS) -I$(INCLUDE) -c $?

util.o:		util.c
	$(CC) $(CFLAGS) -I$(INCLUDE) -c $?

wais-ui.o:	wais-ui.c
	$(CC) $(CFLAGS) -I$(INCLUDE) -c $?

# Remove objects and library.
clean:
	$(RM) $(RMFLAGS) *%
	$(RM) $(RMFLAGS) *.o
	$(RM) $(RMFLAGS) *.sbin *.sbin3
	$(RM) $(RMFLAGS) *~
	$(RM) $(RMFLAGS) \#*\#
	$(RM) $(RMFLAGS) .nfs*  # NFS Lossage
	$(RM) $(RMFLAGS) core
	$(RM) $(RMFLAGS) TAGS
