# -*- Makefile -*- for emacs.
GDAL_ROOT	=	@abs_top_builddir@
top_builddir	=	$(GDAL_ROOT)

#
# the library can be built by the native build or with the help of libtool
#

SHELL    =   @SHELL@
HAVE_LIBTOOL	=	@HAVE_LIBTOOL@
LIBTOOL	=	@LIBTOOL@
ifeq ($(HAVE_LIBTOOL),yes)
LIBTOOL_COMPILE_CC =	$(LIBTOOL) --mode=compile --silent --tag=CC
LIBTOOL_COMPILE_CXX =	$(LIBTOOL) --mode=compile --silent --tag=CXX
LIBTOOL_LINK	=	$(LIBTOOL) --mode=link --silent
LIBTOOL_INSTALL	=	$(LIBTOOL) --mode=install --silent
LIBTOOL_FINISH	=	$(LIBTOOL) --mode=finish --silent
LIBTOOL_CLEAN	=	$(LIBTOOL) --mode=clean --silent
OBJ_EXT = lo
else
LIBTOOL_FINISH	=	@BINTRUE@
OBJ_EXT = o
endif

CC	=	$(LIBTOOL_COMPILE_CC) @CC@
CXX	=	$(LIBTOOL_COMPILE_CXX) @CXX@
LD	=	$(LIBTOOL_LINK) @CXX@
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

# SDE_LIB needs to be first because it embeds zlib.  We need to use its symbols instead of -lz's

LIBS	=	$(SDE_LIB) @LIBS@ $(KAK_LIBS) $(DWG_LIBS) $(CURL_LIB) \
		$(MRSID_LIBS) $(MRSID_LIDAR_LIBS) $(ECW_LIBS) $(INGRES_LIB) \
		$(PCIDSK_LIB) $(RASDAMAN_LIB) $(SOSI_LIB) \
		$(OPENCL_LIB) $(JVM_LIB) $(LIBICONV) $(FGDB_LIB) $(LIBXML2_LIB) $(MONGODB_LIB) \
		$(JNI_LIB) $(HDFS_LIB)

SSEFLAGS = @SSEFLAGS@
SSSE3FLAGS = @SSSE3FLAGS@
AVXFLAGS = @AVXFLAGS@

PYTHON = @PYTHON@
PY_HAVE_SETUPTOOLS=@PY_HAVE_SETUPTOOLS@

# Next Generation SWIG bindings
BINDINGS	=	@BINDINGS@

HAVE_OGDI = @HAVE_OGDI@
OGR_ENABLED = yes
GNM_ENABLED = @GNM_ENABLED@

OSX_FRAMEWORK_PREFIX = /Library/Frameworks/GDAL.framework
OSX_VERSION_FRAMEWORK_PREFIX = ${OSX_FRAMEWORK_PREFIX}/Versions/@GDAL_VERSION_MAJOR@.@GDAL_VERSION_MINOR@

prefix		=	@prefix@
exec_prefix	=	@exec_prefix@
INST_PREFIX	=	@exec_prefix@
INST_INCLUDE	=	@includedir@
INST_DATA 	=	@datadir@
INST_LIB	=	@libdir@
INST_BIN	=	@bindir@
INST_PYMOD      =       @pymoddir@
INST_DOCS	=	@exec_prefix@/doc
INST_MAN	=	@mandir@
INST_HTML	=	$(HOME)/www/gdal

CPPFLAGS	:= @CPPFLAGS@ -I$(GDAL_ROOT)/port @EXTRA_INCLUDES@ -DGDAL_COMPILATION
CFLAGS		= @CFLAGS@ @C_WFLAGS@ $(USER_DEFS)
CXXFLAGS	= @CXXFLAGS@ @CXX_WFLAGS@ $(USER_DEFS)
CFLAGS_NOFTRAPV          = @CFLAGS_NOFTRAPV@ @C_WFLAGS@ $(USER_DEFS)
CXXFLAGS_NOFTRAPV        = @CXXFLAGS_NOFTRAPV@ @CXX_WFLAGS@ $(USER_DEFS)
CXXFLAGS_NO_LTO_IF_SSSE3_NONDEFAULT           = @CXXFLAGS_NO_LTO_IF_SSSE3_NONDEFAULT@ @CXX_WFLAGS@ $(USER_DEFS)
CXXFLAGS_NO_LTO_IF_AVX_NONDEFAULT           = @CXXFLAGS_NO_LTO_IF_AVX_NONDEFAULT@ @CXX_WFLAGS@ $(USER_DEFS)

