# Makefile.in,v 1.12 1995/09/01 02:13:24 duane Exp
#/* Copyright (c) 1994 Burra Gopal, Udi Manber.  All Rights Reserved. */
# Makefile for the compress library -- agrep should be linked with it in case
# it wants to search for patterns in a compressed file.


prefix = @prefix@
INSTALL_BINDIR	= $(prefix)/bin
INSTALL_LIBDIR	= $(prefix)/lib
INSTALL_MANDIR 	= $(prefix)/man

CC		= @CC@
INSTALL		= @INSTALL@
INSTALL_BIN 	= @INSTALL_PROGRAM@
INSTALL_FILE 	= @INSTALL_DATA@
RANLIB		= @RANLIB@


# You might have to change these depending on your machine configuration.
# AR and RABLIB are the library-archive programs. On Solaris, RANLIB is not
# required (define it to true) and AR is in /usr/ccs/bin/ar (on our machine!).
AR	      = ar #/usr/ccs/bin/ar #for Solaris


# YOU DON'T HAVE TO CHANGE ANYTHING BELOW THIS LINE

INDEX = ../index
AGREP = ../agrep
LIBDIR = ../lib
BIN = ../bin

all: Harvestall

Harvestall: lib 

Glimpseall: lib tbuild cast uncast test
	cp tbuild $(BIN)/.
	cp cast $(BIN)/.
	cp uncast $(BIN)/.

COMMONDIR	= ../../../../../src/common
CFLAGS = -DISO_CHAR_SET -I$(COMMONDIR)/include -I$(INDEX) -I$(AGREP) -w $(DEBUG_TOP)

LIBOBJ = hash.o string.o misc.o quick.o cast.o uncast.o tsimpletest.o tmemlook.o tbuild.o
LIB = $(LIBDIR)/libcast.a

lib: $(LIBOBJ)
	$(AR) rc $(LIB) $(LIBOBJ)
	$(RANLIB) $(LIB)

test: hash.o string.o misc.o test.o quick.o tsimpletest.o tmemlook.o cast.o uncast.o
	 $(CC) -o test hash.o string.o misc.o test.o quick.o tsimpletest.o tmemlook.o cast.o uncast.o

tbuild: hash.o string.o misc.o tbuild.o main_tbuild.o defs.h
	 $(CC) -o tbuild hash.o string.o misc.o tbuild.o main_tbuild.o

cast: main_cast.o $(LIB)
	 $(CC) -o cast main_cast.o $(LIBOBJ)

uncast: main_uncast.o $(LIB)
	$(CC) -o uncast main_uncast.o $(LIBOBJ)

hash.o: defs.h $(INDEX)/glimpse.h
string.o: defs.h $(INDEX)/glimpse.h
misc.o: defs.h $(INDEX)/glimpse.h
quick.o: defs.h $(INDEX)/glimpse.h
cast.o: defs.h $(INDEX)/glimpse.h
uncast.o: defs.h $(INDEX)/glimpse.h
main_cast.o: defs.h $(INDEX)/glimpse.h
main_uncast.o: defs.h $(INDEX)/glimpse.h
tsimpletest.o: defs.h $(INDEX)/glimpse.h
tmemlook.o: defs.h $(INDEX)/glimpse.h
test.o : test.c

clean:
	-rm -f *.o $(LIB) core test cast uncast tbuild a.out

realclean:	clean
	-rm -f Makefile
