# Makefile for SWISH
# Kevin Hughes, 3/12/95
#
# The code has been tested to compile on 
# Solaris and DEC  G.Hill ghill@library.berkeley.edu 6/11/97
#

#CC= cc
#CC= /usr/ccs/bin/ucbcc
#CC = /vol/moby/moby_a/gnu/sun4_sunos5.1/bin/gcc
CC = /usr/local/bin/gcc

CFLAGS= -O2

LIBS=	-lm

OBJS=	check.o file.o index.o search.o error.o \
	hash.o list.o mem.o string.o merge.o swish.o

.c.o:
	$(CC) -c $(CFLAGS) $<

all:	swish-e

swish-e:	$(OBJS)
	$(CC) -o swish-e $(CFLAGS) $(OBJS) $(LIBS)
	chmod 755 swish-e
	strip swish-e

quant:
	make CFLAGS="-g" $(OBJS)
	make quant-link

quant-link:
	quantify $(CC) -o swish-e -g $(CFLAGS) $(OBJS) $(LIBS)

pure:
	make clean
	make CFLAGS="-g" $(OBJS)
	make pure-link

clean:
	rm -f ./swish-e ./*.o ./index.swish

pure-link:
	$(CC) -o swish-e -g $(CFLAGS) $(OBJS) $(LIBS)

test:
	./swish-e -i test.html -v -f index.swish
	./swish-e -f index.swish -w test

$(OBJS):	Makefile config.h swish.h


