# 	ECO: Efficient Collective Operations
# 	Beta release 0.1b
# 	Bruce Lowekamp and Adam Beguelin	
# 	School of Computer Science
# 	Carnegie Mellon University
# 	Pittsburgh, PA 15213
# 
# 	(C) 1996 All Rights Reserved
# 
# NOTICE:
# 
#  Permission to use, copy, modify, and distribute this software and
#  its documentation for any purpose and without fee is hereby granted
#  provided that the above copyright notice appear in all copies and
#  that both the copyright notice and this permission notice appear in
#  supporting documentation.
# 
#  Neither Carnegie Mellon University nor the Authors make any
#  representations about the suitability of this software for any
#  purpose.  This software is provided ``as is'' without express or
#  implied warranty.
# 
#  This research is sponsored in part by the Department of Defense
#  Advanced Research Projects Agency and the National Science
#  Foundation.


#
# targets:
#   c: C version of ECO
#   ct: C test program
#   C++: C++ version of ECO
#   C++t: C++ test program
#
#   a: network analysis
#   p: network partitioning
#
#   b: benchmarking programs
#
#  default: c ct a p

#
# location to put ECO executables.  Note that PVM_ARCH will be appended
# to this path
PVM_BIN=$(HOME)/pvm3/bin
#PVM_BIN=$(PVM_ROOT)/bin

OPT=-g

default: c ct a p

all: c ct a p

c:
	@ echo "building C version in src"
	cd src; $(PVM_ROOT)/lib/aimk OPT=$(OPT) PVM_BIN=$(PVM_BIN) libeco.a
	@ echo "C base build complete"

ct: c
	@ echo "building C test program in src"
	cd src; $(PVM_ROOT)/lib/aimk OPT=$(OPT) PVM_BIN=$(PVM_BIN) eco_test
	@ echo "C test program complete"

C++:
	@ echo "building C++ version in eco++/src"
	cd eco++/src; $(PVM_ROOT)/lib/aimk OPT=$(OPT) PVM_BIN=$(PVM_BIN) libeco++.a
	@ echo "C++ base build complete"

C++t: C++
	@ echo "building C++ test program"
	cd eco++/src; $(PVM_ROOT)/lib/aimk OPT=$(OPT) PVM_BIN=$(PVM_BIN) eco++_test
	@ echo "C++ test program complete"

a:
	@ echo "building network analysis program"
	cd src; $(PVM_ROOT)/lib/aimk OPT=$(OPT) PVM_BIN=$(PVM_BIN) eco_netanal
	@ echo "ECO network analysis program complete"

p:
	@ echo "building network partitioning program"
	cd src; $(PVM_ROOT)/lib/aimk OPT=$(OPT) PVM_BIN=$(PVM_BIN) eco_partition
	@ echo "network partitioning program complete"

b:
	@ echo "building library benchmarking programs"
	cd src; $(PVM_ROOT)/lib/aimk OPT=$(OPT) PVM_BIN=$(PVM_BIN) eco_bench pvm_bench
	@ echo "benchmarking routines complete"


clean:
	@ echo "cleaning in src"
	cd src; $(PVM_ROOT)/lib/aimk OPT=$(OPT) clean
	@ echo "src cleaned"

clean++:
	@ echo "cleaning in eco++"
	cd eco++;$(PVM_ROOT)/lib/aimk OPT=$(OPT) clean
	@ echo "eco++ cleaned"

