]> granicus.if.org Git - postgresql/blobdiff - src/include/Makefile
Change the declaration of struct varlena so that the length word is
[postgresql] / src / include / Makefile
index 7d8a3e5b7f52f7eb9121131ef3da89a6a72ec90b..e21dc57641623dfaf20d24dc98b68eced7e2be38 100644 (file)
@@ -2,11 +2,9 @@
 #
 # Makefile for src/include
 #
-# 'make install' installs only those headers needed for client-side
-# programming.  'make install-all-headers' installs the whole contents
-# of src/include.
+# 'make install' installs whole contents of src/include.
 #
-# $Header: /cvsroot/pgsql/src/include/Makefile,v 1.8 2001/03/01 16:17:53 petere Exp $
+# $PostgreSQL: pgsql/src/include/Makefile,v 1.23 2007/10/14 17:07:51 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -14,81 +12,55 @@ subdir = src/include
 top_builddir = ../..
 include $(top_builddir)/src/Makefile.global
 
-# Headers needed by clients
-srcdir_headers := c.h postgres_ext.h postgres_fe.h \
-       libpq/pqcomm.h libpq/libpq-fs.h lib/dllist.h
 
-builddir_headers := os.h config.h
+all: pg_config.h pg_config_os.h
 
-HEADERS = $(srcdir_headers) $(builddir_headers)
 
-# Subdirectories containing headers that install-all-headers should install
+# Subdirectories containing headers for server-side dev
 SUBDIRS = access bootstrap catalog commands executor lib libpq mb \
-       nodes optimizer parser port regex rewrite storage tcop utils
-
-
-all: $(HEADERS)
-
-
-# Install only selected headers
-
-install: all installdirs remove-old-headers
-       for file in $(srcdir_headers); do \
-         $(INSTALL_DATA) $(srcdir)/$$file $(DESTDIR)$(includedir)/$$file || exit; \
-       done
-       for file in $(builddir_headers); do \
-         $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/$$file || exit; \
-       done
-
-# Automatically pick out the needed subdirectories for the include tree.
-installdirs:
-       $(mkinstalldirs) $(addprefix $(DESTDIR)$(includedir)/, $(sort $(dir $(HEADERS))))
-
+       nodes optimizer parser postmaster regex rewrite storage tcop \
+       snowball snowball/libstemmer tsearch tsearch/dicts utils \
+       port port/win32 port/win32_msvc port/win32_msvc/sys \
+       port/win32/arpa port/win32/netinet port/win32/sys
 
 # Install all headers
-
-install-all-headers: all install-all-dirs
-       for file in $(srcdir)/*.h; do \
-         $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/`basename $$file` || exit; \
-       done
+install: all installdirs
+# These headers are needed by the public headers of the interfaces.
+       $(INSTALL_DATA) $(srcdir)/postgres_ext.h   '$(DESTDIR)$(includedir)'
+       $(INSTALL_DATA) $(srcdir)/libpq/libpq-fs.h '$(DESTDIR)$(includedir)/libpq'
+       $(INSTALL_DATA) pg_config.h    '$(DESTDIR)$(includedir)'
+       $(INSTALL_DATA) pg_config_os.h '$(DESTDIR)$(includedir)'
+       $(INSTALL_DATA) $(srcdir)/pg_config_manual.h '$(DESTDIR)$(includedir)'
+# These headers are needed by the not-so-public headers of the interfaces.
+       $(INSTALL_DATA) $(srcdir)/c.h            '$(DESTDIR)$(includedir_internal)'
+       $(INSTALL_DATA) $(srcdir)/port.h         '$(DESTDIR)$(includedir_internal)'
+       $(INSTALL_DATA) $(srcdir)/postgres_fe.h  '$(DESTDIR)$(includedir_internal)'
+       $(INSTALL_DATA) $(srcdir)/libpq/pqcomm.h '$(DESTDIR)$(includedir_internal)/libpq'
+# These headers are needed for server-side development
+       $(INSTALL_DATA) pg_config.h    '$(DESTDIR)$(includedir_server)'
+       $(INSTALL_DATA) pg_config_os.h '$(DESTDIR)$(includedir_server)'
+# We don't use INSTALL_DATA for performance reasons --- there are a lot of files
+       cp $(srcdir)/*.h '$(DESTDIR)$(includedir_server)'/ || exit; \
+       chmod $(INSTALL_DATA_MODE) '$(DESTDIR)$(includedir_server)'/*.h  || exit; \
        for dir in $(SUBDIRS); do \
-         for file in $(srcdir)/$$dir/*.h; do \
-           $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/$$dir/`basename $$file` || exit; \
-         done \
-       done
-       for file in $(builddir_headers); do \
-         $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/$$file || exit; \
+         cp $(srcdir)/$$dir/*.h '$(DESTDIR)$(includedir_server)'/$$dir/ || exit; \
+         chmod $(INSTALL_DATA_MODE) '$(DESTDIR)$(includedir_server)'/$$dir/*.h  || exit; \
        done
 
-install-all-dirs:
-       $(mkinstalldirs) $(addprefix $(DESTDIR)$(includedir)/, $(SUBDIRS))
-
-
-# Pre-7.1 Postgres installed some headers that are no longer installed by
-# default.  If we see these headers in the target directory, zap them to
-# avoid cross-version compile problems.  However, don't zap them if they
-# match current sources (that means the user did install-all-headers).
-
-remove-old-headers:
-       for file in fmgr.h postgres.h access/attnum.h commands/trigger.h \
-               executor/spi.h utils/elog.h utils/geo_decls.h utils/mcxt.h \
-               utils/palloc.h; do \
-               if cmp -s $(srcdir)/$$file $(DESTDIR)$(includedir)/$$file; \
-               then \
-                       : ; \
-               else \
-                       rm -f $(DESTDIR)$(includedir)/$$file; \
-               fi ; \
-       done
+installdirs:
+       $(mkinstalldirs) '$(DESTDIR)$(includedir)/libpq' '$(DESTDIR)$(includedir_internal)/libpq'
+       $(mkinstalldirs) $(addprefix '$(DESTDIR)$(includedir_server)'/, $(SUBDIRS))
 
 
-# This isn't a complete uninstall, but rm'ing everything under
-# $(DESTDIR)$(includedir) is probably too drastic...
 uninstall:
-       rm -rf $(addprefix $(DESTDIR)$(includedir)/, $(HEADERS) $(SUBDIRS))
+       rm -f $(addprefix '$(DESTDIR)$(includedir)'/, pg_config.h pg_config_os.h pg_config_manual.h postgres_ext.h libpq/libpq-fs.h)
+       rm -f $(addprefix '$(DESTDIR)$(includedir_internal)'/, c.h port.h postgres_fe.h libpq/pqcomm.h)
+# heuristic...
+       rm -rf $(addprefix '$(DESTDIR)$(includedir_server)'/, $(SUBDIRS) *.h)
+
 
 clean:
        rm -f utils/fmgroids.h parser/parse.h
 
 distclean maintainer-clean: clean
-       rm -f config.h dynloader.h os.h stamp-h
+       rm -f pg_config.h dynloader.h pg_config_os.h stamp-h