NO_UNUSED_PARAMETER_FLAG = @NO_UNUSED_PARAMETER_FLAG@
NO_SIGN_COMPARE = @NO_SIGN_COMPARE@
NO_NON_VIRTUAL_DTOR_FLAG = @NO_NON_VIRTUAL_DTOR_FLAG@
NO_LOGICAL_OP_FLAG = @NO_LOGICAL_OP_FLAG@
WARN_OLD_STYLE_CAST = @WARN_OLD_STYLE_CAST@
WARN_EFFCPLUSPLUS = @WARN_EFFCPLUSPLUS@

# Also available -DAFL_FRIENDLY for strcmp(), etc.. variants that will
# work better with American Fuzzy Lop branch examination logic

# TODO(schwehr): Make these be configure flags.
# CFLAGS += -Werror
# CFLAGS += -std=c11
# CFLAGS += -fsanitize=address
# CFLAGS += -D_FORTIFY_SOURCE=2
# CFLAGS += -fPIE -pie
# CFLAGS += -fstack-protector-all

# CXXFLAGS += -Werror
# CXXFLAGS += -std=c++11
# CXXFLAGS += -fsanitize=address
# CXXFLAGS += -D_FORTIFY_SOURCE=2
# CXXFLAGS += -fPIE -pie
# CXXFLAGS += -fstack-protector-all

LDFLAGS     = @LDFLAGS@
# LDFLAGS += -fsanitize=address

RANLIB		=	@RANLIB@
SO_EXT		=	@SO_EXT@
LD_SHARED	=	@LD_SHARED@
EXE		=       @EXE_EXT@

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 \
                        -I$(GDAL_ROOT)/gnm -I$(GDAL_ROOT)/apps

# libtool targets and help variables
LIBGDAL	:=		libgdal.la
LIBGDAL_CURRENT	:=	25
LIBGDAL_REVISION	:=	3
LIBGDAL_AGE	:=	5

# native build targets and variables
GDAL_VER	=	@GDAL_VER@

# version info
GDAL_VERSION_MAJOR =    @GDAL_VERSION_MAJOR@
GDAL_VERSION_MINOR =    @GDAL_VERSION_MINOR@
GDAL_VERSION_REV   =    @GDAL_VERSION_REV@

GDAL_LIB	= 	$(GDAL_ROOT)/libgdal.a
GDAL_SLIB	=	$(GDAL_ROOT)/libgdal.$(SO_EXT)
GDAL_SLIB_LINK	=	-L$(GDAL_ROOT) -lgdal
#GDAL_SLIB_SONAME = -Wl,-soname,libgdal.$(SO_EXT).@GDAL_VERSION_MAJOR@

# Mac OS X Framework definition
MACOSX_FRAMEWORK = @MACOSX_FRAMEWORK@

#
# GDAL/OGR PostgreSQL support.
#
HAVE_OGR_PG     = @HAVE_PG@
HAVE_POSTGISRASTER  = @HAVE_PG@
PG_INC	=	@PG_INC@

#
# INGRES
#
II_SYSTEM = @II_SYSTEM@
HAVE_INGRES = @HAVE_INGRES@
INGRES_LIB = @INGRES_LIB@
INGRES_INC = @INGRES_INC@

#
# MySQL support.
#
HAVE_MYSQL =	@HAVE_MYSQL@
MYSQL_LIB  =	@MYSQL_LIB@
MYSQL_INC  =	@MYSQL_INC@
LIBS	   +=	$(MYSQL_LIB)

#
# HDF4 Support.
#
HAVE_HDF4     = @HAVE_HDF4@
HDF4_INCLUDE  = @HDF4_INCLUDE@ -I$(GDAL_ROOT)/ogr
HDF4_HAS_MAXOPENFILES = @HDF4_HAS_MAXOPENFILES@
ifeq ($(HDF4_HAS_MAXOPENFILES),yes)
HDF4_FLAGS=-DHDF4_HAS_MAXOPENFILES
endif

