# Copyright (c) 1993 Xerox Corporation.  All rights reserved.
#
#-$Id$
#
#-$Date$
#

#
# VERY IMPORTANT:
#   NO target-config-dependent things go in in Makefile directly.
#   ALL target-config-dependent things go in config.mk, below.
#
#

#
# include config.mk here to define:
#
#   CC - C compiler
#   CONFIG←CPPFLAGS
#   CONFIG←CFLAGS
#
#   ASPP - assembler preprocessor (CPP)
#   CONFIG←ASPPFLAGS
#
#   AS - assembler
#   CONFIG←ASFLAGS
#
#   LDR - loader for reloadable modules
#   CONFIG←LDRFLAGS
#
#   LD - loader
#   CONFIG←LDFLAGS
#
#   INCLUDE -- search path for header files  
#

include ../config/config.mk

#
# locations of object files
#

INSTALL←LIB = ../lib
INSTALL←BIN = ../bin

#
# compilation flags, etc.
#


CPPFLAGS = $(INCLUDE) $(CONFIG←CPPFLAGS) \
	-DPCR←NO←RENAME -DPCR←NO←HOSTDEP←ERR
CFLAGS	=-c $(CONFIG←CFLAGS)

ASPPFLAGS  = $(INCLUDE) $(CONFIG←ASPPFLAGS) \
	-DPCR←NO←RENAME -DPCR←NO←HOSTDEP←ERR -DASM

ASFLAGS	= $(CONFIG←ASFLAGS)

LDRFLAGS = $(CONFIG←LDRFLAGS)

LDFLAGS = $(CONFIG←LDFLAGS)

#
# standard commands and default rules
#


INSTALL = cp -p


.s.o:
	$(ASPP) $(ASPPFLAGS) $< > tmp.s ; $(AS) $(ASFLAGS) tmp.s -o $@ ; \
		rm -f tmp.s

.c.o:
	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<  -o $@

#
#
#
#
# BEGIN PACKAGE-SPECIFIC PART
#
#
#
#

#
# Default target
#

default: io.o


#
# SOURCE FILE DEFINITION
#
# define CSRC SSRC MISCSRC HDEFS MISCDEFS.
#
# define MAKEDEP←MISCSRC = commands to make MISCSRC dependencies
#   (dependencies for .c and .s files are done automatically).
#

CSRC = PCR←IOImpl.c PCR←IOGblImpl.c PCR←IOLclImpl.c \
	PCR←IOGblUFSImpl.c \
	PCR←IOSocketImpl.c PCR←IOGblUFSSocketImpl.c \
	PCR←IOStreamImpl.c PCR←IOGblUFSStreamImpl.c \
	PCR←IOWDirImpl.c

SSRC = 

MISCSRC =

SRC = $(CSRC) $(SSRC) $(MISCSRC)

MAKEDEP←MISCSRC =


HDEFS = PCR←IO.h \
	PCR←IOGbl.h PCR←IOGblGlue.h \
	PCR←IOLcl.h \
	PCR←IOSocket.h PCR←IOGblUFSSocket.h PCR←IOSocketGlue.h \
	PCR←IOStream.h PCR←IOGblUFSStream.h PCR←IOStreamGlue.h \
	PCR←IOWDir.h

MISCDEFS =

DEFS = $(HDEFS) $(MISCDEFS)

#
#
# INSTALL DEFINITION
#
# define INSTALL←LIBFILES = targets to be copied into INSTALL←LIB
# define INSTALL←BINFILES = targets to be copied into INSTALL←BIN
#

INSTALL←BINFILES =
INSTALL←LIBFILES = io.o


#
# package-specific definitions and rules
#

COBJ = PCR←IOImpl.o PCR←IOGblImpl.o PCR←IOLclImpl.o \
	PCR←IOGblUFSImpl.o \
	PCR←IOSocketImpl.o PCR←IOGblUFSSocketImpl.o \
	PCR←IOStreamImpl.o PCR←IOGblUFSStreamImpl.o \
	PCR←IOWDirImpl.o

