1
2include ../GDALmake.opt
3
4include ./file.lst
5
6INST_H_FILES	=	ogr_core.h ogr_feature.h ogr_geometry.h ogr_p.h \
7		ogr_spatialref.h ogr_srs_api.h ogrsf_frmts/ogrsf_frmts.h \
8		ogr_featurestyle.h ogr_api.h ogr_geocoding.h
9
10ifeq ($(HAVE_GEOS),yes)
11CPPFLAGS 	:=	-DHAVE_GEOS=1 $(GEOS_CFLAGS) $(CPPFLAGS)
12endif
13
14ifeq ($(OGR_ENABLED),yes)
15CXXFLAGS 	:=	-DHAVE_MITAB $(CXXFLAGS)
16endif
17
18ifeq ($(HAVE_EXPAT),yes)
19CPPFLAGS 	:=	-DHAVE_EXPAT $(EXPAT_INCLUDE) $(CPPFLAGS)
20endif
21
22ifeq ($(LIBZ_SETTING),internal)
23ZLIB_XTRA_OPT =      -I../frmts/zlib
24else
25ZLIB_XTRA_OPT =
26endif
27
28CPPFLAGS	:=	-Iogrsf_frmts -Iogrsf_frmts/mem -I.  $(PROJ_INCLUDE) $(PROJ_FLAGS) $(CPPFLAGS) $(ZLIB_XTRA_OPT)
29
30default:	lib
31
32all:	lib
33
34clean:
35	rm -f html/*
36	(cd ogrsf_frmts; $(MAKE) clean)
37	$(RM) *.o
38
39very-clean: clean
40	rm -rf html rtf
41
42lib:	sublibs $(OBJ:.o=.$(OBJ_EXT))
43
44$(OBJ): ogr_feature.h ogr_geometry.h swq.h
45
46obj:	$(OBJ)
47
48ifeq ($(OGR_ENABLED),yes)
49
50sublibs:
51	(cd ogrsf_frmts; $(MAKE))
52
53else
54
55sublibs:
56	(cd ogrsf_frmts/mitab; $(MAKE))
57	(cd ogrsf_frmts/generic; $(MAKE))
58
59endif
60
61docs:
62	echo "This target does not exist anymore. Use top-level"
63
64install-docs:
65	echo "This target does not exist anymore. Use top-level"
66
67gdalso:	$(GDAL_SLIB)
68
69$(GDAL_SLIB):
70	(cd ..; $(MAKE) check-lib)
71
72web-update:	docs
73	echo "This target does not exist anymore. Use top-level"
74
75install:
76	for f in $(INST_H_FILES) ; \
77	    do $(INSTALL_DATA) $$f $(DESTDIR)$(INST_INCLUDE) ; \
78	done
79
80# The sed substition below workarounds a bug with gcc 4.1 -O2 (checked on 64bit platforms)
81# that produces buggy compiled code.
82# Seen on gcc 4.1.2-27ubuntu1 (Ubuntu 10.04) (not the default compiler) and gcc-4.1.2-48.el5 (CentOS 5.5)
83# (default compiler...)
84# The memset isn't necessary at all with a non-buggy compiler, but I've found
85# that it helps gcc 4.1 generating correct code here...
86parser:
87	bison -p swq -d -oswq_parser.cpp swq_parser.y
88	sed "s/yytype_int16 yyssa\[YYINITDEPTH\];/yytype_int16 yyssa[YYINITDEPTH]; \/\* workaround bug with gcc 4.1 -O2 \*\/ memset(yyssa, 0, sizeof(yyssa));/" < swq_parser.cpp > swq_parser.cpp.tmp
89	mv swq_parser.cpp.tmp swq_parser.cpp
90
91osr_cs_wkt_parser:
92	bison --no-lines -p osr_cs_wkt_ -d -oosr_cs_wkt_parser.c osr_cs_wkt_grammar.y
93