#########################################################################
# File          : makefile                                              #
# Purpose       : create complex version of Subspace Iteration Code     #
# Author        : Sowmini Varadhan (Jan 1994)                           #
#                                                                       #
#########################################################################

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

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

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

#
# Matrix vector multiplication and other utilities:
#
UTILS    = cop.o 
#########################################################################


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


all:    lib csis3

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

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

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