#
# HDF5 Support.
#
HAVE_HDF5     = @HAVE_HDF5@
HDF5_INCLUDE  = @HDF5_INCLUDE@

#
# KEA Support.
#
HAVE_KEA     = @HAVE_KEA@
KEA_INC      = @KEA_INC@
KEA_LIB      = @KEA_LIB@
LIBS       +=   $(KEA_LIB)

#
# NetCDF Support.
#
NETCDF_MEM = @NETCDF_MEM@
NETCDF_ROOT = @NETCDF_ROOT@
NETCDF_HAS_NC4 = @NETCDF_HAS_NC4@
NETCDF_HAS_HDF4 = @NETCDF_HAS_HDF4@

#
# DODS Include file location
#
DODS_INC = @DODS_INC@
ifeq ($(DODS_INC),)
HAVE_DODS = no
else
HAVE_DODS = yes
endif

#
# SQLite
#
SQLITE_INC = @SQLITE_INC@
SQLITE_HAS_COLUMN_METADATA = @SQLITE_HAS_COLUMN_METADATA@
HAVE_SQLITE = @HAVE_SQLITE@
HAVE_SPATIALITE = @HAVE_SPATIALITE@
SPATIALITE_SONAME = @SPATIALITE_SONAME@
SPATIALITE_INC = @SPATIALITE_INC@
SPATIALITE_AMALGAMATION = @SPATIALITE_AMALGAMATION@
SPATIALITE_412_OR_LATER = @SPATIALITE_412_OR_LATER@
HAVE_PCRE = @HAVE_PCRE@
HAVE_RASTERLITE2 = @HAVE_RASTERLITE2@
RASTERLITE2_CFLAGS = @RASTERLITE2_CFLAGS@

#
# JPEG2000 via Kakadu Support.
#
KAKDIR = @KAKDIR@

ifneq ($(KAKDIR),)
ifeq ($(HAVE_LIBTOOL),yes)
include $(GDAL_ROOT)/frmts/jp2kak/jp2kak.lst
KAK_LIBS = $(KAK_OBJ)
endif
endif

#
# JPEG-2000 Support via JasPer library.
#
HAVE_JASPER     = @HAVE_JASPER@
JASPER_FLAGS	= @JASPER_FLAGS@

#
# MrSID support via LizardTech's DSDK
#
MRSID_FLAGS	= @MRSID_FLAGS@
MRSID_INCLUDE	= @MRSID_INCLUDE@
MRSID_LIBS	= @MRSID_LIBS@

#
#
# MrSID/MG4 support via LizardTech LiDAR SDK
#
MRSID_LIDAR_INCLUDE	= @MRSID_LIDAR_INCLUDE@
MRSID_LIDAR_LIBS	= @MRSID_LIDAR_LIBS@

#
# ECW Related
#
ECW_FLAGS	= @ECW_FLAGS@
ECW_INCLUDE 	= @ECW_INCLUDE@
ECW_LIBS	= @ECW_LIBS@

#
# JP2Lura Related
#
JP2LURA_INCLUDE 	= @JP2LURA_INCLUDE@

# Xerces C++ XML Parser for GML and ILI
#
HAVE_XERCES	= @HAVE_XERCES@
XERCES_INCLUDE	= @XERCES_INCLUDE@
ifeq ($(HAVE_XERCES),yes)
CPPFLAGS	+= -DHAVE_XERCES $(XERCES_INCLUDE) $(CPPFLAGS)
endif

#
# Enable NAS format
#
HAVE_NAS	= @HAVE_NAS@

#
# Expat XML Parser for KML, GPX, GeoRSS (and GML if no Xerces C++)
#
HAVE_EXPAT = @HAVE_EXPAT@
EXPAT_INCLUDE = @EXPAT_INCLUDE@

#
# Google libkml for the new OGR KML driver written by Brian Case
#
HAVE_LIBKML = @HAVE_LIBKML@
LIBKML_INCLUDE = @LIBKML_INCLUDE@

#
# Oracle Spatial Support
#
HAVE_OCI	= @HAVE_OCI@
OCI_INCLUDE	= @OCI_INCLUDE@

