#######################################################################
# This makefile is part of the package for solving rank deficient
# least squares problems. 
# ==================================================================
#     L. Foster                   and   R. Kommu
#     Department of Mathematics         Department of Physics
#     San Jose State University         San Jose State University
#     San Jose, CA 95192                San Jose, CA 95192
#     foster@math.sjsu.edu              rkommu@email.sjsu.edu
# ==================================================================
# 03/05/2004
#
#  This makefile runs the timing programs for the xGELSZ routines
#  and the least squares routines from LAPACK.
#  The timing output files are grouped as follows:
#
#       SLINTIM  -- Single precision real time routines
#       CLINTIM  -- Single precision complex time routines
#       DLINTIM  -- Double precision real time routines
#       ZLINTIM  -- Double precision complex time routines
#
#  Timing programs can be executed for all or some of the four 
#  different precisions.  Enter 'make -f makeunix' to time all
#  the precisions or 'make -f makeunix' followed by one or more
#  of the data types desired.
#
#  Some examples:
#       make -f makeunix single
#       make -f makeunix single complex
#       make -f makeunix single double complex complex16
#  Alternatively, the command
#       make -f makeunix
#  without any arguments runs all four test programs.
#
#  The executable files are called:
#       xlintims, xlintimd, xlintimc, and xlintimz
#  and exist in the current directory level.
#
#  To remove the output files after the tests have been run, enter
#       make  -f makeunix clean
#
#  To re-run specific tests after a make, enter (for example):
#       'rm stime.out; make -f makeunix' 
#
#       'rm *time.out; make -f makeunix'  (to re-run all the timings)
#
# Please refer to the readme file in XGELSZ/INSTALL for further
# documentation on the use of makefiles in this package.
#######################################################################
include ../make.inc

all:     single complex double complex16
large:	 single_large complex_large double_large complex16_large
small:   single complex double complex16

SLINTIM= stime.out
CLINTIM= ctime.out
DLINTIM= dtime.out
ZLINTIM= ztime.out

single:         $(SLINTIM)
complex:        $(CLINTIM)
double:         $(DLINTIM)
complex16:      $(ZLINTIM)

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

stime.out: stime.in xlintims
	@echo Timing square REAL LAPACK linear equation routines
	./xlintims < stime.in > $@ 2>&1

#
# ======== COMPLEX LIN TIMINGS ==========================

ctime.out: ctime.in xlintimc
	@echo Timing square COMPLEX LAPACK linear equation routines
	./xlintimc < ctime.in > $@ 2>&1

#
# ======== DOUBLE LIN TIMINGS ===========================

dtime.out: dtime.in xlintimd
	@echo Timing square DOUBLE PRECISION LAPACK linear equation routines
	./xlintimd < dtime.in > $@ 2>&1

#
# ======== COMPLEX16 LIN TIMINGS ========================

ztime.out: ztime.in xlintimz
	@echo Timing square COMPLEX16 LAPACK linear equation routines
	./xlintimz < ztime.in > $@ 2>&1

xlintims:
	( cd LIN/LINSRC ; $(MAKE) -f makeunix single )
	( cd LIN ; $(MAKE) -f makeunix single )

xlintimc:
	( cd LIN/LINSRC ; $(MAKE) -f makeunix complex )
	( cd LIN ; $(MAKE) -f makeunix complex )

xlintimd:
	( cd LIN/LINSRC ; $(MAKE) -f makeunix double )
	( cd LIN ; $(MAKE) -f makeunix double )

xlintimz:
	( cd LIN/LINSRC ; $(MAKE) -f makeunix complex16 )
	( cd LIN ; $(MAKE) -f makeunix complex16 )

clean:
	rm -f *.out core

cleanup:
	rm -f x* *.out core
