# Aleph Toolkit
#
# Copyright 1999, Brown University, Providence, RI.
# 
#                         All Rights Reserved
# 
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose other than its incorporation into a
# commercial product is hereby granted without fee, provided that the
# above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of Brown University not be used in
# advertising or publicity pertaining to distribution of the software
# without specific, written prior permission.
# 
# BROWN UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ANY
# PARTICULAR PURPOSE.  IN NO EVENT SHALL BROWN UNIVERSITY BE LIABLE FOR
# ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

ALEPH_VERSION = aleph1.1.0

.SUFFIXES: .java .class
#FLAGS = -g

.java.class:
	javac $(FLAGS) $<

all:	all_aleph all_event all_meter all_comm all_dir all_gui all_tools \
	all_thread all_trans all_examples all_message all_bench
	sync

all_aleph: \
	Aleph.class \
	AlephDebug.class \
	AsynchMessage.class	\
	Barrier.class	\
	Config.class \
	Event.class \
	GlobalObject.class \
	Join.class \
	Message.class	\
	PE.class \
	RemoteThread.class \
	UniqueID.class

all_event: \
	event/EventManager.class \
	event/SimpleEventManager.class

all_meter: \
	meter/Meter.class \
	meter/Counter.class

all_comm: \
	comm/Address.class \
	comm/Client.class \
	comm/CommunicationManager.class \
	comm/Server.class \
	comm/Server_Skel.class \
	all_rmi	\
	all_tcp	\
	all_udp

comm/Server_Skel.class: comm/Server.java
	rmic -keepgenerated -d .. aleph.comm.Server

all_message: \
	comm/message/Stdout.class	

all_rmi:	\
	comm/rmi/Address.class	\
	comm/rmi/CommunicationManager.class	\
	comm/rmi/Delivery.class	\
	comm/rmi/DeliveryImpl.class	\
	comm/rmi/DeliveryImpl_Skel.class

comm/rmi/DeliveryImpl_Skel.class: comm/rmi/DeliveryImpl.java
	rmic  -keepgenerated -d .. aleph.comm.rmi.DeliveryImpl

all_tcp: \
	comm/tcp/CommunicationManager.class \
	comm/tcp/Connection.class

all_udp: \
	comm/udp/AutoConnection.class \
	comm/udp/CommunicationManager.class \
	comm/udp/Connection.class \
	comm/udp/Constants.class \
	comm/udp/Packet.class \
	comm/udp/UDPConnection.class \
	comm/udp/PacketQueue.class

all_dir: 	\
	all_home			\
	all_hybrid			\
	dir/arrow/ArrowDirectory.class

all_home:	\
	dir/home/HomeDirectory.class \
	dir/home/ClientSide.class \
	dir/home/ServerSide.class \
	dir/home/ReleaseRequest.class \
	dir/home/ReleaseResponse.class \
	dir/home/RetrieveRequest.class \
	dir/home/RetrieveResponse.class

all_hybrid:	\
	dir/hybrid/FindMessage.class	\
	dir/hybrid/GrantMessage.class	\
	dir/hybrid/HybridDirectory.class\
	dir/hybrid/ReleaseMessage.class	\
	dir/hybrid/Status.java

all_gui:	\
	gui/AboutDialog.class		\
	gui/Batch.class		\
	gui/CommandPanel.class		\
	gui/Console.class		\
	gui/ControlPanel.class		\
	gui/ErrorDialog.class		\
	gui/FileMenu.class		\
	gui/HelpMenu.class		\
	gui/HostDialog.class		\
	gui/HostMenu.class		\
	gui/ManagerPanel.class		\
	gui/PanedWindow.class		\
	gui/PropertiesDialog.class	\
	gui/RuntimeMenu.class		\
	gui/RuntimePanel.class		\
	gui/SingleWindow.class		\
	gui/State.class

all_tools:	\
	tools/KillServers.class	\
	tools/PingServers.class \
	tools/StartServers.class	\
	tools/Terminator.class

all_thread:	\
	thread/MessageQueue.class \
	thread/Scheduler.class

all_trans: \
	trans/TransactionManager.class	\
	trans/SimpleTransactionManager.class

all_examples:	\
	examples/BigCounter.class	\
	examples/Counter.class	\
	examples/Hello.class \
	examples/HelloFunction.class \
	examples/Matrix.class	\
	examples/Queens.class	\
	examples/StopMe.class	\
	examples/TSP.class	\
	examples/cholesky/Cholesky.class	\
	examples/barneshut/BarnesHut.class	\
	all_ray

all_ray:	\
	examples/ray/RayTracer.class \
	examples/ray/World.class

all_bench:	\
	bench/Counter.class	\
	bench/RoundTrip.class	\
	bench/AsynchRoundTrip.class	\
	bench/NullThread.class	\
	all_bench_rmi

all_bench_rmi:	\
	bench/rmi/Client.class	\
	bench/rmi/Message.class	\
	bench/rmi/Server.class	\
	bench/rmi/Server_Skel.class

bench/rmi/Server_Skel.class: bench/rmi/Server.java
	rmic -keepgenerated -d .. aleph.bench.rmi.Server

javadoc:
	rm -f doc/aleph.*.html
	javadoc -d doc aleph aleph.comm aleph.comm.udp aleph.comm.tcp \
	aleph.dir aleph.dir.arrow aleph.dir.home aleph.gui aleph.meter \
	aleph.thread aleph.tools aleph.trans aleph.examples

clean:
	rm -f *~ *\# *.class *_Stub.java *_Skel.java WS_FTP.LOG 
	rm -f */*~ */*\# */*.class */*_Stub.java */*_Skel.java */WS_FTP.LOG
	rm -f */*/*~ */*/*\# */*/*.class  */*/*_Stub.java  */*/*_Skel.java */*/WS_FTP.LOG
	rm -f */*/*/*~ */*/*/*\# */*/*/*.class  */*/*/*_Stub.java  */*/*/*_Skel.java */*/*/WS_FTP.LOG
	rm -f logs/*
	rm -f doc/aleph.*.html
	rm -f doc/Package-aleph.*.html

release: clean
	rm -f *.tar.gz
	rm -f *.tar
	cd ..; tar cvf - aleph | gzip > $(ALEPH_VERSION).tar.gz; cd ./aleph


