2000-07-06 23:33:45 +02:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Makefile for src/include
|
|
|
|
#
|
2001-02-10 03:31:31 +01:00
|
|
|
# 'make install' installs only those headers needed for client-side
|
|
|
|
# programming. 'make install-all-headers' installs the whole contents
|
|
|
|
# of src/include.
|
2000-07-06 23:33:45 +02:00
|
|
|
#
|
2001-03-01 17:17:53 +01:00
|
|
|
# $Header: /cvsroot/pgsql/src/include/Makefile,v 1.8 2001/03/01 16:17:53 petere Exp $
|
2000-07-06 23:33:45 +02:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
subdir = src/include
|
|
|
|
top_builddir = ../..
|
2000-08-31 18:12:35 +02:00
|
|
|
include $(top_builddir)/src/Makefile.global
|
2000-07-06 23:33:45 +02:00
|
|
|
|
2001-02-10 03:31:31 +01:00
|
|
|
# Headers needed by clients
|
|
|
|
srcdir_headers := c.h postgres_ext.h postgres_fe.h \
|
|
|
|
libpq/pqcomm.h libpq/libpq-fs.h lib/dllist.h
|
2000-07-06 23:33:45 +02:00
|
|
|
|
2001-02-10 03:31:31 +01:00
|
|
|
builddir_headers := os.h config.h
|
2000-10-20 23:04:27 +02:00
|
|
|
|
|
|
|
HEADERS = $(srcdir_headers) $(builddir_headers)
|
|
|
|
|
2001-02-10 03:31:31 +01:00
|
|
|
# Subdirectories containing headers that install-all-headers should install
|
|
|
|
SUBDIRS = access bootstrap catalog commands executor lib libpq mb \
|
|
|
|
nodes optimizer parser port regex rewrite storage tcop utils
|
2000-07-06 23:33:45 +02:00
|
|
|
|
|
|
|
|
2001-02-10 03:31:31 +01:00
|
|
|
all: $(HEADERS)
|
2000-07-06 23:33:45 +02:00
|
|
|
|
|
|
|
|
2001-02-10 03:31:31 +01:00
|
|
|
# Install only selected headers
|
2000-07-06 23:33:45 +02:00
|
|
|
|
2001-02-20 21:37:13 +01:00
|
|
|
install: all installdirs remove-old-headers
|
2000-10-20 23:04:27 +02:00
|
|
|
for file in $(srcdir_headers); do \
|
|
|
|
$(INSTALL_DATA) $(srcdir)/$$file $(DESTDIR)$(includedir)/$$file || exit; \
|
|
|
|
done
|
|
|
|
for file in $(builddir_headers); do \
|
|
|
|
$(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/$$file || exit; \
|
2000-07-06 23:33:45 +02:00
|
|
|
done
|
|
|
|
|
2001-02-10 03:31:31 +01:00
|
|
|
# Automatically pick out the needed subdirectories for the include tree.
|
2000-07-06 23:33:45 +02:00
|
|
|
installdirs:
|
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
|
|
|
$(mkinstalldirs) $(addprefix $(DESTDIR)$(includedir)/, $(sort $(dir $(HEADERS))))
|
2000-07-06 23:33:45 +02:00
|
|
|
|
2001-02-10 03:31:31 +01:00
|
|
|
|
|
|
|
# Install all headers
|
|
|
|
|
|
|
|
install-all-headers: all install-all-dirs
|
|
|
|
for file in $(srcdir)/*.h; do \
|
|
|
|
$(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/`basename $$file` || exit; \
|
|
|
|
done
|
|
|
|
for dir in $(SUBDIRS); do \
|
|
|
|
for file in $(srcdir)/$$dir/*.h; do \
|
|
|
|
$(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/$$dir/`basename $$file` || exit; \
|
|
|
|
done \
|
|
|
|
done
|
|
|
|
for file in $(builddir_headers); do \
|
|
|
|
$(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/$$file || exit; \
|
|
|
|
done
|
|
|
|
|
|
|
|
install-all-dirs:
|
|
|
|
$(mkinstalldirs) $(addprefix $(DESTDIR)$(includedir)/, $(SUBDIRS))
|
|
|
|
|
|
|
|
|
2001-02-20 21:37:13 +01:00
|
|
|
# Pre-7.1 Postgres installed some headers that are no longer installed by
|
|
|
|
# default. If we see these headers in the target directory, zap them to
|
|
|
|
# avoid cross-version compile problems. However, don't zap them if they
|
|
|
|
# match current sources (that means the user did install-all-headers).
|
|
|
|
|
|
|
|
remove-old-headers:
|
|
|
|
for file in fmgr.h postgres.h access/attnum.h commands/trigger.h \
|
|
|
|
executor/spi.h utils/elog.h utils/geo_decls.h utils/mcxt.h \
|
|
|
|
utils/palloc.h; do \
|
|
|
|
if cmp -s $(srcdir)/$$file $(DESTDIR)$(includedir)/$$file; \
|
|
|
|
then \
|
|
|
|
: ; \
|
|
|
|
else \
|
|
|
|
rm -f $(DESTDIR)$(includedir)/$$file; \
|
2001-03-01 17:17:53 +01:00
|
|
|
fi ; \
|
2001-02-20 21:37:13 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
|
2001-02-10 03:31:31 +01:00
|
|
|
# This isn't a complete uninstall, but rm'ing everything under
|
|
|
|
# $(DESTDIR)$(includedir) is probably too drastic...
|
2000-07-06 23:33:45 +02:00
|
|
|
uninstall:
|
2001-02-10 03:31:31 +01:00
|
|
|
rm -rf $(addprefix $(DESTDIR)$(includedir)/, $(HEADERS) $(SUBDIRS))
|
2000-07-06 23:33:45 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f utils/fmgroids.h parser/parse.h
|
|
|
|
|
|
|
|
distclean maintainer-clean: clean
|
2000-07-19 18:30:27 +02:00
|
|
|
rm -f config.h dynloader.h os.h stamp-h
|