SHELL=/bin/sh
CFLAGS	= -I. -O3 
MPICC=mpicc
BSPCC=bspcc
MPIFLAGS =  -lm -O3
BSPBT=bspbt
MPIBT=mpibt
#BT=bt
#BT=gbt
BT=bt
#25, 200,25
#25,180,25L ,100noslot for big prob sizes and 16procs
#25,180,25L ,1noslot   for big prob size and 4procs
#BSPFLAGS =  -flibrary-level 2  -bspnoslots 1\
#          -bspslotsize  25  -bsproundtrip 180\
#          -bspsendlatency 25  -lm
BSPFLAGS =  -flibrary-level 2  -bspnoslots 100\
           -bspslotsize  25  -bsproundtrip 180\
           -bspsendlatency 25  -lm
allbsp	:	${BSPBT}
allmpi	:	${MPIBT}
bspbt	:	${BT}main.o ${BT}.o 
	${BSPCC} ${BSPFLAGS} ${BT}main.o ${BT}.o -o bsp${BT}
	strip   bsp${BT}
#	ccp bsp${BT} run
mpibt	:	m${BT}main.o m${BT}.o 
	${MPICC} ${MPIFLAGS} ${BT}main.o ${BT}.o -o mpi${BT}
	strip   mpi${BT}
#	ccp mpi${BT} run
#
btmain.o:	btmain.c
	${BSPCC} ${CFLAGS} -c  btmain.c
mbtmain.o:	btmain.c
	${MPICC} ${CFLAGS} -c  btmain.c
gbtmain.o:	gbtmain.c
	${BSPCC} ${CFLAGS} -c  gbtmain.c
mgbtmain.o:	gbtmain.c
	${MPICC} ${CFLAGS} -c  gbtmain.c
#
bt.o:	bt.c
	${BSPCC} ${CFLAGS} -c  bt.c
mbt.o:	bt.c
	${MPICC} ${CFLAGS} -c  bt.c
#
gbt.o:	gbt.c
	${BSPCC} ${CFLAGS} -c  gbt.c
mgbt.o:	gbt.c
	${MPICC} ${CFLAGS} -c  gbt.c
#
clean:
	rm -f *.o bspbt mpibt   bspgbt mpigbt 
tar:
	tar cvf bspbt02.tar ai.h aimpi.h bt.c bt.h btmain.c \
		btread.rdm copy gbt.c gbtmain.c \
		gdata Makefile mdata README
