LIB = ../lib
RSCLASSES = filter.C vector.C polynomial.C numerics.C ratfn.C stats.C \
	numerics.C complex_io.C
RSHEADER = filter.h vector.h polynomial.h numerics.h ratfn.h  stats.h \
	numerics.h complex.h
ALL= 	${LIB}/librsClasses.a ${LIB}/libcomplex.a
BIN=	../bin
.SUFFIXES: .C .o .x .g .tr .pf .prt
CC_CMD = /bin/CC
CCFLAGS= 
        
install:${ALL} 
	cd demo; make install

clean:
	rm -f core tmp *.err *.o *.bak
	cd demo; make clean

release: ${RSCLASSES}

#this does not take into account changes in the .h files !!
${LIB}/librsClasses.a : ${RSCLASSES}
	-for i in $? ; do \
	${CC_CMD} $$i -c -g -w -I../include ${CCFLAGS} 2>&1 | c++filt;  \
	done
	ar rc ${LIB}/librsClasses.a $(?:.C=.o)
	ranlib ${LIB}/librsClasses.a 
	rm -f $(?:.C=.o)
#now go and make the demo programs
	cd demo;make install

.C.o:
	-${CC_CMD} $*.C -c -I../include ${CCFLAGS}

#replace the standard io routines with my preference
complex ${LIB}/libcomplex.a : complex_io.o 
	cp /usr/lib/libcomplex.a ${LIB}
	ar d ${LIB}/libcomplex.a io.o 
	ar rc ${LIB}/libcomplex.a complex_io.o
	ranlib ${LIB}/libcomplex.a 

.DEFAULT:
	co $@
