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 # $PostgreSQL: pgsql/src/include/Makefile,v 1.12 2003/11/29 19:52:08 pgsql 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 $(INSTALL_DATA) $(srcdir)/pg_config_manual.h $(DESTDIR)$(includedir)
30 # These headers are needed by the not-so-public headers of the interfaces.
31 $(INSTALL_DATA) $(srcdir)/c.h $(DESTDIR)$(includedir_internal)
32 $(INSTALL_DATA) $(srcdir)/port.h $(DESTDIR)$(includedir_internal)
33 $(INSTALL_DATA) $(srcdir)/postgres_fe.h $(DESTDIR)$(includedir_internal)
34 $(INSTALL_DATA) $(srcdir)/libpq/pqcomm.h $(DESTDIR)$(includedir_internal)/libpq
35 $(INSTALL_DATA) $(srcdir)/lib/dllist.h $(DESTDIR)$(includedir_internal)/lib
38 $(mkinstalldirs) $(DESTDIR)$(includedir)/libpq $(DESTDIR)$(includedir_internal)/libpq $(DESTDIR)$(includedir_internal)/lib
43 # Subdirectories containing headers that install-all-headers should install
44 SUBDIRS = access bootstrap catalog commands executor lib libpq mb \
45 nodes optimizer parser port regex rewrite storage tcop utils
47 install-all-headers: all install-all-dirs
48 $(INSTALL_DATA) pg_config.h $(DESTDIR)$(includedir_server)
49 $(INSTALL_DATA) pg_config_os.h $(DESTDIR)$(includedir_server)
50 for file in $(srcdir)/*.h; do \
51 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir_server)/`basename $$file` || exit; \
53 for dir in $(SUBDIRS); do \
54 for file in $(srcdir)/$$dir/*.h; do \
55 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir_server)/$$dir/`basename $$file` || exit; \
60 $(mkinstalldirs) $(addprefix $(DESTDIR)$(includedir_server)/, $(SUBDIRS))
63 # Pre-7.1 Postgres installed some headers that are no longer installed by
64 # default. If we see these headers in the target directory, zap them to
65 # avoid cross-version compile problems. However, don't zap them if they
66 # match current sources (that means the user did install-all-headers).
69 for file in fmgr.h postgres.h access/attnum.h commands/trigger.h \
70 executor/spi.h utils/elog.h utils/geo_decls.h utils/mcxt.h \
72 if cmp -s $(srcdir)/$$file $(DESTDIR)$(includedir)/$$file; \
76 rm -f $(DESTDIR)$(includedir)/$$file; \
82 rm -f $(addprefix $(DESTDIR)$(includedir)/, pg_config.h pg_config_os.h postgres_ext.h libpq/libpq-fs.h)
83 rm -f $(addprefix $(DESTDIR)$(includedir_internal)/, c.h postgres_fe.h lib/dllist.h libpq/pqcomm.h)
85 rm -rf $(addprefix $(DESTDIR)$(includedir_server)/, $(SUBDIRS) *.h)
89 rm -f utils/fmgroids.h parser/parse.h
91 distclean maintainer-clean: clean
92 rm -f pg_config.h dynloader.h pg_config_os.h stamp-h