#RUN = -execute -ce
RUN =

#######################################################################
#  This makefile runs the test programs for the linear equation routines
#  and the eigenvalue routines in LAPACK.  The test output files
#  are grouped as follows:
#
#       SLINTIM,SEIGTIM  -- Single precision real time routines
#       CLINTIM,CEIGTIM  -- Single precision complex time routines
#       DLINTIM,DEIGTIM  -- Double precision real time routines
#       ZLINTIM,ZEIGTIM  -- Double precision complex time routines
#
#  Timing programs can be executed for all or some of the four different
#  precisions.  First, modify the RUN definition to refer to the
#  execute and desired execute options for your machine.
#  Then enter 'make' followed by one or more of the data types desired.
#  Some examples:
#       make single
#       make single complex
#       make single double complex complex16
#  Alternatively, the command
#       make
#  without any arguments runs all eight test programs.
#  The executable files are called:
#       xlintims, xlintimd, xlintimc, and xlintimz for LIN
#       xeigtims, xeigtimd, xeigtimc, and xeigtimz for EIG
#  and exist in the current directory level.
#
#  To remove the output files after the tests have been run, enter
#       make clean
#
#  To re-run specific tests after a make, enter (for example):
#       'rm stime.out; make'  or:
#       'make stime.out' or:
#       'touch stime.in; make' (to re-run the timings.)
#
#       'rm *time.out; make'  (to re-run all the timings.)
#
#----------------------------------------------------------------------
#  Susan Ostrouchov, Univ. of Tennessee
#  November 1991.
#  Last modified, January 13, 1992.
#
#######################################################################

all:     single complex double complex16

SEIGTIM= sneptim.out \
         sseptim.out \
         ssvdtim.out

CEIGTIM= cneptim.out \
         cseptim.out \
         csvdtim.out

DEIGTIM= dneptim.out \
         dseptim.out \
         dsvdtim.out

ZEIGTIM= zneptim.out \
         zseptim.out \
         zsvdtim.out


SLINTIM= stime.out \
	 sband.out \
	 stime2.out

CLINTIM= ctime.out \
	 cband.out \
	 ctime2.out

DLINTIM= dtime.out \
	 dband.out \
	 dtime2.out

ZLINTIM= ztime.out \
	 zband.out \
	 ztime2.out

single:         $(SLINTIM) $(SEIGTIM)
complex:        $(CLINTIM) $(CEIGTIM)
double:         $(DLINTIM) $(DEIGTIM)
complex16:      $(ZLINTIM) $(ZEIGTIM)

#
# ======== SINGLE LIN TIMINGS ===========================

stime.out: stime.in xlintims
	@echo Data file for timing square REAL LAPACK linear equation routines
	$(RUN) xlintims < stime.in > $@ 2>&1

sband.out: sband.in xlintims
	@echo Data file for timing banded REAL LAPACK linear equation routines
	$(RUN) xlintims < sband.in > $@ 2>&1

stime2.out: stime2.in xlintims
	@echo Data file for timing rectangular REAL LAPACK linear equation routines
	$(RUN) xlintims < stime2.in > $@ 2>&1
#
# ======== COMPLEX LIN TIMINGS ==========================

ctime.out: ctime.in xlintimc
	@echo Data file for timing square COMPLEX LAPACK linear equation routines
	$(RUN) xlintimc < ctime.in > $@ 2>&1

cband.out: cband.in xlintimc
	@echo Data file for timing banded COMPLEX LAPACK linear equation routines
	$(RUN) xlintimc < cband.in > $@ 2>&1

ctime2.out: ctime2.in xlintimc
	@echo Data file for timing rectangular COMPLEX LAPACK linear equation routines
	$(RUN) xlintimc < ctime2.in > $@ 2>&1
#
# ======== DOUBLE LIN TIMINGS ===========================

dtime.out: dtime.in xlintimd
	@echo Data file for timing square DOUBLE PRECISION LAPACK linear equation routines
	$(RUN) xlintimd < dtime.in > $@ 2>&1

dband.out: dband.in xlintimd
	@echo Data file for timing banded DOUBLE PRECISION LAPACK linear equation routines
	$(RUN) xlintimd < dband.in > $@ 2>&1

dtime2.out: dtime2.in xlintimd
	@echo Data file for timing rectangular DOUBLE PRECISION LAPACK linear equation routines
	$(RUN) xlintimd < dtime2.in > $@ 2>&1
#
# ======== COMPLEX16 LIN TIMINGS ========================

