#-----------------------------------------------------------------------------#
# Copyright (C) 1997-2000, 2003, 2006 The University of Melbourne.
# This file may only be copied under the terms of the GNU General
# Public License - see the file COPYING in the Mercury distribution.
#-----------------------------------------------------------------------------#

# extras/odbc/Mmakefile - Mmake file for building the ODBC interface.

#-----------------------------------------------------------------------------#
# Configuration

# The driver manager.
# Legal values for MODBC_DRIVER are MODBC_IODBC, MODBC_UNIX, and MODBC_MS.
# Feel free to add more (and handle them in odbc.m).
MODBC_DRIVER=MODBC_UNIX

# The database.
# Legal values for MODBC_DB are MODBC_MYSQL and MODBC_SQL_SERVER.
# Feel free to add more (and handle them in odbc.m).
MODBC_DB = MODBC_MYSQL

# Pathname for iODBC (only for MODBC_IODBC)
#IODBC_DIR=

# Pathname for the ODBC SDK (only for MODBC_MS)
ODBC_SDK_DIR=/odbcsdk

INSTALL_PREFIX := $(INSTALL_PREFIX)/extras

-include ../Mmake.params

#-----------------------------------------------------------------------------#

ifeq ($(MODBC_DRIVER),MODBC_MS)
	ODBC_INCL_DIR=$(ODBC_SDK_DIR)/include
	MLLIBS=-lodbc32
else 
	#ODBC_LIB_DIR=$(IODBC_DIR)/lib
	#ODBC_INCL_DIR=$(IODBC_DIR)/include

	# The following are for Debian.

	# for unixODBC
	MLLIBS=-lodbc -lpthread -lltdl -ldl

	# for iODBC
	# MLLIBS=-liodbc l-pthread -ldl
	# note: on a DEC Alpha using OSF1 remove the -ldl.
endif

MAIN_TARGET=odbc_test

.PHONY: depend
depend: odbc_test.depend

.PHONY: check
check:
	true

#-----------------------------------------------------------------------------#

# `--no-ansi' is needed because the ODBC header files include C++-style
# "//" comments.  `--no-ansi' allows recognition of C++-style "//" comments,
# presuming you have gcc version 2.7.1 or greater.
MGNUCFLAGS=--no-ansi -D$(MODBC_DRIVER) -D$(MODBC_DB) -I$(ODBC_INCL_DIR)

#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#
