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

DEFS=	@DEFS@
LIBS=	@LIBS@

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

CFLAGS=	-O

prefix = /usr/local
exec_prefix = ${prefix}
binprefix =
manprefix = 


INCLUDES = -I../include -I../regex
CFLAGS = -O

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

.c.o:
	-rm -f $*.o
	${CC} ${CFLAGS} ${INCLUDES} ${DEFS} -c $*.c

all:	dsgrep

dsgrep:	${OBJECTS} ../regex/libregexp.a ../libds/libds.a ../usp/libusp.a ${ETLIB}
	-rm -f dsgrep
	${CC} ${CFLAGS} -o dsgrep ${OBJECTS} ../regex/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
			
