#######################################################################
# 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 creates programs that generate the data for the
#  examples in the figures in the paper by Foster and Kommu.
#  To run the makefile type:
#       nmake -f makewin32
#  The executable files are called:
#       cfig12, dfig12, sfig12, zfig12, cfig3, dfig3, sfig3 and zfig3
#  and exist in the current directory level.
#
#  The makefile does not run these executable but they can be run
#  by typing, for example,
#       xfig12 < fig12.in (where x is c, d, s or z) or
#       xfig3  < fig3.in  (where x is c, d, s or z).
#
#  To remove the executable, object and output files after the examples
#  have been run, type:
#       nmake -f makewin32 clean
# 
# Please refer to the readme file in XGELSZ/INSTALL for 
# further documentation on the use of this makefile.
#######################################################################
!include <..\make.inc>

TSTLINSRC=$(LAPACK)\TESTING\LIN
MATGENSRC=$(LAPACK)\TESTING\MATGEN

all : single complex double complex16 

single : sfig12.exe sfig3.exe

complex : cfig12.exe cfig3.exe

double : dfig12.exe dfig3.exe 

complex16: zfig12.exe zfig3.exe

sfig12.exe : sfig12.obj sqrt25.obj slaord.obj slarnd.obj slaror.obj \
slaran.obj sqrt12.obj sqrt14.obj sqrt16.obj sqrt17.obj
	$(LOADER) $(LOADOPTS) -exe:$@ sfig12.obj sqrt25.obj slaord.obj \
	slarnd.obj slaror.obj slaran.obj sqrt12.obj sqrt14.obj sqrt16.obj \
	sqrt17.obj \
	..\$(LAPACKLIB) $(BLASLIB)

sfig3.exe : sfig3.obj sqrt25.obj slaord.obj slarnd.obj slaror.obj \
slaran.obj sqrt12.obj sqrt14.obj sqrt16.obj sqrt17.obj
	$(LOADER) $(LOADOPTS) -exe:$@ sfig3.obj sqrt25.obj slaord.obj \
	slarnd.obj slaror.obj slaran.obj sqrt12.obj sqrt14.obj sqrt16.obj \
	sqrt17.obj \
	..\$(LAPACKLIB) $(BLASLIB)
  
cfig12.exe : cfig12.obj cqrt25.obj slaord.obj clarnd.obj slarnd.obj \
claror.obj slaran.obj cqrt12.obj cqrt14.obj cqrt16.obj cqrt17.obj
	$(LOADER) $(LOADOPTS) -exe:$@ cfig12.obj cqrt25.obj slaord.obj \
	clarnd.obj slarnd.obj claror.obj slaran.obj cqrt12.obj cqrt14.obj \
	cqrt16.obj cqrt17.obj \
	..\$(LAPACKLIB) $(BLASLIB)
  
cfig3.exe : cfig3.obj cqrt25.obj slaord.obj clarnd.obj slarnd.obj claror.obj \
slaran.obj cqrt12.obj cqrt14.obj cqrt16.obj cqrt17.obj
	$(LOADER) $(LOADOPTS) -exe:$@ cfig3.obj cqrt25.obj slaord.obj \
	clarnd.obj slarnd.obj claror.obj slaran.obj cqrt12.obj cqrt14.obj \
	cqrt16.obj cqrt17.obj \
	..\$(LAPACKLIB) $(BLASLIB)
    
dfig12.exe : dfig12.obj dqrt25.obj dlaord.obj dlarnd.obj dlaror.obj dlaran.obj \
dqrt12.obj dqrt14.obj dqrt16.obj dqrt17.obj
	$(LOADER) $(LOADOPTS) -exe:$@ dfig12.obj dqrt25.obj dlaord.obj dlarnd.obj \
	dlaror.obj dlaran.obj dqrt12.obj dqrt14.obj dqrt16.obj dqrt17.obj \
	..\$(LAPACKLIB) $(BLASLIB)
  
dfig3.exe : dfig3.obj dqrt25.obj dlaord.obj dlarnd.obj dlaror.obj dlaran.obj \
dqrt12.obj dqrt14.obj dqrt16.obj dqrt17.obj
	$(LOADER) $(LOADOPTS) -exe:$@ dfig3.obj dqrt25.obj dlaord.obj dlarnd.obj \
	dlaror.obj dlaran.obj dqrt12.obj dqrt14.obj dqrt16.obj dqrt17.obj \
	..\$(LAPACKLIB) $(BLASLIB)
  
zfig12.exe : zfig12.obj zqrt25.obj dlaord.obj zlarnd.obj dlarnd.obj \
zlaror.obj dlaran.obj zqrt12.obj zqrt14.obj zqrt16.obj zqrt17.obj
	$(LOADER) $(LOADOPTS) -exe:$@ zfig12.obj zqrt25.obj dlaord.obj zlarnd.obj \
	dlarnd.obj zlaror.obj dlaran.obj zqrt12.obj zqrt14.obj zqrt16.obj \
	zqrt17.obj \
	..\$(LAPACKLIB) $(BLASLIB)
  
