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

# Use the value of the NETSCAPE environment variable
# NETSCAPE=C:\Program Files\Netscape

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

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

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

SOURCE=MathematicaCommandLine.java
TARGET=*.class

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

RM=erase

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

all:    axtarget makesign nptarget

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

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

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

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

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