SOBJ = 

MISCOBJ = 

XOBJ = 


io.o: $(COBJ) $(SOBJ)
	$(LDR) $(LDRFLAGS) -o io.o $(COBJ) $(SOBJ)


#
#
#
#
# END PACKAGE-SPECIFIC PART
#
#
#
#

#
#
# STANDARD TARGETS
#
#

#
# make install
#

install:  $(INSTALL←LIBFILES) $(INSTALL←BINFILES)
	-if [ -n "$(INSTALL←LIBFILES)" ] ; then \
		( cd $(INSTALL←LIB) ; rm -f $(INSTALL←LIBFILES) ) ; \
		$(INSTALL) $(INSTALL←LIBFILES) $(INSTALL←LIB) ; \
	fi
	-if [ -n "$(INSTALL←BINFILES)" ] ; then \
		( cd $(INSTALL←BIN) ; rm -f $(INSTALL←BINFILES) ) ; \
		$(INSTALL) $(INSTALL←BINFILES) $(INSTALL←BIN) ; \
	fi


#
# make clean
#

clean:
	rm -f *.o *~ core a.out *.a *.BAK *.bak *.CKP logmsg.txt

#
# make depend
#
# NOTE: the makefile must include "# DO NOT DELETE THIS LINE" 
#   and at least one additional line of text after the last target.
#   "make depend" will replace everything following that line
#   by a newly-constructed list of dependencies.
#
# You can modify the behavior of this target by defining $(MAKEDEP←MISCSRC).
#

makedep: $(CSRC) $(SSRC) $(MISCSRC)
	rm -f makedep
	$(MAKEDEP←MISCSRC)
	-for x in $(CSRC) END ; \
		do if [ $$x != END ]; then \
			$(CPP) -M $(CPPFLAGS) $$x \
			| sed -e '/:$$/d' >> makedep ; \
			fi ; \
		done
	-for x in $(SSRC) END ; \
		do if [ $$x != END ]; then \
			$(ASPP) -M $(ASPPFLAGS) $$x \
			| sed -e '/:$$/d' \
			| sed -e 's/[.]s[.]o :/.o :/g' >> makedep ; \
			fi ; \
		done

depend: makedep 
	echo '/↑# DO NOT DELETE THIS LINE/,$$c' > eddep
	echo '# DO NOT DELETE THIS LINE' >> eddep
	echo '# Make depend depends on it' >> eddep
	echo '.' >> eddep
	echo '$$r makedep' >> eddep
	echo 'w' >> eddep
	rm -f Makefile.bak
	mv Makefile Makefile.bak
	cp Makefile.bak Makefile
	chmod u+w Makefile
	ex - Makefile < eddep
	-if [ ! -w Makefile.bak ] ; then chmod u-w Makefile ; fi
	rm -f eddep makedep

#
#
# END OF HUMAN-EDITABLE PART
#
#

#
#-$Log$
#

