JAVABIN=/usr/java/jsdk/bin
JAVAC=${JAVABIN}/javac
JAR=${JAVABIN}/jar
JARSIGNER=${JAVABIN}/jarsigner
SERVLETCLASSPATH=/usr/local/tomcat/lib:/usr/local/tomcat/lib/common

all:
	# make build        -- Compile the Java into ./out...
	# make install      -- This command will move class files to the appropriate place.
	# make install-jar  -- This command will instead create a jar file for the GUI classes.
	#                      Note: this will only work if you have the Squiz keystore available.
	#                      See rodney@squiz.net or agland@squiz.net
	# make clean        -- Removes any compiled Java


build:
	${JAVAC} -d  ./out/gui -extdirs ${SERVLETCLASSPATH}\
		./gui/*.java
	${JAVAC} -d  ./out/servlet -extdirs ${SERVLETCLASSPATH}\
		./gui/ByteData.java ./servlet/*.java

install:
	cp ./out/gui/*.class ./../
	cp ./out/servlet/*.class ./../WEB-INF/classes/
	# Done !

install-jar:
	(cd ./out/gui/; ${JAR} -cvf jupload_applet.jar *.class)
	${JARSIGNER} ./out/gui/jupload_applet.jar MyCert
	${JARSIGNER} -verify -verbose -certs ./out/gui/jupload_applet.jar
	mv ./out/gui/jupload_applet.jar ./..
	cp ./out/servlet/*.class ./../WEB-INF/classes/
	# Done !

clean:
	rm ./out/gui/*.class
	rm ./out/servlet/*.class
	# Done !
