Use normal install program to install server headers.
authorHeikki Linnakangas <[email protected]>
Mon, 12 Sep 2022 19:33:59 +0000 (22:33 +0300)
committerHeikki Linnakangas <[email protected]>
Mon, 12 Sep 2022 19:33:59 +0000 (22:33 +0300)
Commit a7032690f9 replaced $(INSTALL) with plain "cp" for installing the
server header files. It sped up "make install" significantly, because
the old logic called $(INSTALL) separately for every header file,
whereas plain "cp" could copy all the files in one command. However, we
have long since made it a requirement that $(INSTALL) can also install
multiple files in one command, see commit f1c5247563. Switch back to
$(INSTALL).

Discussion: https://www.postgresql.org/message-id/200503252305.j2PN52m23610%40candle.pha.pa.us
Discussion: https://www.postgresql.org/message-id/2415283.1641852217%40sss.pgh.pa.us

src/include/Makefile

index 0b4cab9bb11c8cbed7e0232f2895363d765c38a9..1e5040061707624fdb73ecfb6fe0cb9e0fe37348 100644 (file)
@@ -48,22 +48,15 @@ install: all installdirs
    $(INSTALL_DATA) utils/errcodes.h '$(DESTDIR)$(includedir_server)/utils'
    $(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
-# (in fact, we have to take some pains to avoid overlength shell commands here)
-   cp $(srcdir)/*.h '$(DESTDIR)$(includedir_server)'/
+   $(INSTALL_DATA) $(srcdir)/*.h '$(DESTDIR)$(includedir_server)'
    for dir in $(SUBDIRS); do \
-     cp $(srcdir)/$$dir/*.h '$(DESTDIR)$(includedir_server)'/$$dir/ || exit; \
+     $(INSTALL_DATA) $(srcdir)/$$dir/*.h '$(DESTDIR)$(includedir_server)'/$$dir || exit; \
    done
 ifeq ($(vpath_build),yes)
    for file in catalog/schemapg.h catalog/system_fk_info.h catalog/pg_*_d.h parser/gram.h storage/lwlocknames.h utils/probes.h; do \
-     cp $$file '$(DESTDIR)$(includedir_server)'/$$file || exit; \
+     $(INSTALL_DATA) $$file '$(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'