#
# DO NOT DELETE THIS LINE
# Make depend depends on it
PCR←IOImpl.o : PCR←IOImpl.c ../config/PCR←StdDefs.h \
  ../config/PCR←StdTypes.h ../config/PCR←Arch.h ../config/PCR←OS.h \
  ../base/PCR←Base.h ../base/PCR←BaseArgs.h \
  /import/gnu/lib/gcc-include/stdarg.h ../base/PCR←BaseRun.h \
  ../th/PCR←ThData.h ../sig/PCR←SigTypes.h ../th/PCR←ThDataGlue.h \
  ../th/PCR←Th.h ../sig/PCR←Sig.h ../th/PCR←ThTypes.h ../th/PCR←ThCrSec.h \
  ../th/PCR←ThCrSecInlines.h ../th/PCR←ThCurr.h ../th/PCR←ThPvt.h \
  ../th/PCR←ThCtl.h ../th/PCR←ThCtlTypes.h ../posix/limits.h \
  ../posix/host/limits.h ../posix/setjmp.h ../th/PCR←ThUWProt.h \
  ../vd/PCR←VD.h ../mm/PCR←MM.h ../posix/stddef.h ../posix/host/stddef.h \
  ../io/PCR←IO.h ../posix/sys/types.h ../posix/host/sys/types.h \
  /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h ../posix/dirent.h \
  ../posix/host/dirent.h /usr/include/sys/dirent.h ../posix/sys/stat.h \
  ../host/sys/stat.h ../posix/fcntl.h ../host/fcntl.h \
  /usr/include/sys/fcntlcom.h ../posix/utime.h ../host/utime.h \
  ../io/PCR←IOWDir.h ../io/PCR←IOLcl.h ../io/PCR←IOGbl.h \
  ../io/PCR←IOGblGlue.h ../posix/unistd.h ../posix/host/unistd.h \
  ../posix/errno.h ../host/errno.h /usr/include/sys/errno.h ../ansi/string.h 
PCR←IOGblImpl.o : PCR←IOGblImpl.c ../config/PCR←StdDefs.h \
  ../config/PCR←StdTypes.h ../config/PCR←Arch.h ../base/PCR←Base.h \
  ../base/PCR←BaseArgs.h /import/gnu/lib/gcc-include/stdarg.h ../th/PCR←Th.h \
  ../sig/PCR←Sig.h ../config/PCR←OS.h ../sig/PCR←SigTypes.h \
  ../th/PCR←ThTypes.h ../th/PCR←ThCrSec.h ../th/PCR←ThCrSecInlines.h \
  ../th/PCR←ThCurr.h ../th/PCR←ThPvt.h ../th/PCR←ThData.h ../th/PCR←ThCtl.h \
  ../th/PCR←ThCtlTypes.h ../posix/limits.h ../posix/host/limits.h \
  ../posix/setjmp.h ../mm/PCR←MM.h ../posix/stddef.h ../posix/host/stddef.h \
  ../io/PCR←IO.h ../posix/sys/types.h ../posix/host/sys/types.h \
  /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h ../posix/dirent.h \
  ../posix/host/dirent.h /usr/include/sys/dirent.h ../posix/sys/stat.h \
  ../host/sys/stat.h ../posix/fcntl.h ../host/fcntl.h \
  /usr/include/sys/fcntlcom.h ../posix/utime.h ../host/utime.h \
  ../io/PCR←IOGbl.h ../io/PCR←IOGblGlue.h ../io/PCR←IOLcl.h ../posix/errno.h \
  ../host/errno.h /usr/include/sys/errno.h 
PCR←IOLclImpl.o : PCR←IOLclImpl.c ../config/PCR←StdDefs.h \
  ../config/PCR←StdTypes.h ../config/PCR←Arch.h ../io/PCR←IOLcl.h \
  ../th/PCR←ThData.h ../sig/PCR←SigTypes.h ../config/PCR←OS.h \
  ../io/PCR←IOGbl.h ../th/PCR←Th.h ../sig/PCR←Sig.h ../th/PCR←ThTypes.h \
  ../posix/sys/stat.h ../host/sys/stat.h ../posix/sys/types.h \
  ../posix/host/sys/types.h /usr/include/sys/stdtypes.h \
  /usr/include/sys/sysmacros.h ../io/PCR←IO.h ../posix/dirent.h \
  ../posix/host/dirent.h /usr/include/sys/dirent.h ../posix/fcntl.h \
  ../host/fcntl.h /usr/include/sys/fcntlcom.h ../posix/utime.h \
  ../host/utime.h ../posix/limits.h ../posix/host/limits.h 
