# Makefile generated by imake - do not edit!
# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $

SHELL=/bin/sh
MAKESHELL=/bin/sh

TOP = /mit/wais/build/@sys/wais-8-b2
CURDIR = .
CONFIGSRC = /usr/athena/config
DESTDIR=

IRULESRC = $(CONFIGSRC)

IMAKE= imake
IFLAGS= -I$(IRULESRC) -DTOPDIR=/usr/athena

ICONFIGFILE = ${IRULESRC}/Imake.tmpl ${IRULESRC}/Imake.rules \
	${IRULESRC}/site.def Imakefile
MKDIRHIER= sh $(IRULESRC)/mkdirhier.sh

ATHBASEDIR=/usr/athena

ATHLIBDIR=$(ATHBASEDIR)/lib
ATHBINDIR=$(ATHBASEDIR)/bin
ATHINCDIR=$(ATHBASEDIR)/include
ATHETCDIR=$(ATHBASEDIR)/etc
ATHCONFDIR=/etc/athena
ATHMANDIR=$(ATHBASEDIR)/man
ATHRBINDIR=/bin/athena
ATHRETCDIR=/etc/athena

ATHNEWDIR=$(ATHBINDIR)

ATHXAPPDIR=/usr/athena/lib/X11/app-defaults
ATHXBITDIR=/usr/athena/lib/X11/bitmaps
ATHXINCDIR=/usr/athena/include
ATHXLIBDIR=/usr/athena/lib

LINTCFLAG=-C
LINTFLAGS=$(DEFINES) -I/usr/athena/include

INSTALL=install -c
RANLIB=ranlib
CC=cc
LD=cc
AS=as
RM=rm -f
CDEBUG=-O

CFLAGS=$(CDEBUG)  $(DEFINES) -I/usr/athena/include
LDFLAGS= $(LDDEFS)
LDPATH=-L$(ATHLIBDIR)
LDLIBS=

all::
install:: install_dirs
install_dirs::

clean::
depend::

FRC::

###########################################################################
# Project inclusion
###########################################################################

###########################################################################
# start of Imakefile
###########################################################################

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

# common customizations:
# see the CFLAGS variable for pointers.
#
# to do:
# create the scripts, install the pointer to this version if it is the
# newest.

RM = rm -f
AR = ar

OCC = gcc

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=/mit/wais/build/@sys/wais-8-b2

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
CFLAGS = -O -I$(SUPDIR) -DSECURE_SERVER -DRELEVANCE_FEEDBACK ${MACHFL}

MACHFL=-DBSD

# 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)

all:: default

default: lib ir ui x bin doc
	@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; TOP=$(TOP) CC=$(OCC) 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  $@ RM="$(RM)"
	cd x; make $@ RM="$(RM)"

RELEASE = wais-8-b2

release:
	mkdir ../${RELEASE}
	tar cvf - . | (cd ../${RELEASE}; tar xf -)
	find ../${RELEASE} -name RCS -exec rm -rf {} ";"
	(cd ../${RELEASE}; make -k clean; rm -rf seeker)
	(cd ..; tar cvf ${RELEASE}.tar ${RELEASE})
	(cd ..; compress -f ${RELEASE}.tar)

# when making a new release, change ir/version.h to say so.
distrib:
	mkdir ${TOP}-dist
	tar cvf - . | (cd ${TOP}-dist; tar xf -)
	find ${TOP}-dist -name RCS -exec rm -rf {} ";"
	(cd ${TOP}-dist; make -k clean)
	(cd ..; tar cvf ${TOP}-dist.tar `basename ${TOP}-dist`)
	compress -f ${TOP}-dist.tar
	rm -rf ${TOP}-dist

expt:
	mkdir ${TOP}-expt
	tar cvf - . | (cd ${TOP}-expt; tar xf -)
	find ${TOP}-expt -name RCS -exec rm -rf {} ";"
	(cd ${TOP}-expt; make -k clean)
	(cd ..; tar cvf ${TOP}-expt.tar `basename ${TOP}-expt`)
	compress -f ${TOP}-expt.tar
	rm -rf ${TOP}-expt

Makefile:: $(ICONFIGFILE)
	-@if [ -f Makefile ]; then \
        	echo "  $(RM) Makefile.bak; mv Makefile Makefile.bak"; \
		$(RM) Makefile.bak; mv Makefile Makefile.bak; \
        else exit 0; fi
	$(IMAKE) $(IFLAGS) $(IPROJ) -DNEWTOP=$(TOP) -DNEWCURDIR=$(CURDIR)

clean::
	rm -f *~ *.o *.a core a.out

###########################################################################
# empty rules for directories that do not have SUBDIRS - do not edit

Makefiles::

###########################################################################
# dependencies generated by makedepend

