#########################################################################
# File          : makefile                                              #
# Author        : Sowmini Varadhan                                      #
#                                                                       #
#########################################################################

LINK		=  f77  -O  
F77      	=  f77  -O  -c 

#
# Create the lapack and blas libraries:
#
# TOP has to be modified to where the root of the source tree is.
TOP             = .

LAPACK          = library.a
DIRS            = $(TOP)/LAPACK $(TOP)/BLAS

#
# Matrix vector multiplication and other utilities:

UTILS    = op.o


.f.o:   $*.f 
	${F77} $*.f


all:    lib sis3

lib:
	@( \
	for f in $(DIRS); \
	do \
		cd $$f; \
		echo Making lib in $$f; \
		make $@ LIBRARY=$(TOP)/library.a; \
		cd ..; \
	done )

#
sis3:	sis3.o ${UTILS}  $(TOP)/LAPACK/${LAPACK} $(TOP)/BLAS/${LAPACK}
	${LINK} -o $@ sis3.o ${UTILS}  $(TOP)/LAPACK/${LAPACK} $(TOP)/BLAS/${LAPACK}

clean:
	/bin/rm -f ${UTILS}  ?orthog *.o sis3 