PCR←IOGblUFSImpl.o : PCR←IOGblUFSImpl.c ../config/PCR←StdDefs.h \
  ../config/PCR←StdTypes.h ../config/PCR←Arch.h ../config/PCR←OS.h \
  ../base/PCR←Base.h ../base/PCR←BaseArgs.h \
  /import/gnu/lib/gcc-include/stdarg.h ../base/PCR←BaseRun.h \
  ../th/PCR←ThData.h ../sig/PCR←SigTypes.h ../th/PCR←Th.h ../sig/PCR←Sig.h \
  ../th/PCR←ThTypes.h ../th/PCR←ThCrSec.h ../th/PCR←ThCrSecInlines.h \
  ../th/PCR←ThCurr.h ../th/PCR←ThPvt.h ../th/PCR←ThCtl.h \
  ../th/PCR←ThCtlTypes.h ../posix/limits.h ../posix/host/limits.h \
  ../posix/setjmp.h ../th/PCR←ThGlue.h ../sig/PCR←SigGlue.h ../vd/PCR←VD.h \
  ../mm/PCR←MM.h ../posix/stddef.h ../posix/host/stddef.h ../io/PCR←IO.h \
  ../posix/sys/types.h ../posix/host/sys/types.h /usr/include/sys/stdtypes.h \
  /usr/include/sys/sysmacros.h ../posix/dirent.h ../posix/host/dirent.h \
  /usr/include/sys/dirent.h ../posix/sys/stat.h ../host/sys/stat.h \
  ../posix/fcntl.h ../host/fcntl.h /usr/include/sys/fcntlcom.h \
  ../posix/utime.h ../host/utime.h ../io/PCR←IOWDir.h ../io/PCR←IOLcl.h \
  ../io/PCR←IOGbl.h ../io/PCR←IOGblGlue.h ../io/PCR←IOSocketGlue.h \
  ../io/PCR←IOSocket.h ../host/sys/socket.h ../posix/host/sys/sockio.h \
  /import/gnu/lib/gcc-include/sys/ioccom.h ../posix/host/netinet/in.h \
  ../posix/host/netinet/tcp.h ../io/PCR←IOGblUFS.h ../host/poll.h \
  ../io/PCR←IOGblUFSSocket.h ../io/PCR←IOGblUFSStream.h ../io/PCR←IOStream.h \
  ../posix/host/stropts.h ../posix/unistd.h ../posix/host/unistd.h \
  ../posix/errno.h ../host/errno.h /usr/include/sys/errno.h ../ansi/string.h \
  ../host/sys/time.h ../posix/time.h ../host/time.h ../host/sys/resource.h \
  ../host/sys/ioctl.h /import/gnu/lib/gcc-include/sys/ttychars.h \
  /usr/include/sys/ttydev.h /import/gnu/lib/gcc-include/sys/ttold.h \
  /import/gnu/lib/gcc-include/sys/ttycom.h \
  /import/gnu/lib/gcc-include/sys/filio.h ../posix/sys/sockio.h 
PCR←IOSocketImpl.o : PCR←IOSocketImpl.c ../config/PCR←StdDefs.h \
  ../config/PCR←StdTypes.h ../config/PCR←Arch.h ../base/PCR←Base.h \
  ../base/PCR←BaseArgs.h /import/gnu/lib/gcc-include/stdarg.h ../th/PCR←Th.h \
  ../sig/PCR←Sig.h ../config/PCR←OS.h ../sig/PCR←SigTypes.h \
  ../th/PCR←ThTypes.h ../io/PCR←IO.h ../posix/sys/types.h \
  ../posix/host/sys/types.h /usr/include/sys/stdtypes.h \
  /usr/include/sys/sysmacros.h ../posix/dirent.h ../posix/host/dirent.h \
  /usr/include/sys/dirent.h ../posix/sys/stat.h ../host/sys/stat.h \
  ../posix/fcntl.h ../host/fcntl.h /usr/include/sys/fcntlcom.h \
  ../posix/utime.h ../host/utime.h ../io/PCR←IOLcl.h ../th/PCR←ThData.h \
  ../io/PCR←IOGbl.h ../posix/limits.h ../posix/host/limits.h \
  ../io/PCR←IOGblGlue.h ../io/PCR←IOSocket.h ../host/sys/socket.h \
  ../posix/host/sys/sockio.h /import/gnu/lib/gcc-include/sys/ioccom.h \
  ../posix/host/netinet/in.h ../posix/host/netinet/tcp.h \
  ../io/PCR←IOSocketGlue.h ../posix/unistd.h ../posix/host/unistd.h \
  ../posix/errno.h ../host/errno.h /usr/include/sys/errno.h 
