#
#  $Id: Makefile.in,v 1.1 1996/04/12 20:31:30 gropp Exp gropp $
#
#  (C) 1995 by Argonne National Laboratory and Mississipi State University.
#      All rights reserved.  See COPYRIGHT in top-level directory.
#
##### User configurable options #####
ARCH        = @ARCH@
COMM        = @COMM@
MPIR_HOME   = @MPIR_HOME@
CC          = @CC@
CLINKER     = @CLINKER@
F77         = @F77@
FLINKER     = @FLINKER@
AR          = @AR@
RANLIB      = @RANLIB@
OPTFLAGS    = @OPTFLAGS@
LIB_PATH    = @LIB_PATH@
FLIB_PATH   = @FLIB_PATH@
LIB_LIST    = @LIB_LIST@
SHELL       = /bin/sh
#
INCLUDE_DIR = @USER_INCLUDE_PATH@ -I$(MPIR_HOME)/include 
DEVICE      = @DEVICE@
### End User configurable options ###
LIBS = $(LIBNAME)
MPI_LIBS = $(LIB_PATH) $(LIB_LIST)
ALL: $(EXECS)
.SUFFIXES: .o .cpp .c

EXECS = aditest1 aditest2 aditest3 aditest4 aditest5 aditest6 aditest7 \
	aditest8 aditest9 aditest10 aditest11 aditest12 aditest13 \
	timers trunc
#OTHERLIBS = /home/MPI/mpich/mpid/ch_p4/p4-1.4/lib/libp4.a
OTHERLIBS = 
MPILIBS = $(LIB_PATH) $(LIB_LIST)
LIBNAME  = ../$(COMM)/libmpid.a $(OTHERLIBS)
CFLAGS   = @CFLAGS@ $(OPTFLAGS) -I../.. -I../../include -I./ -I../$(COMM) \
		-I../ch2

ALL: $(EXECS)

clean:
	/bin/rm -f *~ *.o $(EXECS) 

.c.o:
	$(CC) $(CFLAGS) $(BASEOPT) -c $*.c $(MPI_PROFILE)

.c.cpp:
	cpp $(CFLAGS) $*.c > $*.cpp

timers: timers.o $(LIBS)
	-$(CLINKER) -o timers $(OPTFLAGS) timers.o $(LIBS)
	if [ ! -x timers ] ; then /bin/rm -f timers ; fi
trunc: trunc.o $(LIBS)
	-$(CLINKER) -o trunc $(OPTFLAGS) trunc.o $(LIBS) $(MPILIBS)
	if [ ! -x trunc ] ; then /bin/rm -f trunc ; fi
aditest1: aditest1.o check.o $(LIBS)
	-$(CLINKER) -o aditest1 $(OPTFLAGS) aditest1.o check.o $(LIBS)
	if [ ! -x aditest1 ] ; then /bin/rm -f aditest1 ; fi
aditest2: aditest2.o check.o $(LIBS)
	-$(CLINKER) -o aditest2 check.o $(OPTFLAGS) aditest2.o $(LIBS)
	if [ ! -x aditest2 ] ; then /bin/rm -f aditest2 ; fi
aditest3: aditest3.o check.o $(LIBS)
	-$(CLINKER) -o aditest3 check.o $(OPTFLAGS) aditest3.o $(LIBS)
	if [ ! -x aditest3 ] ; then /bin/rm -f aditest3 ; fi
aditest4: aditest4.o check.o $(LIBS)
	-$(CLINKER) -o aditest4 check.o $(OPTFLAGS) aditest4.o $(LIBS)
	if [ ! -x aditest4 ] ; then /bin/rm -f aditest4 ; fi
aditest5: aditest5.o check.o $(LIBS)
	-$(CLINKER) -o aditest5 check.o $(OPTFLAGS) aditest5.o $(LIBS)
	if [ ! -x aditest5 ] ; then /bin/rm -f aditest5 ; fi
aditest6: aditest6.o check.o $(LIBS)
	-$(CLINKER) -o aditest6 check.o $(OPTFLAGS) aditest6.o $(LIBS)
	if [ ! -x aditest6 ] ; then /bin/rm -f aditest6 ; fi
aditest7: aditest7.o check.o $(LIBS)
	-$(CLINKER) -o aditest7 check.o $(OPTFLAGS) aditest7.o $(LIBS)
	if [ ! -x aditest7 ] ; then /bin/rm -f aditest7 ; fi
aditest8: aditest8.o check.o $(LIBS)
	-$(CLINKER) -o aditest8 check.o $(OPTFLAGS) aditest8.o $(LIBS)
	if [ ! -x aditest8 ] ; then /bin/rm -f aditest8 ; fi
aditest9: aditest9.o check.o $(LIBS)
	-$(CLINKER) -o aditest9 check.o $(OPTFLAGS) aditest9.o $(LIBS) \
		$(MPILIBS)
	if [ ! -x aditest9 ] ; then /bin/rm -f aditest9 ; fi
aditest10: aditest10.o check.o $(LIBS)
	-$(CLINKER) -o aditest10 check.o $(OPTFLAGS) aditest10.o $(LIBS) \
		$(MPILIBS)
	if [ ! -x aditest10 ] ; then /bin/rm -f aditest10 ; fi
