GNUmakefile 2.21 KB
Newer Older
1 2 3 4
#-------------------------------------------------------------------------
#
# GNUMakefile for psqlodbc (Postgres ODBC driver)
#
Bruce Momjian's avatar
Bruce Momjian committed
5
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile,v 1.11 2001/02/10 15:59:16 momjian Exp $
6 7 8 9 10
#
#-------------------------------------------------------------------------

subdir = src/interfaces/odbc
top_builddir = ../../..
11
include $(top_builddir)/src/Makefile.global
12 13 14 15 16 17

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

18
override CPPFLAGS += -I$(srcdir) -DHAVE_CONFIG_H -DODBCINSTDIR='"$(odbcinst_ini_dir)"'
19 20 21 22 23 24 25


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 $(OBJX)

26
SHLIB_LINK = $(filter -lm, $(LIBS))
27 28 29 30 31
all: all-lib

# Shared library stuff
include $(top_srcdir)/src/Makefile.shlib

32 33 34
# Symbols must be resolved to the version in the shared library because
# the driver manager (e.g., iodbc) provides some symbols with the same
# names and we don't want those.  (This issue is probably ELF specific.)
35 36 37 38
#
# BSD/OS fails with libc and crt1.o undefined symbols without this.
# bjm 2001-02-09
#
Bruce Momjian's avatar
Bruce Momjian committed
39
ifneq ($(PORTNAME), bsdi)
40
LINK.shared += $(shlib_symbolic)
Bruce Momjian's avatar
Bruce Momjian committed
41 42 43
else
LINK.shared = gcc -shared -Wl,-Bsymbolic,-soname,$(soname)
SHLIB_LINK += -lc
44
endif
45

46 47 48
odbc_headers = isql.h isqlext.h iodbc.h
odbc_includedir = $(includedir)/iodbc

49 50 51 52 53
install: all installdirs
	for i in $(odbc_headers); do $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(odbc_includedir)/$$i || exit 1; done
	$(INSTALL_DATA) $(srcdir)/odbcinst.ini $(DESTDIR)$(odbcinst_ini_dir)/odbcinst.ini
	$(INSTALL_DATA) $(srcdir)/odbc.sql $(DESTDIR)$(datadir)/odbc.sql
	$(MAKE) install-lib
54 55

installdirs:
56
	$(mkinstalldirs) $(DESTDIR)$(odbc_includedir) $(DESTDIR)$(libdir) $(DESTDIR)$(odbcinst_ini_dir) $(DESTDIR)$(datadir)
57 58

uninstall: uninstall-lib
59
	rm -f $(addprefix $(DESTDIR)$(odbc_includedir)/, $(odbc_headers))
60 61
	rm -f $(DESTDIR)$(datadir)/odbc.sql
# XXX Uninstall the .ini file as well?
62 63 64 65 66 67 68 69 70 71

clean distclean maintainer-clean: clean-lib
	rm -f $(OBJS)

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

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