1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-25 20:23:07 +03:00
Files
postgres/src/interfaces/libpq++/Makefile
Peter Eisentraut 335248c9b7 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 13:02:52 +00:00

96 lines
2.3 KiB
Makefile

#-------------------------------------------------------------------------
#
# Makefile for libpq++ library
#
# Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile,v 1.25 2000/09/17 13:02:50 petere Exp $
#
#-------------------------------------------------------------------------
subdir = src/interfaces/libpq++
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
NAME= pq++
SO_MAJOR_VERSION= 3
SO_MINOR_VERSION= 1
SRCHEADERDIR = $(top_srcdir)/src/include
CXXFLAGS+= -I$(SRCHEADERDIR) -I$(libpq_srcdir)
OBJS = pgconnection.o pgdatabase.o pgtransdb.o pgcursordb.o pglobject.o
ifeq ($(PORTNAME), win)
SHLIB_LINK+= --driver-name g++ $(libpq)
else
SHLIB_LINK= $(libpq)
endif
# For CC on IRIX, must use CC as linker/archiver of C++ libraries
ifeq ($(PORTNAME), irix5)
ifeq ($(CXX), CC)
AR := CC
AROPT := -ar -o
LD := CC
endif
endif
# Same for Solaris with native compiler
ifeq ($(PORTNAME), solaris_sparc)
ifeq ($(CXX), CC)
AR := CC
AROPT := -xar -o
LD := CC
endif
endif
ifeq ($(PORTNAME), solaris_i386)
ifeq ($(CXX), CC)
AR := CC
AROPT := -xar -o
LD := CC
endif
endif
all: all-lib
# Shared library stuff
include $(top_builddir)/src/Makefile.shlib
# Pull shared-lib CFLAGS into CXXFLAGS
CXXFLAGS+= $(CFLAGS_SL)
.PHONY: examples
examples:
$(MAKE) -C examples all
install: all installdirs install-headers install-lib
libpqxx_includedir = $(includedir)/libpq++
MAINHEADER = libpq++.h
LIBPGXXHEADERS = pgconnection.h pgdatabase.h pgtransdb.h pgcursordb.h pglobject.h
.PHONY: install-headers
install-headers: $(MAINHEADER) $(LIBPGXXHEADERS)
$(INSTALL_DATA) $< $(DESTDIR)$(includedir)
for i in $(LIBPGXXHEADERS); do $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(libpqxx_includedir) || exit 1; done
installdirs:
$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) $(DESTDIR)$(libpqxx_includedir)
uninstall: uninstall-lib
rm -f $(DESTDIR)$(includedir)/$(MAINHEADER)
for i in $(LIBPGXXHEADERS); do rm -f $(DESTDIR)$(libpqxx_includedir)/$$i || exit; done
clean distclean maintainer-clean: clean-lib
rm -f $(OBJS)
-$(MAKE) -C examples clean
dep depend:
$(CXX) -MM $(CXXFLAGS) *.cc >depend
ifeq (depend,$(wildcard depend))
include depend
endif