# copyright (c) 1997,1998 stephen f. white
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

SHELL = /bin/sh

JAVAC = javac
JFLAGS =  -classpath /usr/local/lib/netscape/java_301:/usr/CosmoPlayer/classes:/usr/java/classes:.
# JFLAGS = 

.SUFFIXES:	.java .class

.java.class:
	$(JAVAC) $(JFLAGS) $<

JSAIONLYCLASSES = \
	JSAISceneInterface.class \
	TalkerFrame.class \
	JSAIObject.class \
	Alert.class \
	FontChooser.class \
	Icon.class

EAIONLYCLASSES = \
	EAISceneInterface.class \
	EAIObject.class

COMMONCLASSES = \
	Dispatcher.class \
	SceneInterface.class \
	TalkerPanel.class \
	BorderPanel.class \
	JanneButton.class \
	Message.class \
	MessageQueue.class \
	UserList.class \
	UserListObserver.class \
	UnsupportedFieldTypeException.class \
	VIP.class \
	VRMLObject.class \
	VRMLObjectObserver.class \
	ClientThreadObserver.class \
	ClientThread.class \
	WriterThread.class \
	WriterThreadObserver.class \
	VFieldInputStream.class \
	VFieldOutputStream.class \
	VField.class \
	VMFString.class \
	VSFBool.class \
	VSFRotation.class \
	VSFString.class \
	VSFVec3f.class

UNUSEDCLASSES = \
	VMFColor.class \
	VMFFloat.class \
	VMFInt32.class \
	VMFRotation.class \
	VMFVec2f.class \
	VMFVec3f.class \
	VSFColor.class \
	VSFFloat.class \
	VSFImage.class \
	VSFInt32.class \
	VSFTime.class \
	VSFVec2f.class

TEXTONLYCLASSES = \
	TextSceneInterface.class

EAICLASSES = $(EAIONLYCLASSES) $(COMMONCLASSES)

JSAICLASSES = $(JSAIONLYCLASSES) $(COMMONCLASSES)

TEXTCLASSES = $(TEXTONLYCLASSES) $(COMMONCLASSES)

ALLCLASSES = $(JSAIONLYCLASSES) $(EAIONLYCLASSES) $(TEXTONLYCLASSES) \
	     $(COMMONCLASSES)

DISTFILES = $(ALLCLASSES:.class=.java) \
	    $(UNUSEDCLASSES:.class=.java) \
	    $(ALLCLASSES) \
	    EAIVNet.zip \
	    TextVNet.zip \
	    Makefile \
	    COPYING \
	    README \
	    CHANGES \
	    Simple.wrl \
	    TinMan.wrl \
	    Angel.wrl \
	    kiwano.wrl \
	    halfmoon.wrl \
	    EAISimple.wrl \
	    EAIVNet.html \
	    index.html \
	    TextVNet.html \
	    TestApplet.html

TARGETS = EAIVNet.zip TextVNet.zip $(ALLCLASSES)

targets:  $(TARGETS)

EAIVNet.zip:	$(EAICLASSES)
	zip -0 EAIVNet.zip $(EAICLASSES)

EAIVNet.jar:	$(EAICLASSES)
	jar cvf EAIVNet.jar $(EAICLASSES)

TextVNet.zip: $(TEXTCLASSES)
	zip -0 TextVNet.zip $(TEXTCLASSES)

TextVNet.jar:		$(TEXTCLASSES)
	jar cvf TextVNet.jar $(TEXTCLASSES)

clean:
	rm -f $(TARGETS) $(UNUSEDCLASSES)

dist:	$(DISTFILES)
	pwd | sed 's|.*/||' > .dname
	rm -rf `cat .dname`
	mkdir `cat .dname`
	ln $(DISTFILES) `cat .dname`
	tar cf - `cat .dname` | gzip > `cat .dname`.tar.gz
	rm -rf `cat .dname` .dname

zipdist:	$(DISTFILES)
	pwd | sed 's|.*/||' > .dname
	rm -rf `cat .dname` `cat .dname`.zip
	mkdir `cat .dname`
	ln $(DISTFILES) `cat .dname`
	zip -r `cat .dname`.zip `cat .dname`
	rm -rf `cat .dname` .dname

