PREFIX=	/www/scope
INSTALL = install
INSTALL_PROGRAM=${INSTALL} -m 755
INSTALL_DATA=	${INSTALL} -m 644

JYTHON=		jpython
JYTHONC=	jpythonc
JAVACC = 	/usr/bin/javac

# Classes that need to be compiled from Java source code
JAVA_OBJS = ButtonBar.class BrokenConnectionDialog.class \
	gui_util.class  \
	ImageCommentDialog.class \
	ImageEmailDialog.class \
	SimpleBorder.class

PY_FILES = ChatWindow.py ImageDisplay.py ScopeConnection.py \
    ClientWindowListener.py  LoginDialog.py        SettingsPanel.py \
    MatisseMicroscope.py  StatusDisplay.py \
    FocusDisplay.py          MicroscopeApplet.py   __init__.py \
    ImageButton.py           PyClient.py protocols.py

ADDED_CLASSES=/usr/lib/netscape/477/netscape/java/classes/java40.jar:.

# Version for Matisse
#ADDED_CLASSES=/usr/lib/netscape/477/netscape/java/classes/java40.jar:/home/akuchlin/src/matisse/matisse2/java/:/usr/lib/jdk1.1/lib/classes.zip:.


# Rules for compiling class files from Java or Python code
%.class : %.java
	$(JAVACC) -classpath $(ADDED_CLASSES):$$CLASSPATH  $<
%.class : %.py
	$(JYTHONC) $<
#	CLASSPATH=$(ADDED_CLASSES):$$CLASSPATH $(JYTHONC) $<

# Default target will be to build just a JAR file containing the 
# microscope client

all: microscope.jar

# Compile the client code into an unsigned .jar file
microscope.jar: $(JAVA_OBJS) $(PY_FILES) #MatisseMicroscope.class
	CLASSPATH=$(ADDED_CLASSES) \
	$(JYTHONC) -main -core -deep -jar microscope.jar MicroscopeApplet.py
#	zip -f microscope.jar MatisseMicroscope.class

MatisseMicroscope.class: MatisseMicroscope.py

# Install the client code
install: microscope.jar
	$(INSTALL_DATA) $< /www/scope/docroot/ 

# Clean out generated files
clean:
	rm -f *.jar 
	rm -f *.class *.pyc *~
	rm -f out err diff	