aditest11: aditest11.o check.o $(LIBS)
	-$(CLINKER) -o aditest11 check.o $(OPTFLAGS) aditest11.o $(LIBS) \
		$(MPILIBS)
	if [ ! -x aditest11 ] ; then /bin/rm -f aditest11 ; fi
aditest12: aditest12.o check.o $(LIBS)
	-$(CLINKER) -o aditest12 check.o $(OPTFLAGS) aditest12.o $(LIBS) \
		$(MPILIBS)
	if [ ! -x aditest12 ] ; then /bin/rm -f aditest12 ; fi
aditest13: aditest13.o check.o $(LIBS)
	-$(CLINKER) -o aditest13 check.o $(OPTFLAGS) aditest13.o $(LIBS) \
		$(MPILIBS)
	if [ ! -x aditest13 ] ; then /bin/rm -f aditest13 ; fi

#
# ch_p4 version of tests
runtests_chp4:
	./timers -p4pg pgt
	./aditest1 -p4pg pg1
	./aditest1 -p4pg pg1 -len 2000 -mpipktsize 1000
	./aditest2 -p4pg pg2
	./aditest2 -p4pg pg2 -len 2000 -mpipktsize 1000
	./aditest3 -p4pg pg3
	./aditest3 -p4pg pg3 -len 2000 -mpipktsize 1000
	./aditest4 -p4pg pg4
	./aditest4 -p4pg pg4 -len 2000 -mpipktsize 1000
	./aditest5 -p4pg pg5
	./aditest5 -p4pg pg5 -len 2000 -mpipktsize 1000
	./aditest6 -p4pg pg6
	./aditest6 -p4pg pg6 -len 2000 -mpipktsize 1000
	./aditest7 -p4pg pg7
	./aditest7 -p4pg pg7 -len 2000 -mpipktsize 1000
	./aditest8 -p4pg pg8
	./aditest8 -p4pg pg8 -len 2000 -mpipktsize 1000
	./aditest9 -p4pg pg9
	./aditest9 -p4pg pg9 -mpixdr
	./aditest9 -p4pg pg9 -len 2000 -mpipktsize 1000
	./aditest9 -p4pg pg9 -mpixdr -len 2000 -mpipktsize 1000
	./aditest10 -p4pg pg10
	./aditest10 -p4pg pg10 -mpixdr
	./aditest10 -p4pg pg10 -len 2000 -mpipktsize 1000
	./aditest10 -p4pg pg10 -mpixdr -len 2000 -mpipktsize 1000
	./aditest11 -p4pg pg11
	./aditest11 -p4pg pg11 -mpixdr
	./aditest11 -p4pg pg11 -len 2000 -mpipktsize 1000
	./aditest11 -p4pg pg11 -mpixdr -len 2000 -mpipktsize 1000
	./aditest12 -p4pg pg12
	./aditest13 -p4pg pg13 -len 20000 -mpipktsize 1000
	./trunc -p4pg pgtr
#
# Need to have environment setup
runtests_chmpl:
	-./timers -np 1
	./aditest1 
	./aditest1 -len 2000 -mpipktsize 1000
	./aditest2 
	./aditest2 -len 2000 -mpipktsize 1000
	./aditest3 
	./aditest3 -len 2000 -mpipktsize 1000
	./aditest4 
	./aditest4 -len 2000 -mpipktsize 1000
	./aditest5 
	./aditest5 -len 2000 -mpipktsize 1000
	./aditest6 
	./aditest6 -len 2000 -mpipktsize 1000
	./aditest7 
	./aditest7 -len 2000 -mpipktsize 1000
	./aditest8 
	./aditest8 -len 2000 -mpipktsize 1000
	./aditest9 
	./aditest9 -len 2000 -mpipktsize 1000
	./aditest10 
	./aditest10 -len 2000 -mpipktsize 1000
	./aditest11 
	./aditest11 -len 2000 -mpipktsize 1000
	./aditest12
	./aditest13 -len 20000 -mpipktsize 1000
	./trunc 
#
# Need to have environment setup
runtests_chshmem:
	-./timers -np 1
	./aditest1 -np 2 
	./aditest1 -np 2 -len 2000 -mpipktsize 1000
	./aditest2 -np 2 
	./aditest2 -np 2 -len 2000 -mpipktsize 1000
	./aditest3 -np 2 
	./aditest3 -np 2 -len 2000 -mpipktsize 1000
	./aditest4 -np 2 
	./aditest4 -np 2 -len 2000 -mpipktsize 1000
	./aditest5 -np 2 
	./aditest5 -np 2 -len 2000 -mpipktsize 1000
	./aditest6 -np 2 
	./aditest6 -np 2 -len 2000 -mpipktsize 1000
	./aditest7 -np 2 
	./aditest7 -np 2 -len 2000 -mpipktsize 1000
	./aditest8 -np 2 
	./aditest8 -np 2 -len 2000 -mpipktsize 1000
	./aditest9 -np 2 
	./aditest9 -np 2 -len 2000 -mpipktsize 1000
	./aditest10 -np 2 
	./aditest10 -np 2 -len 2000 -mpipktsize 1000
	./aditest11 -np 2 
	./aditest11 -np 2 -len 2000 -mpipktsize 1000
	./aditest12 -np 2 
	./aditest13 -np 2 -len 20000 -mpipktsize 1000
	./trunc -np 2
