# @(#)Makefile	1.13 99/02/19
#
# Build and run a simple GUI demo, showing how one JTree container can
# be driven two different ways by configuring two different sets of
# element types.
#
# The XML sources of the Shakespeare plays are from:
# 	ftp://sunsite.unc.edu/pub/sun-info/standards/xml/eg/
#
# Some other substantial samples of valid XML are also found there.
#

.KEEP_STATE:

# If you're using JDK 1.1 you'll need to specify the path to
# your SWING library directory.  Not necessary with JDK 1.2,
# which includes that version of SWING.

SWING =		/usr/local/java/swing-1.1/

JAVA =	$(JAVA_HOME)/bin/java


# JCFLAGS == javac flags
JCFLAGS = -g -d classes

# CLASSPATH
CPATH =	../../jaxp.jar:../../parser.jar:$(JAVA_HOME)/lib/classes.zip:$(SWING)/swingall.jar

SOURCES = \
	project/PlayElement.java \
	project/ProjectElement.java \
	project/SceneElement.java \
	project/ShowElement.java \
	project/TitledElement.java \
	project/GuiDemo.java
CLASSES = $(SOURCES:%.java=%.class)

#
# By default, just build project jarfile
#
default:
	mkdir -p classes
	javac $(JCFLAGS) -classpath $(CPATH) $(SOURCES)
	cd classes; jar cvf ../project.jar *
	@echo "Try appletviewer on example1.html and example2.html"
	@echo "(over a network connection, so relative URLs work!)"
	@echo "... or try 'make doit1' and 'make doit2'"

doit1:
	@echo 'Showing "Richard III" as raw XML structure'
	java -classpath project.jar:$(CPATH) project.GuiDemo \
		show.props ../samples/rich_iii.xml

doit2:
	@echo 'Showing "Two Gentlemen" as a play'
	java -classpath project.jar:$(CPATH) project.GuiDemo \
		play.props ../samples/two_gent.xml 

#
# scrub-a-dub-dub
#
clean:
	-rm -rf classes Log

