# Makefile for Great Manga Application Onidzuka
#
# There are three tasks for this Makefile;
#
# 1.  Make GMAOGUI with all dependencies.  Not hard, since Java
#     does the hard work for us in dependency analysis
#
# 2.  Make GMAOServer / stub classes for server.
#     Also not too hard
#
# 3.  Make GMAOServer.jar that includes GMAOGUI and GMAOServer
#     along with images and stuff.
#
# 4.  For a production run, sign the .jar and copy it to the production
#     location

# Assuming that we have all the right java tools on the path

# Set up the classpath
CLASSPATH="/home/devans/GMAO2k/GMAODocs.jar:/home/devans/GMAO2k/lib/jnlp.jar:/home/devans/GMAO2k:/home/devans/GMAO2k/lib/jfreechart-0.9.3.jar:/home/devans/GMAO2k/lib/jcommon-0.7.0.jar:/home/devans/GMAO2k/lib/skinlf.jar:/home/devans/GMAO2k/lib/helpgui-1.1.jar:/home/devans/GMAO2k/lib/TableLayout.jar"
RUNCLASSPATH="/home/devans/GMAO2k/GMAO.jar:/home/devans/GMAO2k/GMAODocs.jar:/home/devans/GMAO2k/lib/jnlp.jar:/home/devans/GMAO2k:/home/devans/GMAO2k/lib/jfreechart-0.9.3.jar:/home/devans/GMAO2k/lib/jcommon-0.7.0.jar:/home/devans/GMAO2k/lib/skinlf.jar:/home/devans/GMAO2k/lib/helpgui-1.1.jar:/home/devans/GMAO2k/lib/TableLayout.jar"
JAVA="/opt/jdk1.5.0_04/bin/java"
# JAVA="/usr/java/j2sdk1.4.2_04/bin/java"
# JAVA="e:/j2sdk1.4.2_02/bin/java"
JAVAC="/opt/jdk1.5.0_04/bin/javac" -g -classpath ${CLASSPATH} 
# JAVAC="e:/j2sdk1.4.2_02/bin/javac" -g -classpath ${CLASSPATH}
JAR="/opt/jdk1.5.0_04/bin/jar"
RMIC="/opt/jdk1.5.0_04/bin/rmic" 
PRODUCTION_DIR="c:/Inetpub/wwwroot/fugu/software/GMAO/code/bug"

# .SUFFIXES: .java .class
# 
# .java.class: $*.java
# 	$(JAVAC) -classpath $(CLASSPATH) $<

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

GMAO.jar: GMAOGUI GMAOServer GMAO_WhatsNew.html GMAODocs.jar
	mv GMAO.props temp.GMAO.props
	mv jar.GMAO.props GMAO.props
	$(JAR) cfm GMAO.jar GMAO.manifest .
	#/usr/java/j2sdk1.4.2_04/bin/jarsigner -keystore "C:/Documents and Settings/devans/My Documents/.keystore" -keypass IWannaEatFugu -storepass IWannaEatFugu GMAO.jar FuguTabetai
	mv GMAO.props jar.GMAO.props
	mv temp.GMAO.props GMAO.props

GMAODocs.jar: docs/help/toc.xml docs/help/general/*.html docs/help/quickstart/quickStart.html docs/help/tutorial/*.html GMAOHelpFrame.class
	$(JAR) cf GMAODocs.jar docs

GMAOGUI: GMAOGUI.class $(wildcard *.class)

GMAOServer: GMAOServer.class MangaMetaInfo.class GMAOHTMLExport.class GMAOHTMLExportOverlib.class GMAOServerOptions.class GMAOServerMangaDocumentInfoGUI.class SpringUtilities.class 
# $(RMIC) -vcompat -g -depend -d . GMAOServer

# Make clean.  Remove .class files, GMAO.jar
clean: 
	rm *.class GMAO.jar

production: GMAO.jar
	cp GMAO.jar $(PRODUCTION_DIR)

# Rule to make all class files from java files
# %.class : %.java
# 	$(JAVAC) -g $<

all:	GMAOGUI GMAOServer JAR

run: GMAOGUI.class
	LC_CTYPE=ja_JP.UTF-8 XMODIFIERS="@im=htt" $(JAVA) -classpath $(RUNCLASSPATH) -Xmx256m GMAOGUI
#	$(JAVA) -classpath $(RUNCLASSPATH) -Xmx256m GMAOGUI


