1 #-------------------------------------------------------------------------
3 # Makefile for src/include
5 # 'make install' installs whole contents of src/include.
7 # $PostgreSQL: pgsql/src/include/Makefile,v 1.14 2004/10/07 16:23:28 momjian Exp $
9 #-------------------------------------------------------------------------
13 include $(top_builddir)/src/Makefile.global
16 all: pg_config.h pg_config_os.h
19 # Subdirectories containing headers for server-side dev
20 SUBDIRS = access bootstrap catalog commands executor lib libpq mb \
21 nodes optimizer parser port regex rewrite storage tcop utils
24 install: all installdirs remove-old-headers
25 # These headers are needed by the public headers of the interfaces.
26 $(INSTALL_DATA) $(srcdir)/postgres_ext.h $(DESTDIR)$(includedir)
27 $(INSTALL_DATA) $(srcdir)/libpq/libpq-fs.h $(DESTDIR)$(includedir)/libpq
28 $(INSTALL_DATA) pg_config.h $(DESTDIR)$(includedir)
29 $(INSTALL_DATA) pg_config_os.h $(DESTDIR)$(includedir)
30 $(INSTALL_DATA) $(srcdir)/pg_config_manual.h $(DESTDIR)$(includedir)
31 # These headers are needed by the not-so-public headers of the interfaces.
32 $(INSTALL_DATA) $(srcdir)/c.h $(DESTDIR)$(includedir_internal)
33 $(INSTALL_DATA) $(srcdir)/port.h $(DESTDIR)$(includedir_internal)
34 $(INSTALL_DATA) $(srcdir)/postgres_fe.h $(DESTDIR)$(includedir_internal)
35 $(INSTALL_DATA) $(srcdir)/libpq/pqcomm.h $(DESTDIR)$(includedir_internal)/libpq
36 $(INSTALL_DATA) $(srcdir)/lib/dllist.h $(DESTDIR)$(includedir_internal)/lib
37 # These headers are needed for server-side development
38 $(INSTALL_DATA) pg_config.h $(DESTDIR)$(includedir_server)
39 $(INSTALL_DATA) pg_config_os.h $(DESTDIR)$(includedir_server)
40 for file in $(srcdir)/*.h; do \
41 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir_server)/`basename $$file` || exit; \
43 for dir in $(SUBDIRS); do \
44 for file in $(srcdir)/$$dir/*.h; do \
45 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir_server)/$$dir/`basename $$file` || exit; \
50 $(mkinstalldirs) $(DESTDIR)$(includedir)/libpq $(DESTDIR)$(includedir_internal)/libpq $(DESTDIR)$(includedir_internal)/lib
51 $(mkinstalldirs) $(addprefix $(DESTDIR)$(includedir_server)/, $(SUBDIRS))
54 # Pre-7.1 Postgres installed some headers that are no longer installed by
55 # default. If we see these headers in the target directory, zap them to
56 # avoid cross-version compile problems. However, don't zap them if they
57 # match current sources (that means the user did install-all-headers).
60 for file in fmgr.h postgres.h access/attnum.h commands/trigger.h \
61 executor/spi.h utils/elog.h utils/geo_decls.h utils/mcxt.h \
63 if cmp -s $(srcdir)/$$file $(DESTDIR)$(includedir)/$$file 2>/dev/null; \
67 rm -f $(DESTDIR)$(includedir)/$$file; \
73 rm -f $(addprefix $(DESTDIR)$(includedir)/, pg_config.h pg_config_os.h postgres_ext.h libpq/libpq-fs.h)
74 rm -f $(addprefix $(DESTDIR)$(includedir_internal)/, c.h postgres_fe.h lib/dllist.h libpq/pqcomm.h)
76 rm -rf $(addprefix $(DESTDIR)$(includedir_server)/, $(SUBDIRS) *.h)
80 rm -f utils/fmgroids.h parser/parse.h
82 distclean maintainer-clean: clean
83 rm -f pg_config.h dynloader.h pg_config_os.h stamp-h