############################################################################
#
#  Program:         ScaLAPACK
#
#  Module:          Makefile
#
#  Purpose:         PBLAS Testing Makefile
#
#  Creation date:   March 20, 1995
#
#  Modified:
#
#  Send bug reports, comments or suggestions to scalapack@cs.utk.edu
#
############################################################################

include ../../SLmake.inc

sPBLAS1exe    = xspblas1tst
dPBLAS1exe    = xdpblas1tst
cPBLAS1exe    = xcpblas1tst
zPBLAS1exe    = xzpblas1tst

sPBLAS2exe    = xspblas2tst
dPBLAS2exe    = xdpblas2tst
cPBLAS2exe    = xcpblas2tst
zPBLAS2exe    = xzpblas2tst

sPBLAS3exe    = xspblas3tst
dPBLAS3exe    = xdpblas3tst
cPBLAS3exe    = xcpblas3tst
zPBLAS3exe    = xzpblas3tst

spb1tst = $(PBLASTSTdir)/$(sPBLAS1exe)
dpb1tst = $(PBLASTSTdir)/$(dPBLAS1exe)
cpb1tst = $(PBLASTSTdir)/$(cPBLAS1exe)
zpb1tst = $(PBLASTSTdir)/$(zPBLAS1exe)

spb2tst = $(PBLASTSTdir)/$(sPBLAS2exe)
dpb2tst = $(PBLASTSTdir)/$(dPBLAS2exe)
cpb2tst = $(PBLASTSTdir)/$(cPBLAS2exe)
zpb2tst = $(PBLASTSTdir)/$(zPBLAS2exe)

spb3tst = $(PBLASTSTdir)/$(sPBLAS3exe)
dpb3tst = $(PBLASTSTdir)/$(dPBLAS3exe)
cpb3tst = $(PBLASTSTdir)/$(cPBLAS3exe)
zpb3tst = $(PBLASTSTdir)/$(zPBLAS3exe)

spb1t   = psbla1tst.o psblatst.o pblatst.o pberror_.o
dpb1t   = pdbla1tst.o pdblatst.o pblatst.o pberror_.o
cpb1t   = pcbla1tst.o pcblatst.o pblatst.o pberror_.o
zpb1t   = pzbla1tst.o pzblatst.o pblatst.o pberror_.o

spb2t   = psbla2tst.o psblatst.o pblatst.o pberror_.o
dpb2t   = pdbla2tst.o pdblatst.o pblatst.o pberror_.o
cpb2t   = pcbla2tst.o pcblatst.o pblatst.o pberror_.o
zpb2t   = pzbla2tst.o pzblatst.o pblatst.o pberror_.o

spb3t   = psbla3tst.o psblatst.o pblatst.o pberror_.o
dpb3t   = pdbla3tst.o pdblatst.o pblatst.o pberror_.o
cpb3t   = pcbla3tst.o pcblatst.o pblatst.o pberror_.o
zpb3t   = pzbla3tst.o pzblatst.o pblatst.o pberror_.o

all : single double complex complex16

pbbsblastst:
	( cd PBBLAS; $(MAKE) single FRC=$(FRC) )

pbbdblastst:
	( cd PBBLAS; $(MAKE) double FRC=$(FRC) )

pbbcblastst:
	( cd PBBLAS; $(MAKE) complex FRC=$(FRC) )

pbbzblastst:
	( cd PBBLAS; $(MAKE) complex16 FRC=$(FRC) )

#single:    $(spb1tst) $(spb2tst) $(spb3tst) pbbsblastst
single:    $(spb1tst) $(spb2tst) $(spb3tst)

#double:    $(dpb1tst) $(dpb2tst) $(dpb3tst) pbbdblastst
double:    $(dpb1tst) $(dpb2tst) $(dpb3tst)

#complex:   $(cpb1tst) $(cpb2tst) $(cpb3tst) pbbcblastst
complex:   $(cpb1tst) $(cpb2tst) $(cpb3tst)

#complex16: $(zpb1tst) $(zpb2tst) $(zpb3tst) pbbzblastst
complex16: $(zpb1tst) $(zpb2tst) $(zpb3tst)

$(PBLASTSTdir)/PSBLA1TST.dat: PSBLA1TST.dat
	cp PSBLA1TST.dat $(PBLASTSTdir)
$(PBLASTSTdir)/PDBLA1TST.dat: PDBLA1TST.dat
	cp PDBLA1TST.dat $(PBLASTSTdir)
$(PBLASTSTdir)/PCBLA1TST.dat: PCBLA1TST.dat
	cp PCBLA1TST.dat $(PBLASTSTdir)
$(PBLASTSTdir)/PZBLA1TST.dat: PZBLA1TST.dat
	cp PZBLA1TST.dat $(PBLASTSTdir)

$(spb1tst) : $(PBLASLIB) $(TOOLSLIB) $(spb1t)
	$(F77LOADER) $(F77LOADFLAGS) -o $(spb1tst) $(spb1t) $(LIBS)
	$(MAKE) $(PBLASTSTdir)/PSBLA1TST.dat
