top_builddir = $(GDAL_ROOT) # # the library can be built by the native build or with the help of libtool # HAVE_LIBTOOL = yes LIBTOOL = $(SHELL) $(top_builddir)/libtool ifeq ($(HAVE_LIBTOOL),yes) LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile LIBTOOL_LINK = $(LIBTOOL) --mode=link LIBTOOL_INSTALL = $(LIBTOOL) --mode=install LIBTOOL_FINISH = $(LIBTOOL) --mode=finish --silent LIBTOOL_CLEAN = $(LIBTOOL) --mode=clean else LIBTOOL_FINISH = /bin/true endif CC = $(LIBTOOL_COMPILE) gcc CXX = $(LIBTOOL_COMPILE) g++ LD = $(LIBTOOL_LINK) g++ RM = $(LIBTOOL_CLEAN) /bin/rm -f *.lo INSTALL = $(LIBTOOL_INSTALL) $(GDAL_ROOT)/install-sh -c INSTALL_LIB = $(LIBTOOL_INSTALL) $(GDAL_ROOT)/install-sh -c INSTALL_DATA = $(GDAL_ROOT)/install-sh -c -m 0644 INSTALL_DIR = $(GDAL_ROOT)/install-sh -d #Flags to build optimized relese version CXX_OPTFLAGS = -O2 C_OPTFLAGS = -O2 # Flags to build debug version CXX_DBGFLAGS = -g -DDEBUG C_DBGFLAGS = -g -DDEBUG # Flags to build profiling version CXX_PROFFLAGS = -g3 -pg -DDEBUG C_PROFFLAGS = -g3 -pg -DDEBUG LIBS = -ljpeg -lpng -L/usr/lib -lpq -lz -lm -lrt -ldl PYTHON_INCLUDES = -I/usr/include/python2.2 -I/usr/include/python2.2 PYTHON_LIBS = PYTHON_CFLAGS = -fPIC $(OPT) PYTHON = python PY_LD_SHARED = $(LD_SHARED) PY_SO_EXT = $(SO_EXT) HAVE_OGDI = no OGR_ENABLED = yes prefix = /usr/local/mapguideopensource exec_prefix = ${prefix} INST_PREFIX = ${prefix} INST_INCLUDE = ${prefix}/include INST_DATA = ${prefix}/share/gdal INST_LIB = ${exec_prefix}/lib INST_BIN = ${exec_prefix}/bin INST_PYMOD = /usr/lib/python2.2/site-packages INST_DOCS = ${prefix}/doc INST_MAN = ${prefix}/man # # Whether we use debug flags, or optimization is determined by # the CFG environment variable. Set to debug for debug builds. # This is similar to the OGDI builds. # ifneq (,$(findstring debug,$(CFG))) C_ODFLAGS = $(C_DBGFLAGS) CXX_ODFLAGS = $(CXX_DBGFLAGS) endif ifneq (,$(findstring gprof,$(CFG))) C_ODFLAGS = $(CXX_PROFFLAGS) CXX_ODFLAGS = $(C_PROFFLAGS) LNK_FLAGS = -pg LIBS := $(filter-out -ldbmalloc,$(LIBS)) endif ifeq ($(CFG),) C_ODFLAGS = $(C_OPTFLAGS) CXX_ODFLAGS = $(CXX_OPTFLAGS) LIBS := $(filter-out -ldbmalloc,$(LIBS)) endif CPPFLAGS = -I$(GDAL_ROOT)/port CFLAGS = -Wall $(C_ODFLAGS) $(USER_DEFS) CXXFLAGS = -Wall $(CXX_ODFLAGS) $(USER_DEFS) RANLIB = ranlib SO_EXT = LD_SHARED = EXE = ifeq ($(notdir $(LD_SHARED)),true) HAVE_LD_SHARED = no else HAVE_LD_SHARED = yes endif GDAL_INCLUDE = -I$(GDAL_ROOT)/port -I$(GDAL_ROOT)/gcore \ -I$(GDAL_ROOT)/alg \ -I$(GDAL_ROOT)/ogr -I$(GDAL_ROOT)/ogr/ogrsf_frmts # libtool targets and help variables LIBGDAL := $(GDAL_ROOT)/libgdal.la LIBGDAL_CURRENT := 9 LIBGDAL_REVISION := 0 LIBGDAL_AGE := 8 # native build targets and variables GDAL_VER = 1.3.0 GDAL_LIB = $(GDAL_ROOT)/libgdal.a GDAL_SLIB = $(GDAL_ROOT)/libgdal.$(SO_EXT) GDAL_SLIB_LINK = -L$(GDAL_ROOT) -lgdal # # OGR/PostgreSQL support. # HAVE_OGR_PG = yes PG_INC = -I/usr/include # # MySQL support. # HAVE_MYSQL = no MYSQL_LIB = MYSQL_INC = LIBS += $(MYSQL_LIB) # # HDF4 Support. # HDF4_INCLUDE = -I$(GDAL_ROOT)/ogr # # HDF5 Support. # HAVE_HDF5 = no HDF5_INCLUDE = # # DODS Include file location # DODS_INC = ifeq ($(DODS_INC),) HAVE_DODS = no else HAVE_DODS = yes endif # # SQLite # SQLITE_INC = HAVE_SQLITE = no # # JPEG2000 via Kakadu Support. # KAKDIR = # # JPEG-2000 Support via JasPer library. # HAVE_JASPER = no JASPER_INCLUDE = -I../libjasper/include JASPER_FLAGS = # # MrSID support via LizardTech's DSDK # MRSID_FLAGS = MRSID_INCLUDE = # # Xerces C++ XML Parser for GML. # HAVE_XERCES = no XERCES_INCLUDE = # # Oracle Spatial Support # HAVE_OCI = no OCI_INCLUDE = # GEOS Support HAVE_GEOS = no GEOS_INC = # GRASS Support GRASS_SETTING = no GRASS_INCLUDE = GRASS_GISBASE = HAVE_GRASS = no # # FMEObjects # ifeq (,) HAVE_FME = no FME_INCLUDE = else HAVE_FME = yes FME_INCLUDE = -I/fmeobjects/cpp endif OGDI_INCLUDE = PNG_SETTING = external JPEG_SETTING = external TIFF_SETTING = internal GEOTIFF_SETTING = internal GIF_SETTING = internal FITS_SETTING = no OGDI_SETTING = no ODBC_SETTING = no NETCDF_SETTING = no LIBZ_SETTING = external # # PROJ.4 stuff # PROJ_STATIC = no ifeq ($(PROJ_STATIC),yes) PROJ_FLAGS = -DPROJ_STATIC endif PROJ_INCLUDE = GDAL_LIBS = $(GDAL_LIB) ifeq ($(OGR_ENABLED),yes) GDAL_LIBS := $(GDAL_LIB) $(OCI_LIB) $(GDAL_LIBS) endif # # Note these codes have to exactly match the format directory names, # and their uppercase form should be the format portion of the # format registration entry point. eg. gdb -> GDALRegister_GDB(). # GDAL_FORMATS = gxf gtiff hfa aigrid aaigrid ceos ceos2 iso8211 xpm \ sdts raw dted mem jdem envisat elas fit vrt usgsdem l1b \ nitf bmp pcidsk airsar rs2 ilwis rmf \ bsb gif jpeg png # # CONFIG_LIBS is what local program should link against, and CONFIG_LIBS_INS # is what will be emitted into the gdal-config script that is installed # globally. # ifeq ($(HAVE_LIBTOOL), yes) CONFIG_LIBS = $(LIBGDAL) CONFIG_LIBS_INS = -L$(INST_LIB) -lgdal EXE_DEP_LIBS = $(LIBGDAL) SO_EXT = la else ifeq ($(HAVE_LD_SHARED),yes) CONFIG_LIBS = $(GDAL_SLIB_LINK) $(LIBS) CONFIG_LIBS_INS = -L$(INST_LIB) -lgdal EXE_DEP_LIBS = $(GDAL_SLIB) else CONFIG_LIBS = $(GDAL_LIBS) $(LIBS) CONFIG_LIBS_INS = $(foreach LF,$(GDAL_LIBS),$(INST_LIB)/$(notdir $(LF)))\ $(LIBS) EXE_DEP_LIBS = $(GDAL_LIB) endif endif # HAVE_LIBTOOL # # generic library rules # # # gdal and ogr low level drivers use the following default rules in order to # populate the ../o/ directory with all object and library object files # O_OBJ = $(foreach file,$(OBJ),../o/$(file)) ../o/%.o: %.c $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< ../o/%.o: %.cpp $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< %.o: %.c $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< %.o: %.cpp $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< # # default rules for handling subdirectories # %-target: $(MAKE) -C $* %-clean: $(MAKE) -C $* clean