# @(#)GNUmakefile	1.6 97/10/07
#
# Makefile for use on Solaris using gnumake.  It assumes an environment
# variable called JDKHOME is defined.

TOPLEVEL = $(shell echo `pwd`)

ifeq ($(JDKHOME),)
JDKHOME = /usr/local/java/jdk1.1.3/solaris
endif
ifeq ($(SWINGHOME),)
SWINGHOME = $(shell if [ -d ../../../build ] ; then (cd ../../../.. ; echo `pwd`/swing-0.5) else echo `pwd`/../../../swing-0.5 ; fi)
endif
ifeq ($(JACCESSHOME),)
JACCESSHOME = $(shell if [ -d ../../../build ] ; then (cd ../../../build ; echo `pwd`) else echo `pwd`/../.. ; fi)
endif
ifeq ($(CSEP),)
CSEP = :
endif

SWINGJARS=$(SWINGHOME)/swing.jar
JACCESSJARS=$(JACCESSHOME)/jaccess.jar

CLASSPATH = .:$(JACCESSJARS):$(SWINGJARS):$(JDKHOME)/lib/classes.zip

JAVAC = $(JDKHOME)/bin/javac -deprecation -g -classpath '$(subst :,$(CSEP),$(CLASSPATH))'
JAVAC = $(JDKHOME)/bin/javac -deprecation -g -classpath $(CLASSPATH)

FILES = Monkey.class AccessibleNode.class ComponentNode.class

all: $(FILES)
	@echo ""
	@echo "Please NOTE:"
	@echo ""
	@echo "You cannot run Monkey by itself.  Instead, it is meant to"
	@echo "be automatically loaded by the EventQueueMonitor.  To do this "
	@echo "you need to edit $(JDKHOME)/lib/awt.properties"
	@echo "to include the following lines:"
	@echo ""
	@echo "AWT.EventQueueClass=com.sun.java.accessibility.EventQueueMonitor"
	@echo "AWT.AutoLoadClasses=Monkey"
	@echo ""
	@echo "Note also that it is important that your CLASSPATH environment"
	@echo "variable include both the jaccess.jar file and this directory."
	@echo ""
	@echo "For example, you might set your CLASSPATH environment variable"
	@echo "to look like the following:"
	@echo ""
	@echo $(shell pwd):$(subst :,$(CSEP),$(CLASSPATH))
	@echo ""
	@echo ""
	@echo ""

release: all

clean:
	rm -f *.class *~

%.class: %.java
	$(JAVAC) $?
