1 #-------------------------------------------------------------------------
3 # Makefile for src/include
5 # 'make install' installs only those headers needed for client-side
6 # programming. 'make install-all-headers' installs the whole contents
9 # $Header: /cvsroot/pgsql/src/include/Makefile,v 1.10 2001/08/28 14:20:28 petere Exp $
11 #-------------------------------------------------------------------------
15 include $(top_builddir)/src/Makefile.global
18 all: pg_config.h pg_config_os.h
21 # Install only selected headers
23 install: all installdirs remove-old-headers
24 # These headers are needed by the public headers of the interfaces.
25 $(INSTALL_DATA) $(srcdir)/postgres_ext.h $(DESTDIR)$(includedir)
26 $(INSTALL_DATA) $(srcdir)/libpq/libpq-fs.h $(DESTDIR)$(includedir)/libpq
27 $(INSTALL_DATA) pg_config.h $(DESTDIR)$(includedir)
28 $(INSTALL_DATA) pg_config_os.h $(DESTDIR)$(includedir)
29 # These headers are needed by the not-so-public headers of the interfaces.
30 $(INSTALL_DATA) $(srcdir)/c.h $(DESTDIR)$(includedir_internal)
31 $(INSTALL_DATA) $(srcdir)/postgres_fe.h $(DESTDIR)$(includedir_internal)
32 $(INSTALL_DATA) $(srcdir)/libpq/pqcomm.h $(DESTDIR)$(includedir_internal)/libpq
33 $(INSTALL_DATA) $(srcdir)/lib/dllist.h $(DESTDIR)$(includedir_internal)/lib
36 $(mkinstalldirs) $(DESTDIR)$(includedir)/libpq $(DESTDIR)$(includedir_internal)/libpq $(DESTDIR)$(includedir_internal)/lib
41 # Subdirectories containing headers that install-all-headers should install
42 SUBDIRS = access bootstrap catalog commands executor lib libpq mb \
43 nodes optimizer parser port regex rewrite storage tcop utils
45 install-all-headers: all install-all-dirs
46 $(INSTALL_DATA) pg_config.h $(DESTDIR)$(includedir_server)
47 $(INSTALL_DATA) pg_config_os.h $(DESTDIR)$(includedir_server)
48 for file in $(srcdir)/*.h; do \
49 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir_server)/`basename $$file` || exit; \
51 for dir in $(SUBDIRS); do \
52 for file in $(srcdir)/$$dir/*.h; do \
53 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir_server)/$$dir/`basename $$file` || exit; \
58 $(mkinstalldirs) $(addprefix $(DESTDIR)$(includedir_server)/, $(SUBDIRS))
61 # Pre-7.1 Postgres installed some headers that are no longer installed by
62 # default. If we see these headers in the target directory, zap them to
63 # avoid cross-version compile problems. However, don't zap them if they
64 # match current sources (that means the user did install-all-headers).
67 for file in fmgr.h postgres.h access/attnum.h commands/trigger.h \
68 executor/spi.h utils/elog.h utils/geo_decls.h utils/mcxt.h \
70 if cmp -s $(srcdir)/$$file $(DESTDIR)$(includedir)/$$file; \
74 rm -f $(DESTDIR)$(includedir)/$$file; \
80 rm -f $(addprefix $(DESTDIR)$(includedir)/, pg_config.h pg_config_os.h postgres_ext.h libpq/libpq-fs.h)
81 rm -f $(addprefix $(DESTDIR)$(includedir_internal)/, c.h postgres_fe.h lib/dllist.h libpq/pqcomm.h)
83 rm -rf $(addprefix $(DESTDIR)$(includedir_server)/, $(SUBDIRS) *.h)
87 rm -f utils/fmgroids.h parser/parse.h
89 distclean maintainer-clean: clean
90 rm -f pg_config.h dynloader.h pg_config_os.h stamp-h