zfig3.exe : zfig3.obj zqrt25.obj dlaord.obj zlarnd.obj dlarnd.obj zlaror.obj \
dlaran.obj zqrt12.obj zqrt14.obj zqrt16.obj zqrt17.obj
	$(LOADER) $(LOADOPTS) -exe:$@ zfig3.obj zqrt25.obj dlaord.obj zlarnd.obj \
	dlarnd.obj zlaror.obj dlaran.obj zqrt12.obj zqrt14.obj zqrt16.obj zqrt17.obj \
	..\$(LAPACKLIB) $(BLASLIB)

sfig12.obj : sfig12.f
	$(FORTRAN) $(OPTS) -c $?
sfig3.obj : sfig3.f
	$(FORTRAN) $(OPTS) -c $?
sqrt25.obj : sqrt25.f
	$(FORTRAN) $(OPTS) -c $?
sqrt12.obj : {$(TSTLINSRC)}sqrt12.f
	$(FORTRAN) $(OPTS) -c $?
sqrt14.obj : {$(TSTLINSRC)}sqrt14.f
	$(FORTRAN) $(OPTS) -c $?
sqrt16.obj : {$(TSTLINSRC)}sqrt16.f
	$(FORTRAN) $(OPTS) -c $?
sqrt17.obj : {$(TSTLINSRC)}sqrt17.f
	$(FORTRAN) $(OPTS) -c $?
slaord.obj : {$(TSTLINSRC)}slaord.f
	$(FORTRAN) $(OPTS) -c $?
slarnd.obj : {$(MATGENSRC)}slarnd.f
	$(FORTRAN) $(OPTS) -c $?
slaror.obj : {$(MATGENSRC)}slaror.f
	$(FORTRAN) $(OPTS) -c $?
slaran.obj : {$(MATGENSRC)}slaran.f
	$(FORTRAN) $(OPTS) -c $?

cfig12.obj : cfig12.f
	$(FORTRAN) $(OPTS) -c $?
cfig3.obj : cfig3.f
	$(FORTRAN) $(OPTS) -c $?
cqrt25.obj : cqrt25.f
	$(FORTRAN) $(OPTS) -c $?
cqrt12.obj : {$(TSTLINSRC)}cqrt12.f
	$(FORTRAN) $(OPTS) -c $?
cqrt14.obj : {$(TSTLINSRC)}cqrt14.f
	$(FORTRAN) $(OPTS) -c $?
cqrt16.obj : {$(TSTLINSRC)}cqrt16.f
	$(FORTRAN) $(OPTS) -c $?
cqrt17.obj : {$(TSTLINSRC)}cqrt17.f
	$(FORTRAN) $(OPTS) -c $?
clarnd.obj : {$(MATGENSRC)}clarnd.f
	$(FORTRAN) $(OPTS) -c $?
claror.obj : {$(MATGENSRC)}claror.f
	$(FORTRAN) $(OPTS) -c $?

dfig12.obj : dfig12.f
	$(FORTRAN) $(OPTS) -c $?
dfig3.obj : dfig3.f
	$(FORTRAN) $(OPTS) -c $?
dqrt25.obj : dqrt25.f
	$(FORTRAN) $(OPTS) -c $?
dqrt12.obj : {$(TSTLINSRC)}dqrt12.f
	$(FORTRAN) $(OPTS) -c $?
dqrt14.obj : {$(TSTLINSRC)}dqrt14.f
	$(FORTRAN) $(OPTS) -c $?
dqrt16.obj : {$(TSTLINSRC)}dqrt16.f
	$(FORTRAN) $(OPTS) -c $?
dqrt17.obj : {$(TSTLINSRC)}dqrt17.f
	$(FORTRAN) $(OPTS) -c $?
dlaord.obj : {$(TSTLINSRC)}dlaord.f
	$(FORTRAN) $(OPTS) -c $?
dlarnd.obj : {$(MATGENSRC)}dlarnd.f
	$(FORTRAN) $(OPTS) -c $?
dlaror.obj : {$(MATGENSRC)}dlaror.f
	$(FORTRAN) $(OPTS) -c $?
dlaran.obj : {$(MATGENSRC)}dlaran.f
	$(FORTRAN) $(OPTS) -c $?

zfig12.obj : zfig12.f
	$(FORTRAN) $(OPTS) -c $?
zfig3.obj : zfig3.f
	$(FORTRAN) $(OPTS) -c $?
zqrt25.obj : zqrt25.f
	$(FORTRAN) $(OPTS) -c $?
zqrt12.obj : {$(TSTLINSRC)}zqrt12.f
	$(FORTRAN) $(OPTS) -c $?
zqrt14.obj : {$(TSTLINSRC)}zqrt14.f
	$(FORTRAN) $(OPTS) -c $?
zqrt16.obj : {$(TSTLINSRC)}zqrt16.f
	$(FORTRAN) $(OPTS) -c $?
zqrt17.obj : {$(TSTLINSRC)}zqrt17.f
	$(FORTRAN) $(OPTS) -c $?
zlarnd.obj : {$(MATGENSRC)}zlarnd.f
	$(FORTRAN) $(OPTS) -c $?
zlaror.obj : {$(MATGENSRC)}zlaror.f
	$(FORTRAN) $(OPTS) -c $?

.SUFFIXES: .f .obj
.f.obj:
	$(FORTRAN) $(OPTS) -c $<

clean:
	del cfig12.exe cfig3.exe dfig12.exe dfig3.exe sfig12.exe sfig3.exe zfig12.exe zfig3.exe
	del *.obj *.out
