#
# NMake file for example.dll
#

COPTS   = -W3 -MT -WX
INCLUDES= -I. -Ic:\java\include -Ic:\java\include\win32
LIBS    = c:\java\lib\javai.lib

SOURCE  = Makefile NativeExample.java example.c

example.dll: example.obj NativeExample.obj
	link -DLL -out:example.dll example.obj NativeExample.obj $(LIBS)

example.obj: ..\example.c NativeExample.h java_lang_Integer.h
	cl -c $(COPTS) $(INCLUDES) ..\example.c

NativeExample.obj: NativeExample.c
	cl -c $(COPTS) $(INCLUDES) NativeExample.c

NativeExample.c: NativeExample.class
	javah -stubs NativeExample

NativeExample.h: NativeExample.class
	javah NativeExample

java_lang_Integer.h:
	javah java.lang.Integer

NativeExample.class: ..\NativeExample.java
	javac -d . ..\NativeExample.java

clean:
	del NativeExample.c
	del NativeExample.class 
	del NativeExample.h
	del NativeExample.obj
	del example.dll
	del example.exp
	del example.lib
	del example.obj 
	del java_lang_Integer.h
