#
# Imakefile for Dir
#
# Note that this Imakefile is just sufficient to build the Dir routines
# for use with xarchie. The original FWF distribution contains a more
# elaborate Imakefile for a variety of purposes. See the file ../README.
#
# George Ferguson, ferguson@cs.rochester.edu, 26 Nov 1992.
#

SRCS = Directory.c DirMgr.c RegExp.c
OBJS = Directory.o DirMgr.o RegExp.o

INCLUDES = -I.

AllTarget(first)
NormalLibraryTarget(Dir,$(OBJS))

first:
	@rm -f dirent.h
	@(if [ ! -f /usr/include/dirent.h ];			\
	    then echo "Patching because no dirent.h";		\
	         echo "#ifndef _BRIDIRENT_H_" > dirent.h;	\
	         echo "#define _BRIDIRENT_H_" >> dirent.h;	\
	         echo "#define dirent direct" >> dirent.h;	\
	         echo "#include <sys/dir.h>" >> dirent.h;	\
	         echo "#endif" >> dirent.h;			\
	    else echo "";					\
	    fi; exit 0)
	@rm -f regexp.h
	@(if [ ! -f /usr/include/regexp.h ];			\
	    then echo "Patching because no regexp.h";		\
	         echo "#ifndef _BRIREGEXP_H_" > regexp.h;	\
	         echo "#define _BRIREGEXP_H_" >> regexp.h;	\
	         echo "#define NO_REGEXP 1" >> regexp.h;	\
	         echo "#endif" >> regexp.h;			\
	    else echo "";					\
	    fi; exit 0)

DependTarget()