$(dpb1tst) : $(PBLASLIB) $(TOOLSLIB) $(dpb1t)
	$(F77LOADER) $(F77LOADFLAGS) -o $(dpb1tst) $(dpb1t) $(LIBS)
	$(MAKE) $(PBLASTSTdir)/PDBLA1TST.dat
$(cpb1tst) : $(PBLASLIB) $(TOOLSLIB) $(cpb1t)
	$(F77LOADER) $(F77LOADFLAGS) -o $(cpb1tst) $(cpb1t) $(LIBS)
	$(MAKE) $(PBLASTSTdir)/PCBLA1TST.dat
$(zpb1tst) : $(PBLASLIB) $(TOOLSLIB) $(zpb1t)
	$(F77LOADER) $(F77LOADFLAGS) -o $(zpb1tst) $(zpb1t) $(LIBS)
	$(MAKE) $(PBLASTSTdir)/PZBLA1TST.dat

$(PBLASTSTdir)/PSBLA2TST.dat: PSBLA2TST.dat
	cp PSBLA2TST.dat $(PBLASTSTdir)
$(PBLASTSTdir)/PDBLA2TST.dat: PDBLA2TST.dat
	cp PDBLA2TST.dat $(PBLASTSTdir)
$(PBLASTSTdir)/PCBLA2TST.dat: PCBLA2TST.dat
	cp PCBLA2TST.dat $(PBLASTSTdir)
$(PBLASTSTdir)/PZBLA2TST.dat: PZBLA2TST.dat
	cp PZBLA2TST.dat $(PBLASTSTdir)

$(spb2tst) : $(PBLASLIB) $(TOOLSLIB) $(spb2t)
	$(F77LOADER) $(F77LOADFLAGS) -o $(spb2tst) $(spb2t) $(LIBS)
	$(MAKE) $(PBLASTSTdir)/PSBLA2TST.dat
$(dpb2tst) : $(PBLASLIB) $(TOOLSLIB) $(dpb2t)
	$(F77LOADER) $(F77LOADFLAGS) -o $(dpb2tst) $(dpb2t) $(LIBS)
	$(MAKE) $(PBLASTSTdir)/PDBLA2TST.dat
$(cpb2tst) : $(PBLASLIB) $(TOOLSLIB) $(cpb2t)
	$(F77LOADER) $(F77LOADFLAGS) -o $(cpb2tst) $(cpb2t) $(LIBS)
	$(MAKE) $(PBLASTSTdir)/PCBLA2TST.dat
$(zpb2tst) : $(PBLASLIB) $(TOOLSLIB) $(zpb2t)
	$(F77LOADER) $(F77LOADFLAGS) -o $(zpb2tst) $(zpb2t) $(LIBS)
	$(MAKE) $(PBLASTSTdir)/PZBLA2TST.dat

$(PBLASTSTdir)/PSBLA3TST.dat: PSBLA3TST.dat
	cp PSBLA3TST.dat $(PBLASTSTdir)
$(PBLASTSTdir)/PDBLA3TST.dat: PDBLA3TST.dat
	cp PDBLA3TST.dat $(PBLASTSTdir)
$(PBLASTSTdir)/PCBLA3TST.dat: PCBLA3TST.dat
	cp PCBLA3TST.dat $(PBLASTSTdir)
$(PBLASTSTdir)/PZBLA3TST.dat: PZBLA3TST.dat
	cp PZBLA3TST.dat $(PBLASTSTdir)

$(spb3tst) : $(PBLASLIB) $(TOOLSLIB) $(spb3t)
	$(F77LOADER) $(F77LOADFLAGS) -o $(spb3tst) $(spb3t) $(LIBS)
	$(MAKE) $(PBLASTSTdir)/PSBLA3TST.dat
$(dpb3tst) : $(PBLASLIB) $(TOOLSLIB) $(dpb3t)
	$(F77LOADER) $(F77LOADFLAGS) -o $(dpb3tst) $(dpb3t) $(LIBS)
	$(MAKE) $(PBLASTSTdir)/PDBLA3TST.dat
$(cpb3tst) : $(PBLASLIB) $(TOOLSLIB) $(cpb3t)
	$(F77LOADER) $(F77LOADFLAGS) -o $(cpb3tst) $(cpb3t) $(LIBS)
	$(MAKE) $(PBLASTSTdir)/PCBLA3TST.dat
$(zpb3tst) : $(PBLASLIB) $(TOOLSLIB) $(zpb3t)
	$(F77LOADER) $(F77LOADFLAGS) -o $(zpb3tst) $(zpb3t) $(LIBS)
	$(MAKE) $(PBLASTSTdir)/PZBLA3TST.dat

$(spb1t): $(FRC)
$(dpb1t): $(FRC)
$(cpb1t): $(FRC)
$(zpb1t): $(FRC)

$(spb2t): $(FRC)
$(dpb2t): $(FRC)
$(cpb2t): $(FRC)
$(zpb2t): $(FRC)

$(spb3t): $(FRC)
$(dpb3t): $(FRC)
$(cpb3t): $(FRC)
$(zpb3t): $(FRC)

FRC:
	@FRC=$(FRC)

clean :
	rm -f *.o

.f.o : ; $(F77) -c $(F77FLAGS) $*.f

.c.o : ; $(CC) -c $(CCFLAGS) $(CDEFS) $*.c
