2000-06-28 20:30:16 +02:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Makefile for src/interfaces/libpq library
|
|
|
|
#
|
|
|
|
# Copyright (c) 1994, Regents of the University of California
|
|
|
|
#
|
2001-08-28 16:20:28 +02:00
|
|
|
# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.56 2001/08/28 14:20:28 petere Exp $
|
2000-06-28 20:30:16 +02:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
subdir = src/interfaces/libpq
|
|
|
|
top_builddir = ../../..
|
2000-08-31 18:12:35 +02:00
|
|
|
include $(top_builddir)/src/Makefile.global
|
2000-06-28 20:30:16 +02:00
|
|
|
|
|
|
|
# shared library parameters
|
|
|
|
NAME= pq
|
|
|
|
SO_MAJOR_VERSION= 2
|
2001-05-11 03:46:33 +02:00
|
|
|
SO_MINOR_VERSION= 2
|
2000-06-28 20:30:16 +02:00
|
|
|
|
2001-02-20 20:20:30 +01:00
|
|
|
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) -DFRONTEND -DSYSCONFDIR='"$(sysconfdir)"'
|
2000-06-28 20:30:16 +02:00
|
|
|
|
|
|
|
OBJS= fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \
|
2001-08-15 20:42:16 +02:00
|
|
|
pqexpbuffer.o dllist.o md5.o pqsignal.o \
|
2001-01-21 00:07:27 +01:00
|
|
|
$(INET_ATON) $(SNPRINTF) $(STRERROR)
|
2000-06-28 20:30:16 +02:00
|
|
|
|
|
|
|
ifdef MULTIBYTE
|
2001-02-11 02:52:11 +01:00
|
|
|
OBJS+= wchar.o
|
2000-06-28 20:30:16 +02:00
|
|
|
endif
|
|
|
|
|
2000-10-25 18:13:52 +02:00
|
|
|
# Add libraries that libpq depends (or might depend) on into the
|
|
|
|
# shared library link. (The order in which you list them here doesn't
|
|
|
|
# matter.)
|
2001-07-15 15:45:04 +02:00
|
|
|
SHLIB_LINK += $(filter -L%, $(LDFLAGS)) $(filter -lcrypt -ldes -lkrb -lcom_err -lcrypto -lk5crypto -lkrb5 -lssl -lsocket -lnsl -lresolv -lintl, $(LIBS))
|
2000-06-28 20:30:16 +02:00
|
|
|
|
|
|
|
|
2001-08-28 16:20:28 +02:00
|
|
|
all: all-lib
|
2000-06-28 20:30:16 +02:00
|
|
|
|
|
|
|
# Shared library stuff
|
|
|
|
include $(top_srcdir)/src/Makefile.shlib
|
|
|
|
|
|
|
|
|
|
|
|
# We use several backend modules verbatim, but since we need to
|
|
|
|
# compile with appropriate options to build a shared lib, we can't
|
|
|
|
# necessarily use the same object files as the backend uses. Instead,
|
|
|
|
# symlink the source files in here and build our own object file.
|
|
|
|
|
|
|
|
backend_src = $(top_srcdir)/src/backend
|
|
|
|
|
|
|
|
dllist.c: $(backend_src)/lib/dllist.c
|
|
|
|
rm -f $@ && $(LN_S) $< .
|
|
|
|
|
2001-08-15 20:42:16 +02:00
|
|
|
md5.c: $(backend_src)/libpq/md5.c
|
|
|
|
rm -f $@ && $(LN_S) $< .
|
|
|
|
|
2001-01-21 00:07:27 +01:00
|
|
|
# this only gets done if configure finds system doesn't have inet_aton()
|
|
|
|
inet_aton.c: $(backend_src)/port/inet_aton.c
|
|
|
|
rm -f $@ && $(LN_S) $< .
|
|
|
|
|
2000-06-28 20:30:16 +02:00
|
|
|
# this only gets done if configure finds system doesn't have snprintf()
|
|
|
|
snprintf.c: $(backend_src)/port/snprintf.c
|
|
|
|
rm -f $@ && $(LN_S) $< .
|
|
|
|
|
2001-01-21 00:07:27 +01:00
|
|
|
# this only gets done if configure finds system doesn't have strerror()
|
|
|
|
strerror.c: $(backend_src)/port/strerror.c
|
2000-06-28 20:30:16 +02:00
|
|
|
rm -f $@ && $(LN_S) $< .
|
|
|
|
|
|
|
|
ifdef MULTIBYTE
|
2001-02-11 02:52:11 +01:00
|
|
|
wchar.c : % : $(backend_src)/utils/mb/%
|
2000-06-28 20:30:16 +02:00
|
|
|
rm -f $@ && $(LN_S) $< .
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2001-08-28 16:20:28 +02:00
|
|
|
install: all installdirs install-lib
|
Support for DESTDIR make variable. This is used as in `make install
DESTDIR=/else/where' and prepends the value of DESTDIR to the full
installation paths (e.g., /else/where/usr/local/pgsql/bin). This allows
users to install the package into a location different from the one that
was configured and hard-coded into various scripts, e.g., for creating
binary packages.
DESTDIR is in many cases preferrable over `make install
prefix=/else/where' because
a) `prefix' affects the path that is hard-coded into the files, which can
lead to a `make install prefix=xxx' (as done by the regression test
driver) corrupting the files in the source tree with wrong paths.
b) it doesn't work at all if a directory was overridden to not depend on
`prefix', e.g., --sysconfdir=/etc.
(Updating the regression test driver to use DESTDIR is a separate
undertaking.)
See also autoconf@gnu.org, From: Akim Demaille <akim@epita.fr>, Date: 08
Sep 2000 12:48:59 +0200, Message-ID:
<mv4em2vb1lw.fsf@nostromo.lrde.epita.fr>, Subject: Re: HTML format
documentation.
2000-09-17 15:02:52 +02:00
|
|
|
$(INSTALL_DATA) $(srcdir)/libpq-fe.h $(DESTDIR)$(includedir)
|
2001-08-28 16:20:28 +02:00
|
|
|
$(INSTALL_DATA) $(srcdir)/libpq-int.h $(DESTDIR)$(includedir_internal)
|
|
|
|
$(INSTALL_DATA) $(srcdir)/pqexpbuffer.h $(DESTDIR)$(includedir_internal)
|
2000-06-28 20:30:16 +02:00
|
|
|
|
|
|
|
installdirs:
|
2001-08-28 16:20:28 +02:00
|
|
|
$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) $(DESTDIR)$(includedir_internal)
|
2000-06-28 20:30:16 +02:00
|
|
|
|
|
|
|
uninstall: uninstall-lib
|
2001-08-28 16:20:28 +02:00
|
|
|
rm -f $(DESTDIR)$(includedir)/libpq-fe.h $(DESTDIR)$(includedir_internal)/libpq-int.h $(includedir_internal)/pqexpbuffer.h
|
2000-06-28 20:30:16 +02:00
|
|
|
|
|
|
|
clean distclean maintainer-clean: clean-lib
|
2001-08-15 20:42:16 +02:00
|
|
|
rm -f $(OBJS) dllist.c md5.c md5.h wchar.c
|
2001-01-21 00:07:27 +01:00
|
|
|
rm -f $(OBJS) inet_aton.c snprintf.c strerror.c
|