##############################################################################
#
# makefile - Makefile for the applets
#
##############################################################################

# Use the value of the NETSCAPE environment variable
#
# NETSCAPE=C:\Program Files\Netscape
# NETSCAPE=d:\local\apps\Netscape
# NETSCAPE=E:\winnt_apps\Netscape
#
# Use the value of the JDK environment variable
#
# JDK=E:\winnt_apps\jdk1.2.1\bin
# JDK=D:\local\apps\Sun\jdk1.2.1\bin
#

NPJAR=$(NETSCAPE)\Communicator\Program\Plugins\NpTchExp.zip
NPLIB=$(NETSCAPE)\Communicator\Program\java\classes\java40.jar
NPCP=.;$(NPJAR);$(NPLIB);NpEquationEditor.jar
NPOPT=-classpath "$(NPCP)"
NPOUT=NpConnectEquationEditor.jar

# Use the value of the WINDIR environment variable
# WINDIR=C:\Windows

AXLIB=$(WINDIR)\Java\TrustLib
AXCP=.;$(AXLIB);AxEquationEditor.jar
AXOPT=-cp:p "$(AXCP)"
AXOUT=AxConnectEquationEditor.cab

SOURCE=ConnectEquationEditor.java

TARGET=*.class

JAVAC=$(JDK)\javac -deprecation $(NPOPT)
JVC=jvc -nologo -nomessage -x- $(AXOPT)
JAR=$(JDK)\jar -cf0
CAB=cabarc N

RM=erase

##############################################################################

all:    axtarget makesign nptarget

nptarget:
	@ echo $(JDK)\javac $(SOURCE)
	@$(JAVAC) $(SOURCE)
	$(JAR) $(NPOUT) $(TARGET)
	@ $(RM) $(TARGET)

axtarget:
	@ echo jvc $(SOURCE)
	@ $(JVC) $(SOURCE)
	$(CAB) $(AXOUT) $(TARGET)
	@ $(RM) $(TARGET)

makesign:
	makecert -sk AxConnectEquationEditor -r -n "CN=IBM techexplorer" AxConnectEquationEditor.cer
	cert2spc AxConnectEquationEditor.cer AxConnectEquationEditor.spc
	signcode -j JavaSign.dll -jp Low -spc AxConnectEquationEditor.spc -k AxConnectEquationEditor $(AXOUT)
	$(RM) AxConnectEquationEditor.cer
	$(RM) AxConnectEquationEditor.spc

clean:
	$(RM) $(NPOUT)
	$(RM) $(AXOUT)

##############################################################################
