#-------------------------------------------------------------------------
#
# GNUMakefile.in for psqlodbc (Postgres ODBC driver).
#
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile.in,v 1.17 2000/06/20 16:39:57 petere Exp $
#
#-------------------------------------------------------------------------

srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ../../..
subdir = src/interfaces/odbc

mkinstalldirs = @mkinstalldirs@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

prefix = @prefix@
datadir = @datadir@
odbcinst_ini_dir = @odbcinst_ini_dir@
includedir = @includedir@

# Shared library parameters
NAME = psqlodbc
SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 26


SRCDIR= $(top_srcdir)/src
include $(SRCDIR)/Makefile.global

CFLAGS += -I. @DEFS@ -DODBCINSTDIR='"$(odbcinst_ini_dir)"'


OBJS = info.o bind.o columninfo.o connection.o convert.o drvconn.o \
        environ.o execute.o lobj.o misc.o options.o \
        pgtypes.o psqlodbc.o qresult.o results.o socket.o parse.o statement.o \
        gpps.o tuple.o tuplelist.o dlg_specific.o


# Shared library stuff, also default 'all' target
include $(SRCDIR)/Makefile.shlib

install: all installdirs install-headers install-ini install-lib $(install-shlib-dep)

installdirs:
	$(mkinstalldirs) $(includedir)/iodbc $(LIBDIR) $(odbcinst_ini_dir)

install-headers: isql.h isqlext.h iodbc.h
	$(INSTALL_DATA) $^ $(includedir)/iodbc/

install-ini: odbcinst.ini
	$(INSTALL_DATA) odbcinst.ini $(odbcinst_ini_dir)

clean: clean-shlib
	rm -f lib$(NAME).a $(OBJS)

distclean maintainer-clean: clean
	rm -f GNUmakefile


depend dep:
	$(CC) -MM $(CFLAGS) *.c >depend

ifeq (depend,$(wildcard depend))
include depend
endif

.PHONY: all install installdirs install-headers install-lib install-ini clean distclean maintainer-clean


GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
	cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status

$(top_builddir)/config.status: $(top_srcdir)/configure
	cd $(top_builddir) && ./config.status --recheck
