File: GNUmakefile

package info (click to toggle)
gdal 1.10.1+dfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 84,320 kB
  • ctags: 74,726
  • sloc: cpp: 677,199; ansic: 162,820; python: 13,816; cs: 11,163; sh: 10,446; java: 5,279; perl: 4,429; php: 2,971; xml: 1,500; yacc: 934; makefile: 494; sql: 112
file content (85 lines) | stat: -rw-r--r-- 2,310 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85


include ../../GDALmake.opt
include java.opt

all: build

BINDING = java
include ../SWIGmake.base

SHORT_NAME = $(subst _wrap,,$*)
SWIGARGS += -outdir "org/gdal/$(SHORT_NAME)" -package "org.gdal.$(SHORT_NAME)"

EXTRA_DIST = org

LINK = $(LD_SHARED)
LINK_EXTRAFLAGS = 
OBJ_EXT = o
ifeq ($(HAVE_LIBTOOL),yes)
LINK = $(LD)
LINK_EXTRAFLAGS = -rpath $(INST_LIB) -no-undefined -version-info $(LIBGDAL_CURRENT):$(LIBGDAL_REVISION):$(LIBGDAL_AGE)
OBJ_EXT = lo
endif

.PHONY: makedir
makedir:
	mkdir -p org/gdal/gdal
	mkdir -p org/gdal/gdalconst
	mkdir -p org/gdal/ogr
	mkdir -p org/gdal/osr


JAVA_MODULES = libgdaljni.$(SO_EXT) libogrjni.$(SO_EXT) libgdalconstjni.$(SO_EXT) libosrjni.$(SO_EXT)
JAVA_OBJECTS = gdalconst_wrap.$(OBJ_EXT) gdal_wrap.$(OBJ_EXT) osr_wrap.$(OBJ_EXT) ogr_wrap.$(OBJ_EXT)

clean:
	-rm -f ${JAVA_MODULES}
	-rm -f *.$(OBJ_EXT)
	ant clean

veryclean: clean
	-rm -f ${WRAPPERS}
	-rm -rf ${EXTRA_DIST}/*

generate: makedir ${WRAPPERS}
  
build: generate ${JAVA_OBJECTS} ${JAVA_MODULES}
ifeq ($(HAVE_LIBTOOL),yes)
	-cp ./.libs/*.so ./
endif
	ant

install: generate
	@echo "No installation to be done"

JAVA_RUN = java -Djava.library.path=. -cp gdal.jar:build/apps

test:
	-rm -rf tmp_test
	mkdir tmp_test
	cp  test_data/byte.tif tmp_test
	${JAVA_RUN} GDALOverviews tmp_test/byte.tif "NEAREST" 2 4
	${JAVA_RUN} gdalinfo -checksum tmp_test/byte.tif
	${JAVA_RUN} ogr2ogr tmp_test/out.shp test_data/poly.shp -progress -overwrite
	${JAVA_RUN} ogrinfo -ro -al tmp_test/out.shp
	${JAVA_RUN} OSRTransform
	${JAVA_RUN} gdalmajorobject
	${JAVA_RUN} GDALTestIO
	${JAVA_RUN} GDALContour -i 1 tmp_test/byte.tif tmp_test/contour.shp
	${JAVA_RUN} testgetpoints
	${JAVA_RUN} ogrtindex tmp_test/contour_index.shp tmp_test/contour.shp

$(JAVA_MODULES): lib%jni.$(SO_EXT): %_wrap.$(OBJ_EXT)
	$(LINK) $(LDFLAGS) $(CONFIG_LIBS) $< -o $@ $(LINK_EXTRAFLAGS)

# Do not remove -fno-strict-aliasing while SWIG generates weird code in upcast methods
# See http://trac.osgeo.org/gdal/changeset/16006
%.$(OBJ_EXT): %.cpp
	$(CXX) -fno-strict-aliasing $(CFLAGS) $(CPPFLAGS) $(GDAL_INCLUDE) $(JAVA_INCLUDE) -c $<

%.$(OBJ_EXT): %.cxx
	$(CXX) -fno-strict-aliasing $(CFLAGS) $(CPPFLAGS) $(GDAL_INCLUDE) $(JAVA_INCLUDE) -c $<

%.$(OBJ_EXT): %.c
	$(CC) -fno-strict-aliasing $(CFLAGS) $(CPPFLAGS) $(GDAL_INCLUDE) $(JAVA_INCLUDE) -c $<