VPATH=@srcdir@
srcdir=@srcdir@
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
datadir=@datadir@
includedir=@includedir@
infodir=@infodir@
libdir=@libdir@
libexecdir=@libexecdir@
localstatedir=@localstatedir@
mandir=@mandir@
sbindir=@sbindir@
sharedstatedir=@sharedstatedir@
sysconfdir=@sysconfdir@

SHELL=	/bin/sh
CC=	@CC@
INSTALL= @INSTALL@

DEFS=	@DEFS@
LIBS=	@LIBS@

KLIBS= 	@KLIBS@
ETLIB=	../utils/et/libcom_err.a

INCLUDES = -I../include -I$(srcdir)/../include -I$(srcdir)/regexp
CFLAGS=	-O $(INCLUDES) $(DEFS)

SOURCES= dsgrep.c regerror.c
OBJECTS= dsgrep.o regerror.o

all:	dsgrep

dsgrep:	${OBJECTS} regexp/libregexp.a ../libds/libds.a ../usp/libusp.a ${ETLIB}
	-rm -f dsgrep
	${CC} ${CFLAGS} -o dsgrep ${OBJECTS} regexp/libregexp.a ../libds/libds.a ${KLIBS} ../usp/libusp.a ${ETLIB} ${LIBS}

saber:
	#setopt load_flags ${CFLAGS}
	#load ${SOURCES} ${LIBS} ${SYSLIBS}

tags: TAGS

TAGS: ${SOURCES}
	-etags ${SOURCES}

install: all

clean:
	rm -f *.o *~ \#* *.bak
	rm -f dsgrep TAGS

dist:	${SOURCES} Makefile
	-mkdir ../../dist/source/dsgrep
	cp -p ${SOURCES} ../../dist/source/dsgrep/
	cp -p Makefile ../../dist/source/dsgrep/
	chmod 644 ../../dist/source/dsgrep/Makefile
