CPPFLAGS = -I../include -L../lib -lrsClasses -lcomplex -lm
SRC =   CofR.C CofR.h Hinf.C decimate.C h1.C h1k.C lu.C lu.h \
	mag.C modulator.C noisePower.C optimalNTF.C parseFile.C \
	partition.C realize.C sensitivity.C snrCheck.C spectralAnalysis.C \
	synthesizeNTF.C
ALL =   Hinf decimate h1 h1k mag modulator noisePower optimalNTF \
	partition realize sensitivity snrCheck spectralAnalysis synthesizeNTF 
BIN=	../bin
HDR =	CofR.h lu.h
Pargs = ../lib/parseArgs.o
CC_CMD = /bin/CC

.SUFFIXES: .c .C .o .x .g .tr .pf .prt

install: ${ALL}
	mv ${ALL} ${BIN}

clean:
	rm -f core tmp *.err *.o *.bak ${ALL}

release: ${SRC}

CofR.o: CofR.C CofR.h
	-${CC_CMD} -c $*.C ${CPPFLAGS}

decimate: decimate.C
	${CC_CMD} $@.C -o $@ ${CPPFLAGS}

filter: filter.C 
	${CC_CMD} $@.C -o $@ ${Pargs} ${CPPFLAGS}

h1: h1.C
	${CC_CMD} $@.C -o $@ ${CPPFLAGS}

h1k: h1k.C
	${CC_CMD} $@.C -o $@ ${CPPFLAGS}

Hinf: Hinf.C
	${CC_CMD} $@.C -o $@ ${CPPFLAGS}

lu.o: lu.C lu.h
	-${CC_CMD} -c $*.C ${CPPFLAGS} 

mag: mag.C
	${CC_CMD} $@.C -o $@ ${CPPFLAGS}

modulator: modulator.C
	${CC_CMD} $@.C -o $@ ${Pargs} ${CPPFLAGS}

noisePower: noisePower.C
	${CC_CMD} $@.C -o $@ ${CPPFLAGS}
   
optimalNTF: optimalNTF.C
	${CC_CMD} $@.C -o $@ ${Pargs} ${CPPFLAGS}

partition: partition.C
	${CC_CMD} $@.C -o $@ ${CPPFLAGS}

pz: pz.C
	${CC_CMD} $@.C -o $@ ${CPPFLAGS}

realize: realize.C lu.o CofR.o
	${CC_CMD} $@.C -o $@ ${Pargs} CofR.o lu.o ${CPPFLAGS}

sensitivity: sensitivity.C parseFile.C lu.o CofR.o
	${CC_CMD} $@.C -o $@ ${Pargs} CofR.o lu.o ${CPPFLAGS}

spectralAnalysis: spectralAnalysis.C
	${CC_CMD} $@.C -o $@ ${Pargs} ${CPPFLAGS}

snrCheck: snrCheck.C
	cp $@.C $@
	chmod +x $@

synthesizeNTF: synthesizeNTF.C ../lib/parseArgs.o
	${CC_CMD} $@.C -o $@ ${Pargs} ${CPPFLAGS}

.DEFAULT:
	co $@