# GEOS Support

HAVE_GEOS       =       @HAVE_GEOS@
GEOS_CFLAGS     =       @GEOS_CFLAGS@

# SFCGAL Support

HAVE_SFCGAL       =       @HAVE_SFCGAL@
SFCGAL_CFLAGS     =       @SFCGAL_CFLAGS@

# QHull Support

QHULL_SETTING   =       @QHULL_SETTING@
QHULL_INCLUDE_SUBDIR_IS_LIBQHULL   =       @QHULL_INCLUDE_SUBDIR_IS_LIBQHULL@

# GRASS Support

GRASS_SETTING	=	@GRASS_SETTING@
GRASS_INCLUDE	=	@GRASS_INCLUDE@
GRASS_GISBASE	=	@GRASS_GISBASE@
HAVE_GRASS	=	@HAVE_GRASS@

#
# SDE
#
HAVE_SDE = @SDE_ENABLED@
SDE_LIB	= @SDE_LIB@
SDE_INC = @SDE_INC@

#
# FileGDB
#
HAVE_FGDB = @FGDB_ENABLED@
FGDB_LIB = @FGDB_LIB@
FGDB_INC = @FGDB_INC@

#
# MongoDB
#
HAVE_MONGODB = @MONGODB_ENABLED@
MONGODB_LIB = @MONGODB_LIB@
MONGODB_INC = @MONGODB_INC@

#
# ArcObjects
#
HAVE_ARCOBJECTS = @ARCOBJECTS_ENABLED@
ARCOBJECTS_LIB	= @ARCOBJECTS_LIB@
ARCOBJECTS_INC = @ARCOBJECTS_INC@

#
# Curl
#
CURL_SETTING 	=	@CURL_SETTING@
CURL_LIB	=	@CURL_LIB@
CURL_INC	=	@CURL_INC@

#
# libjson-c
#
LIBJSONC_SETTING = @LIBJSONC_SETTING@
JSON_INCLUDE = @JSON_INCLUDE@

#
# OpenCL support
#
OPENCL_LIB	=	@OPENCL_LIB@
OPENCL_FLAGS	=	@OPENCL_FLAGS@

#
# SOSI support
#
SOSI_INC = @SOSI_INC@
SOSI_LIB = @SOSI_LIB@
HAVE_SOSI = @SOSI_ENABLED@

#
# PCIDSK SDK
#
PCIDSK_SETTING  =       @PCIDSK_SETTING@
PCIDSK_LIB	=	@PCIDSK_LIB@
PCIDSK_INCLUDE	=	@PCIDSK_INCLUDE@

#
# Iconv
#
LIBICONV	=	@LIBICONV@

#
# LIBXML2
#

HAVE_LIBXML2 = @HAVE_LIBXML2@
LIBXML2_INC = @LIBXML2_INC@
LIBXML2_LIB = @LIBXML2_LIB@

#
# CAD Support
#
HAVE_CAD	=	yes

#
# Informix DataBlade support
#
HAVE_IDB	= @HAVE_IDB@
IDB_INC		= @IDB_INC@
IDB_LIB		= @IDB_LIB@
ifeq ($(HAVE_IDB),yes)
LIBS	   	+= $(IDB_LIB)
endif

#
# FMEObjects
#
ifeq (@X_FME_HOME@,)
HAVE_FME        =       no
FME_INCLUDE	=
else
HAVE_FME        =       yes
FME_INCLUDE	=	-I@X_FME_HOME@/fmeobjects/cpp
endif

# PCRaster support
PCRASTER_SETTING	=	@PCRASTER_SETTING@

#
# LERC support.
#
HAVE_LERC =	@HAVE_LERC@

OGDI_INCLUDE	=	@OGDI_INCLUDE@