PCR←IOGblUFSSocketImpl.o : PCR←IOGblUFSSocketImpl.c ../config/PCR←StdDefs.h \
  ../config/PCR←StdTypes.h ../config/PCR←Arch.h ../config/PCR←OS.h \
  ../th/PCR←Th.h ../sig/PCR←Sig.h ../sig/PCR←SigTypes.h ../th/PCR←ThTypes.h \
  ../th/PCR←ThCrSec.h ../th/PCR←ThCrSecInlines.h ../th/PCR←ThCurr.h \
  ../th/PCR←ThPvt.h ../th/PCR←ThData.h ../th/PCR←ThCtl.h \
  ../th/PCR←ThCtlTypes.h ../posix/limits.h ../posix/host/limits.h \
  ../posix/setjmp.h ../vd/PCR←VD.h ../mm/PCR←MM.h ../posix/stddef.h \
  ../posix/host/stddef.h ../io/PCR←IO.h ../posix/sys/types.h \
  ../posix/host/sys/types.h /usr/include/sys/stdtypes.h \
  /usr/include/sys/sysmacros.h ../posix/dirent.h ../posix/host/dirent.h \
  /usr/include/sys/dirent.h ../posix/sys/stat.h ../host/sys/stat.h \
  ../posix/fcntl.h ../host/fcntl.h /usr/include/sys/fcntlcom.h \
  ../posix/utime.h ../host/utime.h ../io/PCR←IOGbl.h ../io/PCR←IOGblGlue.h \
  ../io/PCR←IOSocket.h ../host/sys/socket.h ../posix/host/sys/sockio.h \
  /import/gnu/lib/gcc-include/sys/ioccom.h ../posix/host/netinet/in.h \
  ../posix/host/netinet/tcp.h ../io/PCR←IOSocketGlue.h ../io/PCR←IOGblUFS.h \
  ../host/poll.h ../io/PCR←IOGblUFSSocket.h \
  /import/gnu/lib/gcc-include/stdarg.h ../posix/unistd.h \
  ../posix/host/unistd.h ../posix/errno.h ../host/errno.h \
  /usr/include/sys/errno.h ../ansi/string.h 
PCR←IOStreamImpl.o : PCR←IOStreamImpl.c ../config/PCR←StdDefs.h \
  ../config/PCR←StdTypes.h ../config/PCR←Arch.h ../base/PCR←Base.h \
  ../base/PCR←BaseArgs.h /import/gnu/lib/gcc-include/stdarg.h ../th/PCR←Th.h \
  ../sig/PCR←Sig.h ../config/PCR←OS.h ../sig/PCR←SigTypes.h \
  ../th/PCR←ThTypes.h ../io/PCR←IO.h ../posix/sys/types.h \
  ../posix/host/sys/types.h /usr/include/sys/stdtypes.h \
  /usr/include/sys/sysmacros.h ../posix/dirent.h ../posix/host/dirent.h \
  /usr/include/sys/dirent.h ../posix/sys/stat.h ../host/sys/stat.h \
  ../posix/fcntl.h ../host/fcntl.h /usr/include/sys/fcntlcom.h \
  ../posix/utime.h ../host/utime.h ../io/PCR←IOGbl.h ../io/PCR←IOGblGlue.h \
  ../io/PCR←IOStream.h ../posix/host/stropts.h \
  /import/gnu/lib/gcc-include/sys/ioccom.h ../io/PCR←IOStreamGlue.h \
  ../posix/unistd.h ../posix/host/unistd.h ../posix/errno.h ../host/errno.h \
  /usr/include/sys/errno.h 
