#######################################################################
# 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 is the makefile to create a library of the test matrix
#  generators used the package.  The files are organized as follows:
#
#     SCATGEN  -- Auxiliary routines called from both REAL and COMPLEX
#     DZATGEN  -- Auxiliary routines called from both DOUBLE PRECISION
#                 and COMPLEX*16
#     SMATGEN  -- Single precision real matrix generation routines
#     CMATGEN  -- Single precision complex matrix generation routines
#     DMATGEN  -- Double precision real matrix generation routines
#     ZMATGEN  -- Double precision complex matrix generation routines
#
#  The library can be set up to include routines for any combination
#  of the four precisions.  To create or add to the library, enter
#  make -f makeunix followed by one or more of the precisions 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 creates a library of all four precisions.
#  The library is called
#       tmglib.a
#  and is created at the XGELSZ directory level.
#
#  To remove the object files after the library is created, enter
#       make -f makeunix clean
#
# Please refer to the readme file in XGELSZ/INSTALL for 
# further documentation on the use of makefiles in the package.
#######################################################################
include ../../make.inc

MATGEN = $(LAPACK)/TESTING/MATGEN

SCATGEN = slatm1.o slaran.o slarnd.o

SMATGEN = slatms.o slatme.o slatmr.o \
   slagge.o slagsy.o slakf2.o slarge.o slaror.o slarot.o slatm2.o \
   slatm3.o slatm5.o slatm6.o

CMATGEN = clatms.o clatme.o clatmr.o \
   clagge.o claghe.o clagsy.o clakf2.o clarge.o claror.o clarot.o \
   clatm1.o clarnd.o clatm2.o clatm3.o clatm5.o clatm6.o

DZATGEN = dlatm1.o dlaran.o dlarnd.o

DMATGEN = dlatms.o dlatme.o dlatmr.o \
   dlagge.o dlagsy.o dlakf2.o dlarge.o dlaror.o dlarot.o dlatm2.o \
   dlatm3.o dlatm5.o dlatm6.o

ZMATGEN = zlatms.o zlatme.o zlatmr.o \
   zlagge.o zlaghe.o zlagsy.o zlakf2.o zlarge.o zlaror.o zlarot.o \
   zlatm1.o zlarnd.o zlatm2.o zlatm3.o zlatm5.o zlatm6.o

all: single complex double complex16

single: $(SMATGEN) $(SCATGEN)
	$(ARCH) $(ARCHFLAGS) ../../$(TMGLIB) $(SMATGEN) $(SCATGEN)
	$(RANLIB) ../../$(TMGLIB)

complex: $(CMATGEN) $(SCATGEN)
	$(ARCH) $(ARCHFLAGS) ../../$(TMGLIB) $(CMATGEN) $(SCATGEN)
	$(RANLIB) ../../$(TMGLIB)

double: $(DMATGEN) $(DZATGEN)
	$(ARCH) $(ARCHFLAGS) ../../$(TMGLIB) $(DMATGEN) $(DZATGEN)
	$(RANLIB) ../../$(TMGLIB)

complex16: $(ZMATGEN) $(DZATGEN)
	$(ARCH) $(ARCHFLAGS) ../../$(TMGLIB) $(ZMATGEN) $(DZATGEN)
	$(RANLIB) ../../$(TMGLIB)

clean: ; \
        rm -f *.o

.SUFFIXES: .f .o
%.o: $(MATGEN)/%.f
	$(FORTRAN) $(OPTS) -c $<
