1GDAL_ROOT	=	..\..
2
3!INCLUDE $(GDAL_ROOT)\nmake.opt
4
5!IF "$(DLLBUILD)" == "1"
6GDALLIB	=    $(GDAL_ROOT)\$(GDAL_LIB_NAME)
7!ELSE
8GDALLIB	=    $(GDAL_ROOT)\$(GDAL_LIB_NAME) $(EXTERNAL_LIBS)
9!ENDIF
10
11JAVA_RUN = $(JAVA) -Djava.library.path=. -cp gdal.jar;build\apps
12
13OBJ = gdal_wrap.obj gdalconst_wrap.obj ogr_wrap.obj osr_wrap.obj gnm_wrap.obj
14
15all:  jniall
16	set JAVA_HOME="$(JAVA_HOME)"
17	$(ANT_HOME)\bin\ant
18
19install:
20	-mkdir $(GDAL_HOME)\java\jar
21	-mkdir $(GDAL_HOME)\java\src
22	-mkdir $(GDAL_HOME)\java\src\org
23	-mkdir $(GDAL_HOME)\java\src\apps
24	$(INSTALL)    *.dll  $(GDAL_HOME)\bin
25	$(INSTALL)    *.jar  $(GDAL_HOME)\java\jar
26	$(INSTALL)    *.java $(GDAL_HOME)\java\src
27	$(INSTALL) /e org    "$(GDAL_HOME)\java\src\org\"
28	$(INSTALL) /e apps   "$(GDAL_HOME)\java\src\apps\"
29
30jniall:
31	cd ogr
32	$(MAKE) /f makefile.vc
33	cd ..
34	cd gnm
35	$(MAKE) /f makefile.vc
36	cd ..
37	cd gdal
38	$(MAKE) /f makefile.vc
39	cd ..
40	cd const
41	$(MAKE) /f makefile.vc
42	cd ..
43	cd osr
44	$(MAKE) /f makefile.vc
45	cd ..
46	link $(OBJ) $(GDALLIB) /out:gdalalljni.dll /DLL
47 	if exist gdaljniall.dll.manifest mt -manifest gdaljniall.dll.manifest -outputresource:gdalalljni.dll;2
48
49test:
50	if exist tmp_test rmdir /s /q tmp_test
51	mkdir tmp_test
52	copy  test_data\byte.tif tmp_test
53	$(JAVA_RUN) GDALOverviews tmp_test/byte.tif "NEAREST" 2 4
54	$(JAVA_RUN) gdalinfo -checksum tmp_test/byte.tif
55	$(JAVA_RUN) ogr2ogr tmp_test/out.shp test_data/poly.shp -progress -overwrite
56	$(JAVA_RUN) ogrinfo -ro -al tmp_test/out.shp
57	$(JAVA_RUN) OSRTransform
58	$(JAVA_RUN) gdalmajorobject
59	$(JAVA_RUN) GDALTestIO
60	$(JAVA_RUN) GDALContour -i 1 tmp_test/byte.tif tmp_test/contour.shp
61	$(JAVA_RUN) testgetpoints
62	$(JAVA_RUN) ogrtindex tmp_test/contour_index.shp tmp_test/contour.shp
63	$(JAVA_RUN) OSRTest
64
65clean:
66	if exist org rmdir /s /q org
67	if exist build rmdir /s /q build
68	cd gdal
69	$(MAKE) /f makefile.vc clean
70	cd ..
71	cd ogr
72	$(MAKE) /f makefile.vc clean
73	cd ..
74	cd const
75	$(MAKE) /f makefile.vc clean
76	cd ..
77	cd osr
78	$(MAKE) /f makefile.vc clean
79	cd ..
80	cd gnm
81	$(MAKE) /f makefile.vc clean
82	cd ..
83	-del gdal.jar
84	-del *.dll
85	-del *.obj
86	-del *.exp
87	-del *.ilk
88	-del *.pdb
89	-del *.tlb
90	-del *.snk
91	-del *.cs
92	-del *.cpp
93	-del *.lib
94	-del *.dll.manifest
95