#
#	... Makefile for dfir
#
# $Id: Makefile,v 1.8 1993/02/05 14:26:20 kabal Exp $


SHELL=/bin/sh

all:	dfir

SOURCES = dfir.f redint.f \
                 intdsg.f tacorr.f trespf.f cciint.f \
                                            ccpint.f \
                          tplslv.f \
                          snrint.f flerr2.f \
                 rednyq.f \
                 nyqdsg.f nyqflt.f amsfir.f \
                                   dconlp.f \
                                   nyqslv.f dlneqn.f \
                                   minphs.f drpoly.f \
                 redmph.f \
                 mphdsg.f mphfct.f \
                 redfir.f firchk.f \
                 firdsg.f firchg.f gridpt.f bandpt.f \
                                   chspec.f \
                                   trspec.f \
                          firrem.f remez.f  lgcoef.f \
                                            remdev.f \
                                            remexc.f errmax.f vlgint.f \
                                   remcof.f trcheb.f \
                                   impuls.f \
                 prtcof.f \
                 prtint.f \
                 wrtint.f \
                 prtnyq.f \
                 wrtnyq.f \
                 prtmph.f \
                 wrtmph.f \
                 prtfir.f \
                 wrtfir.f


LIBNET = libnet.a
LIBUTI = libuti.a

.PRECIOUS: $(LIBNET) $(LIBUTI)
$(LIBNET): \
	$(LIBNET)(libnet/cacm-toms/rpoly.o) \
	$(LIBNET)(libnet/cacm-toms/nucleus/calsc.o) \
	$(LIBNET)(libnet/cacm-toms/nucleus/fxshfr.o) \
	$(LIBNET)(libnet/cacm-toms/nucleus/newest.o) \
	$(LIBNET)(libnet/cacm-toms/nucleus/nextk.o) \
	$(LIBNET)(libnet/cacm-toms/nucleus/quad.o) \
	$(LIBNET)(libnet/cacm-toms/nucleus/quadit.o) \
	$(LIBNET)(libnet/cacm-toms/nucleus/quadsd.o) \
	$(LIBNET)(libnet/cacm-toms/nucleus/realit.o) \
	$(LIBNET)(libnet/core/blas1/daxpy.o) \
	$(LIBNET)(libnet/core/blas1/ddot.o) \
	$(LIBNET)(libnet/core/blas1/dscal.o) \
	$(LIBNET)(libnet/core/blas1/idamax.o) \
	$(LIBNET)(libnet/core/machine/d1mach.o) \
	$(LIBNET)(libnet/core/machine/r1mach.o) \
	$(LIBNET)(libnet/linpack/dgefa.o) \
	$(LIBNET)(libnet/linpack/dgesl.o)
	ranlib $(LIBNET)

$(LIBUTI): \
	$(LIBUTI)(libuti/array/drev.o) \
	$(LIBUTI)(libuti/array/icopy.o) \
	$(LIBUTI)(libuti/array/vcopy.o) \
	$(LIBUTI)(libuti/file/linein.o) \
	$(LIBUTI)(libuti/file/rdline.o) \
	$(LIBUTI)(libuti/file/ttyfun.o) \
	$(LIBUTI)(libuti/file/wrtty.o) \
	$(LIBUTI)(libuti/general/pmcint.o) \
	$(LIBUTI)(libuti/general/nucleus/dmcine.o) \
	$(LIBUTI)(libuti/general/nucleus/dmcinm.o) \
	$(LIBUTI)(libuti/general/nucleus/dmcint.o) \
	$(LIBUTI)(libuti/general/nucleus/evcint.o) \
	$(LIBUTI)(libuti/misc/iceil.o) \
	$(LIBUTI)(libuti/misc/iceilx.o) \
	$(LIBUTI)(libuti/misc/ifloor.o) \
	$(LIBUTI)(libuti/quantizer/lquant.o) \
	$(LIBUTI)(libuti/string/indexr.o) \
	$(LIBUTI)(libuti/string/keymat.o) \
	$(LIBUTI)(libuti/string/keyupc.o) \
	$(LIBUTI)(libuti/string/lenblk.o) \
	$(LIBUTI)(libuti/string/lennul.o) \
	$(LIBUTI)(libuti/string/lenstr.o) \
	$(LIBUTI)(libuti/string/locnbl.o) \
	$(LIBUTI)(libuti/string/rdcstr.o) \
	$(LIBUTI)(libuti/string/rdiva1.o) \
	$(LIBUTI)(libuti/string/rdival.o) \
	$(LIBUTI)(libuti/string/rdrva1.o) \
	$(LIBUTI)(libuti/string/rdrva2.o) \
	$(LIBUTI)(libuti/string/rdrval.o) \
	$(LIBUTI)(libuti/string/rquote.o) \
	$(LIBUTI)(libuti/string/upcase.o) \
	$(LIBUTI)(libuti/string/upcstr.o) \
	$(LIBUTI)(libuti/string/nucleus/fndsub.o) \
	$(LIBUTI)(libuti/string/nucleus/gtpstr.o) \
	$(LIBUTI)(libuti/utility/halt.o) \
	$(LIBUTI)(libuti/utility/warn.o)
	ranlib $(LIBUTI)

FFLAGS = -O
LDFLAGS = -s

dfir:	$(LIBUTI) $(LIBNET) $(SOURCES)
	$(FC) $(FFLAGS) $(LDFLAGS) $(SOURCES) $(LIBNET) $(LIBUTI) -o dfir

.f.a:
	$(FC) -c $(FFLAGS) $<
	$(AR) rv $@ $(*F).o
	$(RM) $(*F).o
.F.a:
	$(FC) -c $(FFLAGS) $<
	$(AR) rv $@ $(*F).o
	$(RM) $(*F).o

clean:
	rm -f *.o libuti/*/*.o libuti/*/*/*.o libnet/*/*.o libnet/*/*/*.o