ztime.out: ztime.in xlintimz
	@echo Data file for timing square COMPLEX16 LAPACK linear equation routines
	$(RUN) xlintimz < ztime.in > $@ 2>&1
zband.out: zband.in xlintimz
	@echo Data file for timing banded COMPLEX16 LAPACK linear equation routines
	$(RUN) xlintimz < zband.in > $@ 2>&1
ztime2.out: ztime2.in xlintimz
	@echo Data file for timing rectangular COMPLEX16 LAPACK linear equation routines
	$(RUN) xlintimz < ztime2.in > $@ 2>&1
#
#
# ======== SINGLE EIG TIMINGS ===========================
#

sneptim.out: sneptim.in xeigtims
	@echo NEP: Data file for timing REAL Nonsymmetric Eigenvalue Problem routines
	$(RUN) xeigtims < sneptim.in > $@ 2>&1

sseptim.out: sseptim.in xeigtims
	@echo SEP: Data file for timing REAL Symmetric Eigenvalue Problem routines
	$(RUN) xeigtims < sseptim.in > $@ 2>&1

ssvdtim.out: ssvdtim.in xeigtims
	@echo SVD: Data file for timing REAL Singular Value Decomposition routines
	$(RUN) xeigtims < ssvdtim.in > $@ 2>&1
#
# ======== COMPLEX EIG TIMINGS ===========================

cneptim.out: cneptim.in xeigtimc
	@echo NEP: Data file for timing COMPLEX Nonsymmetric Eigenvalue Problem routines
	$(RUN) xeigtimc < cneptim.in > $@ 2>&1

cseptim.out: cseptim.in xeigtimc
	@echo SEP: Data file for timing COMPLEX Symmetric Eigenvalue Problem routines
	$(RUN) xeigtimc < cseptim.in > $@ 2>&1

csvdtim.out: csvdtim.in xeigtimc
	@echo SVD: Data file for timing COMPLEX Singular Value Decomposition routines
	$(RUN) xeigtimc < csvdtim.in > $@ 2>&1
#
# ======== DOUBLE EIG TIMINGS ===========================

dneptim.out: dneptim.in xeigtimd
	@echo NEP: Data file for timing DOUBLE PRECISION Nonsymmetric Eigenvalue Problem routines
	$(RUN) xeigtimd < dneptim.in > $@ 2>&1

dseptim.out: dseptim.in xeigtimd
	@echo SEP: Data file for timing DOUBLE PRECISION Symmetric Eigenvalue Problem routines
	$(RUN) xeigtimd < dseptim.in > $@ 2>&1

dsvdtim.out: dsvdtim.in xeigtimd
	@echo SVD: Data file for timing DOUBLE PRECISION Singular Value Decomposition routines
	$(RUN) xeigtimd < dsvdtim.in > $@ 2>&1
#
# ======== COMPLEX16 EIG TIMINGS ===========================

zneptim.out: zneptim.in xeigtimz
	@echo NEP: Data file for timing COMPLEX16 Nonsymmetric Eigenvalue Problem routines
	$(RUN) xeigtimz < zneptim.in > $@ 2>&1

zseptim.out: zseptim.in xeigtimz
	@echo SEP: Data file for timing COMPLEX16 Symmetric Eigenvalue Problem routines
	$(RUN) xeigtimz < zseptim.in > $@ 2>&1

zsvdtim.out: zsvdtim.in xeigtimz
	@echo SVD: Data file for timing COMPLEX16 Singular Value Decomposition routines
	$(RUN) xeigtimz < zsvdtim.in > $@ 2>&1
# ==============================================================================

xlintims:
	cd LIN ; $(MAKE) single

xlintimc:
	cd LIN ; $(MAKE) complex

xlintimd:
	cd LIN ; $(MAKE) double

xlintimz:
	cd LIN ; $(MAKE) complex16


xeigtims:
	cd EIG/EIGSRC ; $(MAKE) single
	cd EIG ; $(MAKE) single

xeigtimc:
	cd EIG/EIGSRC ; $(MAKE) complex
	cd EIG ; $(MAKE) complex

xeigtimd:
	cd EIG/EIGSRC ; $(MAKE) double
	cd EIG ; $(MAKE) double

xeigtimz:
	cd EIG/EIGSRC ; $(MAKE) complex16
	cd EIG ; $(MAKE) complex16

clean:
	rm -f *.out core

cleanup:
	rm -f x* *.out core
