diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 99faf46b80cfac46edda56e6b001ecebdd3666e6..475902bc470fd4a3611dca1fa6968f525e5af9b4 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -1,5 +1,5 @@
 # -*-makefile-*-
-# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.212 2005/03/25 18:17:12 momjian Exp $
+# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.213 2005/03/25 23:22:53 momjian Exp $
 
 #------------------------------------------------------------------------------
 # All PostgreSQL makefiles include this file and use the variables it sets,
@@ -232,9 +232,11 @@ BZIP2	= bzip2
 
 INSTALL	= $(SHELL) $(top_srcdir)/config/install-sh -c
 
+INSTALL_SCRIPT_MODE	= 755
+INSTALL_DATA_MODE	= 644
 INSTALL_PROGRAM	= $(INSTALL_PROGRAM_ENV) $(INSTALL) $(INSTALL_STRIP_FLAG)
-INSTALL_SCRIPT	= $(INSTALL) -m 755
-INSTALL_DATA	= $(INSTALL) -m 644
+INSTALL_SCRIPT	= $(INSTALL) -m $(INSTALL_SCRIPT_MODE)
+INSTALL_DATA	= $(INSTALL) -m $(INSTALL_DATA_MODE)
 INSTALL_STLIB	= $(INSTALL_STLIB_ENV) $(INSTALL_DATA) $(INSTALL_STRIP_FLAG)
 INSTALL_SHLIB	= $(INSTALL_SHLIB_ENV) $(INSTALL) $(INSTALL_SHLIB_OPTS) $(INSTALL_STRIP_FLAG)
 # Override in Makefile.port if necessary
diff --git a/src/include/Makefile b/src/include/Makefile
index 0471869407e7947c33ad50ea68ec3130a317117d..beff38e489664b7db490af9412a0a38b484a7885 100644
--- a/src/include/Makefile
+++ b/src/include/Makefile
@@ -4,7 +4,7 @@
 #
 # 'make install' installs whole contents of src/include.
 #
-# $PostgreSQL: pgsql/src/include/Makefile,v 1.19 2005/01/06 21:00:24 tgl Exp $
+# $PostgreSQL: pgsql/src/include/Makefile,v 1.20 2005/03/25 23:22:54 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -37,13 +37,12 @@ install: all installdirs
 # 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)
-	for file in $(srcdir)/*.h; do \
-	  $(INSTALL_DATA) $$file $(DESTDIR)$(includedir_server)/`basename $$file` || exit; \
-	done
+# 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_server)/$$dir/`basename $$file` || exit; \
-	  done \
+	  cp $(srcdir)/$$dir/*.h $(DESTDIR)$(includedir_server)/$$dir/ || exit; \
+	  chmod $(INSTALL_DATA_MODE) $(DESTDIR)$(includedir_server)/$$dir/*.h  || exit; \
 	done
 
 installdirs: