#
# Makefile for iostream
#

include ../Makeconfig

LIB:=../$(LIB)
LIBALIAS:=../$(LIBALIAS)

JUMP_DIR:=../jump/$(SHLIB)
JUMP_LIB=libc

ifndef OPTFLAGS
OPTFLAGS= -O6
endif

CFLAGS = $(WFLAGS) $(OPTFLAGS) $(INC) $(XCFLAGS)

INC=
NOSTDINC=-nostdinc++

DIRS=stdio

.SUFFIXES:
.SUFFIXES: .S .C .o .c .s .i

.s.o :
	$(CC) $(CFLAGS) -c $<
	$(LD) $(LDFLAGS) $*.o
	$(MV) a.out $*.o

.S.o :
	$(CC) $(CFLAGS) -c $<
	$(LD) $(LDFLAGS) $*.o
	$(MV) a.out $*.o

.c.o :
	$(CC) $(CFLAGS) -c $<
	$(LD) $(LDFLAGS) $*.o
	$(MV) a.out $*.o

.c.s :
	$(CC) $(CFLAGS) -S $<

.c.i :
	$(CC) $(CFLAGS) -E $< -o $*.i

.C.o:
	$(CC) $(CFLAGS) $(NOSTDINC) -I../iostream $(WRAP_C_INCLUDES) -c $(XTRAFLAGS) $<
	$(LD) $(LDFLAGS) $*.o
	$(MV) a.out $*.o

.C.s:
	$(CC) $(CFLAGS) $(NOSTDINC) -I../iostream $(WRAP_C_INCLUDES) -S $(XTRAFLAGS) $<


.C.i:
	$(CC) $(CFLAGS) $(NOSTDINC) -I../iostream $(WRAP_C_INCLUDES) -E $(XTRAFLAGS) $< -o $*.i

SRC1S= PlotFile.C SFile.C editbuf.C filebuf.C \
	floatconv.C fstream.C igetline.C igetsb.C indstream.C \
	iomanip.C iostream.C makebuf.C outfloat.C parsestream.C \
	procbuf.C sbufvform.C sbufvscan.C sgetline.C stdiostream.C \
	stdstreams.C stream.C streambuf.C strstream.C stdstrbufs.C
SRC2S= _sbufs.c

# The following include files are merely to provide partial
# compatibilty with the old stream library from libg++.

COMPAT_INCLUDES = istream.h ostream.h stream.h

# The following include files are publicly visible, and
# should be installed where user programs can find them.

USER_INCLUDES = editbuf.h fstream.h iomanip.h iostream.h \
	indstream.h parsestream.h streambuf.h strstream.h \
	PlotFile.h SFile.h procbuf.h stdiostream.h \
	$(COMPAT_INCLUDES)

SRCS= $(SRC1S) $(SRC2S)
ASMS= $(SRC1S:.C=.s) $(SCR2S:.c=.s)
OBJS= $(SRC1S:.C=.o)
ALIASES= $(SRC2S:.c=.o)

all: lib libalias

include ../Maketargets
