From cca563f38422f2a7c6c56f162efe2689bf1c7697 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 8 Apr 2018 15:08:32 -0400 Subject: [PATCH] Reduce worst-case shell command line length during "make install". Addition of the catalog/pg_foo_d.h headers seems to have pushed us over the brink of the maximum command line length for some older platforms during "make install" for our header files. The main culprit here is repetition of the target directory path, which could be long. Rearrange so that we don't repeat that once per file, but only once per subdirectory. Per buildfarm. Discussion: https://postgr.es/m/E1f5Dwm-0004n5-7O@gemulon.postgresql.org --- src/include/Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/include/Makefile b/src/include/Makefile index 59e18c73d71..19d2524e531 100644 --- a/src/include/Makefile +++ b/src/include/Makefile @@ -47,18 +47,21 @@ install: all installdirs $(INSTALL_DATA) utils/fmgroids.h '$(DESTDIR)$(includedir_server)/utils' $(INSTALL_DATA) utils/fmgrprotos.h '$(DESTDIR)$(includedir_server)/utils' # 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; \ +# (in fact, we have to take some pains to avoid overlength shell commands here) + cp $(srcdir)/*.h '$(DESTDIR)$(includedir_server)'/ for dir in $(SUBDIRS); do \ cp $(srcdir)/$$dir/*.h '$(DESTDIR)$(includedir_server)'/$$dir/ || exit; \ - chmod $(INSTALL_DATA_MODE) '$(DESTDIR)$(includedir_server)'/$$dir/*.h || exit; \ done ifeq ($(vpath_build),yes) for file in dynloader.h catalog/schemapg.h catalog/pg_*_d.h parser/gram.h storage/lwlocknames.h utils/probes.h; do \ cp $$file '$(DESTDIR)$(includedir_server)'/$$file || exit; \ - chmod $(INSTALL_DATA_MODE) '$(DESTDIR)$(includedir_server)'/$$file || exit; \ done endif + cd '$(DESTDIR)$(includedir_server)' && chmod $(INSTALL_DATA_MODE) *.h + for dir in $(SUBDIRS); do \ + cd '$(DESTDIR)$(includedir_server)'/$$dir || exit; \ + chmod $(INSTALL_DATA_MODE) *.h || exit; \ + done installdirs: $(MKDIR_P) '$(DESTDIR)$(includedir)/libpq' '$(DESTDIR)$(includedir_internal)/libpq' -- 2.30.2