]> granicus.if.org Git - postgresql/blob - src/include/Makefile
Add --help-config facility to dump information about GUC parameters
[postgresql] / src / include / Makefile
1 #-------------------------------------------------------------------------
2 #
3 # Makefile for src/include
4 #
5 # 'make install' installs only those headers needed for client-side
6 # programming.  'make install-all-headers' installs the whole contents
7 # of src/include.
8 #
9 # $Header: /cvsroot/pgsql/src/include/Makefile,v 1.10 2001/08/28 14:20:28 petere Exp $
10 #
11 #-------------------------------------------------------------------------
12
13 subdir = src/include
14 top_builddir = ../..
15 include $(top_builddir)/src/Makefile.global
16
17
18 all: pg_config.h pg_config_os.h
19
20
21 # Install only selected headers
22
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
34
35 installdirs:
36         $(mkinstalldirs) $(DESTDIR)$(includedir)/libpq $(DESTDIR)$(includedir_internal)/libpq $(DESTDIR)$(includedir_internal)/lib
37
38
39 # Install all headers
40
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
44
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; \
50         done
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; \
54           done \
55         done
56
57 install-all-dirs:
58         $(mkinstalldirs) $(addprefix $(DESTDIR)$(includedir_server)/, $(SUBDIRS))
59
60
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).
65
66 remove-old-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 \
69                 utils/palloc.h; do \
70                 if cmp -s $(srcdir)/$$file $(DESTDIR)$(includedir)/$$file; \
71                 then \
72                         : ; \
73                 else \
74                         rm -f $(DESTDIR)$(includedir)/$$file; \
75                 fi ; \
76         done
77
78
79 uninstall:
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)
82 # heuristic...
83         rm -rf $(addprefix $(DESTDIR)$(includedir_server)/, $(SUBDIRS) *.h)
84
85
86 clean:
87         rm -f utils/fmgroids.h parser/parse.h
88
89 distclean maintainer-clean: clean
90         rm -f pg_config.h dynloader.h pg_config_os.h stamp-h