PCR←IOGblUFSStreamImpl.o : PCR←IOGblUFSStreamImpl.c ../config/PCR←StdDefs.h \
  ../config/PCR←StdTypes.h ../config/PCR←Arch.h ../config/PCR←OS.h \
  ../io/PCR←IOStream.h ../th/PCR←ThTypes.h ../sig/PCR←SigTypes.h \
  ../posix/host/stropts.h /import/gnu/lib/gcc-include/sys/ioccom.h \
  ../th/PCR←ThCrSec.h ../th/PCR←ThCrSecInlines.h ../th/PCR←Th.h \
  ../sig/PCR←Sig.h ../th/PCR←ThCurr.h ../th/PCR←ThPvt.h ../th/PCR←ThData.h \
  ../th/PCR←ThCtl.h ../th/PCR←ThCtlTypes.h ../posix/limits.h \
  ../posix/host/limits.h ../posix/setjmp.h ../vd/PCR←VD.h ../io/PCR←IO.h \
  ../posix/sys/types.h ../posix/host/sys/types.h /usr/include/sys/stdtypes.h \
  /usr/include/sys/sysmacros.h ../posix/dirent.h ../posix/host/dirent.h \
  /usr/include/sys/dirent.h ../posix/sys/stat.h ../host/sys/stat.h \
  ../posix/fcntl.h ../host/fcntl.h /usr/include/sys/fcntlcom.h \
  ../posix/utime.h ../host/utime.h ../io/PCR←IOGbl.h ../io/PCR←IOGblGlue.h \
  ../io/PCR←IOStreamGlue.h ../io/PCR←IOGblUFS.h ../host/poll.h \
  ../io/PCR←IOGblUFSStream.h /import/gnu/lib/gcc-include/stdarg.h \
  ../mm/PCR←MM.h ../posix/stddef.h ../posix/host/stddef.h ../posix/unistd.h \
  ../posix/host/unistd.h ../posix/errno.h ../host/errno.h \
  /usr/include/sys/errno.h ../host/signal.h /usr/include/sys/signal.h \
  /usr/include/vm/faultcode.h 
PCR←IOWDirImpl.o : PCR←IOWDirImpl.c ../config/PCR←StdDefs.h \
  ../config/PCR←StdTypes.h ../config/PCR←Arch.h ../th/PCR←Th.h \
  ../sig/PCR←Sig.h ../config/PCR←OS.h ../sig/PCR←SigTypes.h \
  ../th/PCR←ThTypes.h ../th/PCR←ThCrSec.h ../th/PCR←ThCrSecInlines.h \
  ../th/PCR←ThCurr.h ../th/PCR←ThPvt.h ../th/PCR←ThData.h ../th/PCR←ThCtl.h \
  ../th/PCR←ThCtlTypes.h ../posix/limits.h ../posix/host/limits.h \
  ../posix/setjmp.h ../vd/PCR←VD.h ../io/PCR←IOWDir.h ../io/PCR←IOLcl.h \
  ../io/PCR←IOGbl.h ../posix/sys/stat.h ../host/sys/stat.h \
  ../posix/sys/types.h ../posix/host/sys/types.h /usr/include/sys/stdtypes.h \
  /usr/include/sys/sysmacros.h ../io/PCR←IO.h ../posix/dirent.h \
  ../posix/host/dirent.h /usr/include/sys/dirent.h ../posix/fcntl.h \
  ../host/fcntl.h /usr/include/sys/fcntlcom.h ../posix/utime.h \
  ../host/utime.h ../posix/errno.h ../host/errno.h /usr/include/sys/errno.h \
  ../ansi/string.h