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.8 2001/03/01 16:17:53 petere Exp $
11 #-------------------------------------------------------------------------
15 include $(top_builddir)/src/Makefile.global
17 # Headers needed by clients
18 srcdir_headers := c.h postgres_ext.h postgres_fe.h \
19 libpq/pqcomm.h libpq/libpq-fs.h lib/dllist.h
21 builddir_headers := os.h config.h
23 HEADERS = $(srcdir_headers) $(builddir_headers)
25 # Subdirectories containing headers that install-all-headers should install
26 SUBDIRS = access bootstrap catalog commands executor lib libpq mb \
27 nodes optimizer parser port regex rewrite storage tcop utils
33 # Install only selected headers
35 install: all installdirs remove-old-headers
36 for file in $(srcdir_headers); do \
37 $(INSTALL_DATA) $(srcdir)/$$file $(DESTDIR)$(includedir)/$$file || exit; \
39 for file in $(builddir_headers); do \
40 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/$$file || exit; \
43 # Automatically pick out the needed subdirectories for the include tree.
45 $(mkinstalldirs) $(addprefix $(DESTDIR)$(includedir)/, $(sort $(dir $(HEADERS))))
50 install-all-headers: all install-all-dirs
51 for file in $(srcdir)/*.h; do \
52 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/`basename $$file` || exit; \
54 for dir in $(SUBDIRS); do \
55 for file in $(srcdir)/$$dir/*.h; do \
56 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/$$dir/`basename $$file` || exit; \
59 for file in $(builddir_headers); do \
60 $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/$$file || exit; \
64 $(mkinstalldirs) $(addprefix $(DESTDIR)$(includedir)/, $(SUBDIRS))
67 # Pre-7.1 Postgres installed some headers that are no longer installed by
68 # default. If we see these headers in the target directory, zap them to
69 # avoid cross-version compile problems. However, don't zap them if they
70 # match current sources (that means the user did install-all-headers).
73 for file in fmgr.h postgres.h access/attnum.h commands/trigger.h \
74 executor/spi.h utils/elog.h utils/geo_decls.h utils/mcxt.h \
76 if cmp -s $(srcdir)/$$file $(DESTDIR)$(includedir)/$$file; \
80 rm -f $(DESTDIR)$(includedir)/$$file; \
85 # This isn't a complete uninstall, but rm'ing everything under
86 # $(DESTDIR)$(includedir) is probably too drastic...
88 rm -rf $(addprefix $(DESTDIR)$(includedir)/, $(HEADERS) $(SUBDIRS))
91 rm -f utils/fmgroids.h parser/parse.h
93 distclean maintainer-clean: clean
94 rm -f config.h dynloader.h os.h stamp-h