# $Id: Makefile,v 1.8 1992/05/12 13:32:29 aggarwal Exp $
#
BINDIR = /usr/local/bin
CC  = cc
CFLAGS = -g 


OBJS  =	regexp.o  regsub.o grep_record.o

DIST =	BUGS  Makefile  grep_record.1 grep_record.c grep_record_tests \
	Makefile.regexp  README.regexp regexp.3  regexp.c  regexp.h  \
	regmagic.h  regsub.c \
	tests 


all: regress grep_record

regress: grep_record
	@echo "Running tests for 'grep_record'"
	( cd grep_record_tests ; regress.sh )
	@touch regress

grep_record:  $(OBJS) Makefile
	$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)


test:	regexp

regexp:
	make -f Makefile.regexp test

tar: greprec.tar
	@echo "Created file greprec.tar"

greprec.tar:	$(DIST)
	@( /bin/rm -rf greprec greprec.tar ; mkdir greprec ; \
		cp -r $(DIST) greprec/ ;\
		tar cf greprec.tar greprec ; /bin/rm -rf greprec )

install:
	install -c -m 755 grep_record $(BINDIR)/

clean:
	/bin/rm -f a.out *.o core grep_record regexp regress
