.SUFFIXES: .C

VERSION=0.50
LIBIO=libio.a
AR=ar
RANLIB=ranlib

# strtoul.o is needed unless libc contains strtoul().
STRTOUL=strtoul.o

IOSTREAM_OBS= streambuf.o iostream.o strstream.o \
  fstream.o parsestream.o stream.o makebuf.o editbuf.o fvwrite.o \
  filebuf.o sgetline.o igetline.o __vsbscanf.o __vsbprintf.o $(STRTOUL)

$(LIBIO): $(IOSTREAM_OBS)
	rm -f $(LIBIO)
	$(AR) r $(LIBIO) $(IOSTREAM_OBS)
	$(RANLIB) $(LIBIO)	

CPLUS=g++ # -Wall -DDEBUG
#CPLUS_INCLUDE=-I/usr/latest/lib/gcc/sun4/1.95.02/g++-include
CPLUS_INCLUDE=-I../g++-include
.C.o:
	$(CPLUS) -c -I. $(CPLUS_INCLUDE) -fansi-exceptions -g $<

HERE=iostream
DIST_FILE=iostream-${VERSION}.tar.Z
${DIST_FILE}: dist
dist:
	cd ..; tar cf - $(HERE)/Makefile $(HERE)/QUESTIONS $(HERE)/README\
	 $(HERE)/TODO $(HERE)/LICENSE $(HERE)/*.doc $(HERE)/*.[Cch] \
	 $(HERE)/stdio/*.[Ch] $(HERE)/stdio/Makefile \
	 $(HERE)/test/Makefile $(HERE)/test/*.C $(HERE)/test/tFile.inp \
	 $(HERE)/test/expected.out | compress -c>$(HERE)/${DIST_FILE}
clean:
	rm -f *.o *.a *~ core *.tar.Z