PNG_SETTING     =	@PNG_SETTING@
JPEG_SETTING	=	@JPEG_SETTING@
JPEG12_ENABLED =	@JPEG12_ENABLED@
TIFF_JPEG12_ENABLED =    @TIFF_JPEG12_ENABLED@
TIFF_SETTING	=	@TIFF_SETTING@
TIFF_OPTS	=	@TIFF_OPTS@
RENAME_INTERNAL_LIBTIFF_SYMBOLS = @RENAME_INTERNAL_LIBTIFF_SYMBOLS@
GEOTIFF_SETTING	=	@GEOTIFF_SETTING@
GEOTIFF_INCLUDE =	@GEOTIFF_INCLUDE@
RENAME_INTERNAL_LIBGEOTIFF_SYMBOLS = @RENAME_INTERNAL_LIBGEOTIFF_SYMBOLS@
RENAME_INTERNAL_SHAPELIB_SYMBOLS = @RENAME_INTERNAL_SHAPELIB_SYMBOLS@
GIF_SETTING	=	@GIF_SETTING@
FITS_SETTING    =       @FITS_SETTING@
OGDI_SETTING	=	@HAVE_OGDI@
ODBC_SETTING    =       @ODBC_SETTING@
# PGeo driver is built-in when ODBC is available
PGEO_SETTING    =       @ODBC_SETTING@
MSSQLSPATIAL_SETTING    =       @ODBC_SETTING@
GEOMEDIA_SETTING    =       @ODBC_SETTING@
NETCDF_SETTING  =       @NETCDF_SETTING@
LIBZ_SETTING	=	@LIBZ_SETTING@
LIBLZMA_SETTING	=	@LIBLZMA_SETTING@
WEBP_SETTING	=	@WEBP_SETTING@
ZSTD_SETTING	=	@ZSTD_SETTING@

#
# DDS via Crunch Support.
#
CRUNCHDIR = @CRUNCHDIR@

#
# Rasdaman stuff
#
RASDAMAN_ENABLED  =       @RASDAMAN_ENABLED@
RASDAMAN_INC  =   @RASDAMAN_INC@
RASDAMAN_LIB  =   @RASDAMAN_LIB@

#
# PDF stuff
#
PDF_PLUGIN = @PDF_PLUGIN@

#
# Poppler stuff
#

HAVE_POPPLER = @HAVE_POPPLER@
POPPLER_MAJOR_VERSION = @POPPLER_MAJOR_VERSION@
POPPLER_MINOR_VERSION = @POPPLER_MINOR_VERSION@
POPPLER_INC = @POPPLER_CFLAGS@
POPPLER_PLUGIN_LIB = @POPPLER_PLUGIN_LIB@

#
# Podofo stuff
#

HAVE_PODOFO = @HAVE_PODOFO@
PODOFO_INC = @PODOFO_INC@
PODOFO_PLUGIN_LIB = @PODOFO_PLUGIN_LIB@

#
# Pdfium stuff
#

HAVE_PDFIUM = @HAVE_PDFIUM@
PDFIUM_INC = @PDFIUM_INC@
PDFIUM_PLUGIN_LIB = @PDFIUM_PLUGIN_LIB@

#
# CharLs stuff
#
HAVE_CHARLS = @HAVE_CHARLS@
CHARLS_INC = @CHARLS_INC@

#
# Teigha stuff
#
HAVE_TEIGHA = @HAVE_TEIGHA@
TEIGHA_DIR = @TEIGHA_DIR@
TEIGHA_CPPFLAGS = @TEIGHA_CPPFLAGS@

#
# PROJ.4 stuff
#
PROJ_STATIC	=	@PROJ_STATIC@
ifeq ($(PROJ_STATIC),yes)
PROJ_FLAGS = -DPROJ_STATIC -DPROJ_VERSION=@PROJ_VERSION@
endif
PROJ_INCLUDE	=	@PROJ_INCLUDE@

PAM_SETTING     =       @PAM_SETTING@

GDAL_LIBS	:= $(GDAL_LIB) $(OCI_LIB) $(GDAL_LIBS)

ifeq ($(GNM_ENABLED),yes)
CPPFLAGS	:= -DGNM_ENABLED $(CPPFLAGS)
endif

#
# Java stuff
#
JAVA_HOME = @JAVA_HOME@
JAVA_INC  = @JAVA_INC@
JVM_LIB   = @JVM_LIB@

MDB_ENABLED =   @MDB_ENABLED@

HAVE_ARMADILLO = @HAVE_ARMADILLO@

#
# userfaultfd
#
ENABLE_UFFD = @ENABLE_UFFD@

