home *** CD-ROM | disk | FTP | other *** search
- ################################################################################
- #### make file for plugins ####
- #
- #
- # Setting in your environment or the command line will determine what you
- # build.
- #
- # JRI_ROOT the root directory for this sdk (i.e. [drive]:\nspi30)
- #
- # JDK_ROOT the root for the java compiler (javac). If not specified
- # defaults to JRI_ROOT
- #
- # DEBUG debug version
- #
- # i.e.
- # nmake -f makefile DEBUG=1 JDK_ROOT=c:\jdk
- #
- # Will create four directory:
- # objs your objects and plugin
- # classes your java classes
- # _gen your headers from java classes
- # _stubs your stubs from java classes
- #
- ################################################################################
-
- # adding java classes and stubs generation rules
- .SUFFIXES : .class .h .java
-
- !if !defined(JRI_ROOT)
- JRI_ROOT = c:\nspi30
- !endif
-
- !if !defined(JDK_ROOT)
- !message assume jdk and jri root directories match
- JDK_ROOT = $(JRI_ROOT)
- !endif
-
- !if "$(OS)" == "Windows_NT"
- NULL=
- !else
- NULL=nul
- !endif
-
- TARGET = npavi32
-
- ################################################################################
- # Objects files
- #
- OBJS = \
- .\objs\avijava.obj \
- .\objs\cavi.obj \
- .\objs\npshell.obj \
- .\objs\npwin.obj \
- .\objs\plgwnd.obj \
- .\objs\AviObserver.obj \
- .\objs\AviPlayer.obj \
- .\objs\netscape_plugin_Plugin.obj
-
- CLASSES = \
- .\classes\AviPlayer.class \
- .\classes\AviObserver.class
-
- GEN = \
- .\_gen\AviObserver.h \
- .\_gen\AviPlayer.h \
-
- STUBS = \
- .\_stubs\AviObserver.c \
- .\_stubs\AviPlayer.c \
-
- RES = \
- .\objs\$(TARGET).res
-
- ZIP = \
- .\_gen\java_lang_Object.h \
- .\_gen\netscape_plugin_Plugin.h \
- .\_stubs\netscape_plugin_Plugin.c
-
- ################################################################################
- # Libraries
- #
- LIBS = \
- WINMM.LIB \
- kernel32.lib \
- user32.lib \
- gdi32.lib \
- comdlg32.lib \
- $(JRI_ROOT)\lib\jrt3221.lib
-
-
- ################################################################################
- # Options and flags
- #
- CPP_INC = /I $(JRI_ROOT)\include /I_gen
- CPP_OPTS = /nologo /W3 /GX /Od /c
- CPP_DEFS = /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /D "_MBCS" /D "XP_PC"
-
- JAVA_CLASSES = -classpath $(JRI_ROOT)\classes\moz3_0.zip;.
-
- LINK_FLAGS = \
- /nologo\
- /entry:"DllEntryPoint"\
- /subsystem:windows\
- /dll\
- /incremental:no\
- /machine:I386\
- /def:$(TARGET).def\
- /out:.\objs\$(TARGET).dll\
- /implib:.\objs\$(TARGET).lib
-
- !if "$(DEBUG)" == "1"
-
- CPP_OPTS = /MDd /Zi $(CPP_OPTS)
- CPP_DEFS = /D "_DEBUG" /D "STRICT" $(CPP_DEFS)
-
- LINK_FLAGS = $(LINK_FLAGS) /DEBUG
-
- !else
-
- CPP_OPTS = /MD $(CPP_OPTS)
- CPP_DEFS = /D "NDEBUG" $(CPP_DEFS)
-
- !endif
-
-
- CPP_FLAGS = $(CPP_OPTS) $(CPP_DEFS) $(CPP_INC)
- RC_OPTS = /l 0x409
-
-
- ################################################################################
- # Tools
- #
- RSC = rc.exe
- CPP = cl.exe
- LINK = link.exe
- JAVAC = $(JDK_ROOT)\bin\javac.exe
- JAVAH = $(JRI_ROOT)\bin\javah.exe # must be the jri version
-
-
- ################################################################################
- # Explicit Rules
- #
-
- all : java .\objs\$(TARGET).dll
-
- dirs :
- if not exist .\classes mkdir classes
- if not exist .\_gen mkdir _gen
- if not exist .\_stubs mkdir _stubs
- if not exist .\objs mkdir objs
-
- java : dirs $(CLASSES) $(ZIP) generate $(GEN) $(STUBS)
- cd ..
-
- generate :
- cd classes
-
- .\objs\$(TARGET).dll : $(TARGET).def $(OBJS) $(RES)
- $(LINK) @<<
- $(LIBS) $(LINK_FLAGS) $(OBJS) $(RES)
- <<
-
- # header and stubs files depending upon the zip file must be explicitly set
- .\_gen\netscape_plugin_Plugin.h : $(JRI_ROOT)\classes\moz3_0.zip
- $(JAVAH) $(JAVA_CLASSES) -jri -d _gen netscape.plugin.Plugin
-
- .\_stubs\netscape_plugin_Plugin.c : $(JRI_ROOT)\classes\moz3_0.zip
- $(JAVAH) $(JAVA_CLASSES) -jri -stubs -d _stubs netscape.plugin.Plugin
-
- .\_gen\java_lang_Object.h : $(JRI_ROOT)\classes\moz3_0.zip
- $(JAVAH) $(JAVA_CLASSES) -jri -d _gen java.lang.Object
-
-
- clean :
- del ".\objs\$(TARGET).dll"
- del ".\objs\$(TARGET).exp"
- del ".\objs\$(TARGET).lib"
- del ".\objs\$(TARGET).res"
- del ".\objs\npshell.obj"
- del ".\objs\npwin.obj"
- del ".\objs\plgwnd.obj"
- del ".\objs\avijava.obj"
- del ".\objs\AviObserver.obj"
- del ".\objs\AviPlayer.obj"
- del ".\objs\cavi.obj"
- del ".\objs\netscape_plugin_Plugin.obj"
-
- del ".\classes\AviPlayer.class"
- del ".\classes\AviObserver.class"
-
- del ".\_gen\AviObserver.h"
- del ".\_gen\AviPlayer.h"
- del ".\_gen\java_lang_Object.h"
- del ".\_gen\netscape_plugin_Plugin.h"
-
- del ".\_stubs\AviObserver.c"
- del ".\_stubs\AviPlayer.c"
- del ".\_stubs\netscape_plugin_Plugin.c"
-
-
- ################################################################################
- # Implicit Rules
- #
- .java{.\classes}.class:
- $(JAVAC) $(JAVA_CLASSES) -d classes $<
-
- {.\classes}.class{.\_gen}.h:
- $(JAVAH) $(JAVA_CLASSES) -jri -d ..\_gen $(*B)
-
- {.\classes}.class{.\_stubs}.c:
- $(JAVAH) $(JAVA_CLASSES) -jri -stubs -d ..\_stubs $(*B)
-
- {.\_stubs}.c{.\objs}.obj:
- $(CPP) $(CPP_FLAGS) $< /Fo$*
-
- .c{.\objs}.obj:
- $(CPP) $(CPP_FLAGS) $< /Fo$*
-
- .cpp{.\objs}.obj:
- $(CPP) $(CPP_FLAGS) $< /Fo$*
-
- .rc{.\objs}.res:
- $(RC) $(RC_FLAGS) /fo $*.res $<
-
-