#
#   FILE: Makefile
# AUTHOR: Matt Chotin (mhc)
#  DESCR: Makefile for NGP
#
# $Id$
#

JAVA_HOME=/pro/java/jdk1.2.2rc1

JAVAC=$(JAVA_HOME)/bin/javac
JAVADOC=$(JAVA_HOME)/bin/javadoc

JCFLAGS=-deprecation -J-Djavac.pipe.output=true -J-mx64m
JCDEBUGFLAGS=-g
JCFINALFLAGS=-O

CHMOD_CLASSES=chmod 664 *.class */*.class

JDOCFLAGS=-J-mx128M
JDOCTITLE=NGP
JDOCHEADER=NGP
JDOCBOTTOM= \
	<FONT SIZE=2>NGP 1.0<BR> \
	Matt Chotin \
	<A HREF="mailto:mhc@cs.brown.edu">&lt;mhc@cs.brown.edu&gt;</A></FONT>
JDOCDESTINATION=/course/cs015/docs/NGP/

RM=/bin/rm -f

PACKAGES= \
	NGP \
	NGP.Components \
	NGP.Containers \
	NGP.Graphics 


all:
	$(JAVAC) *.java */*.java; \
	$(CHMOD_CLASSES)

d : debug
debug:
	$(JAVAC) $(JCDEBUGFLAGS) *.java */*.java; \
	$(CHMOD_CLASSES)

o : optimize
optimize : final
f : final
final:
	$(JAVAC) $(JCFINALFLAGS) *.java */*.java; \
	$(CHMOD_CLASSES)


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

doc: docs
documentation: docs
docs:
	umask 002 ; \
	$(JAVADOC) $(JDOCFLAGS) \
	-windowtitle '$(JDOCTITLE)' \
	-header '$(JDOCHEADER)' \
	-bottom '$(JDOCBOTTOM)' \
	-d $(JDOCDESTINATION) \
	-sourcepath /course/cs015/src/ \
	-overview overview.html \
	-link http://java.sun.com/products/jdk/1.2/docs/api \
	$(PACKAGES)

cleandocs:
	$(RM) -r $(JDOCDESTINATION)*


cleanclasses:
	$(RM) -r *.class */*.class 

cleantilda:
	$(RM) -r *~ */*~ 

clean: cleanclasses cleantilda

zip: 
	cd /course/cs015/src; \
	/cs/bin/zip -r -n class NGP.zip NGP; \
	/usr/bin/mv /course/cs015/lib/NGP.zip /course/cs015/lib/NGP.zip.old; \
	/usr/bin/mv NGP.zip /course/cs015/lib/NGP.zip; \
	/usr/bin/chmod 664 /course/cs015/lib/NGP.zip; \
	cd /pro/web/web/courses/cs015/current/ReferenceGuides/WorkFromHome/Downloads; \
	/usr/bin/rm NGP.zip; \
	/usr/bin/cp /course/cs015/lib/NGP.zip .; \
	/usr/bin/chmod 664 NGP.zip; \
	/usr/local/bin/webupdate NGP.zip;