#
# HDFS
#
HDFS_LIB = @HDFS_LIB@
HDFS_INC = @HDFS_INC@
HDFS_ENABLED = @HDFS_ENABLED@
JNI_LIB = @JNI_LIB@

#
# freexl stuff
#

HAVE_FREEXL = @HAVE_FREEXL@
FREEXL_INCLUDE = @FREEXL_INCLUDE@

#
# cryptopp stuff
#
HAVE_CRYPTOPP    =       @HAVE_CRYPTOPP@
USE_ONLY_CRYPTODLL_ALG        =       @USE_ONLY_CRYPTODLL_ALG@

#
# crypto/openssl stuff
#
HAVE_OPENSSL_CRYPTO    =       @HAVE_OPENSSL_CRYPTO@

#
#	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_GTiff().
#
GDAL_FORMATS :=
GDAL_FORMATS += gxf gtiff hfa aigrid aaigrid ceos ceos2 iso8211 xpm
GDAL_FORMATS += sdts raw dted mem jdem envisat elas fit vrt usgsdem l1b
GDAL_FORMATS += nitf bmp airsar rs2 ilwis rmf leveller sgi srtmhgt
GDAL_FORMATS += idrisi gsg ingr ers jaxapalsar dimap gff cosar pds adrg
GDAL_FORMATS += coasp tsx terragen blx msgn til r northwood saga xyz hf2
GDAL_FORMATS += kmlsuperoverlay ctg e00grid zmap ngsgeoid iris map cals
GDAL_FORMATS += safe sentinel2 derived
GDAL_FORMATS += prf
GDAL_FORMATS += sigdem
GDAL_FORMATS += ignfheightasciigrid
GDAL_FORMATS += @OPT_GDAL_FORMATS@

ifneq ($(PCIDSK_SETTING),no)
GDAL_FORMATS += pcidsk
endif

ifneq ($(LIBZ_SETTING),no)
GDAL_FORMATS := $(GDAL_FORMATS) rik ozi

ifneq ($(PDF_PLUGIN),yes)
GDAL_FORMATS := $(GDAL_FORMATS) pdf
endif

endif

ifeq ($(HAVE_SQLITE),yes)
GDAL_FORMATS := $(GDAL_FORMATS) rasterlite mbtiles
endif

ifeq ($(HAVE_POSTGISRASTER),yes)
GDAL_FORMATS := $(GDAL_FORMATS) postgisraster
endif

ifeq ($(HAVE_CHARLS),yes)
GDAL_FORMATS := $(GDAL_FORMATS) jpegls
endif

GDAL_FORMATS := $(GDAL_FORMATS) arg

#
# 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	=	$(GDAL_ROOT)/$(LIBGDAL)
ifeq ($(MACOSX_FRAMEWORK),yes)
CONFIG_LIBS_INS	=	-L$(INST_LIB)/unix/lib -lgdal
else
CONFIG_LIBS_INS	=	-L$(INST_LIB) -lgdal
endif # MACOSX_FRAMEWORK

EXE_DEP_LIBS	=	$(GDAL_ROOT)/$(LIBGDAL)
SO_EXT		=	la

else # HAVE_LIBTOOL

ifeq ($(HAVE_LD_SHARED),yes)
CONFIG_LIBS	=	$(GDAL_SLIB_LINK) $(LIBS)
ifeq ($(MACOSX_FRAMEWORK),yes)
CONFIG_LIBS_INS	=	-L$(INST_LIB)/unix/lib -lgdal
else
CONFIG_LIBS_INS	=	-L$(INST_LIB) -lgdal
endif
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/%.$(OBJ_EXT):	%.c
	$(CC) $(GDAL_INCLUDE) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<

../o/%.$(OBJ_EXT):	%.cpp
	$(CXX) $(GDAL_INCLUDE) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<

%.$(OBJ_EXT):	%.c
	$(CC) $(GDAL_INCLUDE) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<

%.$(OBJ_EXT):	%.cpp
	$(CXX) $(GDAL_INCLUDE) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<

#
# default rules for handling subdirectories
#

%-target:
	$(MAKE) -C $*

%-clean:
	$(MAKE) -C $* clean
