Rewrite installation makefile rules without for loops

install-sh can install multiple files at once, so for loops are not
necessary.  This was already changed for the rest of the code some
time ago, but pgxs.mk was apparently forgotten, and the obsolete
coding style has now been copied to the PLs as well.

This also fixes the problem that the for loops in question did not
catch errors.
This commit is contained in:
Peter Eisentraut 2011-05-02 00:37:07 +03:00
parent 83b7584944
commit b106195b17
5 changed files with 11 additions and 44 deletions

View File

@ -103,51 +103,30 @@ endif # MODULE_big
install: all installdirs install: all installdirs
ifneq (,$(EXTENSION)) ifneq (,$(EXTENSION))
@for file in $(addprefix $(srcdir)/, $(addsuffix .control, $(EXTENSION))); do \ $(INSTALL_DATA) $(addprefix $(srcdir)/, $(addsuffix .control, $(EXTENSION))) '$(DESTDIR)$(datadir)/extension/'
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'"; \
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'; \
done
endif # EXTENSION endif # EXTENSION
ifneq (,$(DATA)$(DATA_built)) ifneq (,$(DATA)$(DATA_built))
@for file in $(addprefix $(srcdir)/, $(DATA)) $(DATA_built); do \ $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) $(DATA_built) '$(DESTDIR)$(datadir)/$(datamoduledir)/'
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'"; \
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'; \
done
endif # DATA endif # DATA
ifneq (,$(DATA_TSEARCH)) ifneq (,$(DATA_TSEARCH))
@for file in $(addprefix $(srcdir)/, $(DATA_TSEARCH)); do \ $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA_TSEARCH)) '$(DESTDIR)$(datadir)/tsearch_data/'
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/tsearch_data'"; \
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/tsearch_data'; \
done
endif # DATA_TSEARCH endif # DATA_TSEARCH
ifdef MODULES ifdef MODULES
@for file in $(addsuffix $(DLSUFFIX), $(MODULES)); do \ $(INSTALL_SHLIB) $(addsuffix $(DLSUFFIX), $(MODULES)) '$(DESTDIR)$(pkglibdir)/'
echo "$(INSTALL_SHLIB) $$file '$(DESTDIR)$(pkglibdir)'"; \
$(INSTALL_SHLIB) $$file '$(DESTDIR)$(pkglibdir)'; \
done
endif # MODULES endif # MODULES
ifdef DOCS ifdef DOCS
ifdef docdir ifdef docdir
@for file in $(addprefix $(srcdir)/, $(DOCS)); do \ $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DOCS)) '$(DESTDIR)$(docdir)/$(docmoduledir)/'
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(docdir)/$(docmoduledir)'"; \
$(INSTALL_DATA) $$file '$(DESTDIR)$(docdir)/$(docmoduledir)'; \
done
endif # docdir endif # docdir
endif # DOCS endif # DOCS
ifdef PROGRAM ifdef PROGRAM
$(INSTALL_PROGRAM) $(PROGRAM)$(X) '$(DESTDIR)$(bindir)' $(INSTALL_PROGRAM) $(PROGRAM)$(X) '$(DESTDIR)$(bindir)'
endif # PROGRAM endif # PROGRAM
ifdef SCRIPTS ifdef SCRIPTS
@for file in $(addprefix $(srcdir)/, $(SCRIPTS)); do \ $(INSTALL_SCRIPT) $(addprefix $(srcdir)/, $(SCRIPTS)) '$(DESTDIR)$(bindir)/'
echo "$(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'"; \
$(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'; \
done
endif # SCRIPTS endif # SCRIPTS
ifdef SCRIPTS_built ifdef SCRIPTS_built
@for file in $(SCRIPTS_built); do \ $(INSTALL_SCRIPT) $(SCRIPTS_built) '$(DESTDIR)$(bindir)/'
echo "$(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'"; \
$(INSTALL_SCRIPT) $$file '$(DESTDIR)$(bindir)'; \
done
endif # SCRIPTS_built endif # SCRIPTS_built
ifdef MODULE_big ifdef MODULE_big

View File

@ -82,10 +82,7 @@ installdirs: installdirs-lib
uninstall: uninstall-lib uninstall-data uninstall: uninstall-lib uninstall-data
install-data: installdirs install-data: installdirs
@for file in $(addprefix $(srcdir)/, $(DATA)); do \ $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/'
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'"; \
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'; \
done
uninstall-data: uninstall-data:
rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA))) rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA)))

View File

@ -35,10 +35,7 @@ installdirs: installdirs-lib
uninstall: uninstall-lib uninstall-data uninstall: uninstall-lib uninstall-data
install-data: installdirs install-data: installdirs
@for file in $(addprefix $(srcdir)/, $(DATA)); do \ $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/'
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'"; \
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'; \
done
uninstall-data: uninstall-data:
rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA))) rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA)))

View File

@ -114,10 +114,7 @@ installdirs: installdirs-lib
uninstall: uninstall-lib uninstall-data uninstall: uninstall-lib uninstall-data
install-data: installdirs install-data: installdirs
@for file in $(addprefix $(srcdir)/, $(DATA)); do \ $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/'
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'"; \
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'; \
done
uninstall-data: uninstall-data:
rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA))) rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA)))

View File

@ -65,10 +65,7 @@ uninstall: uninstall-lib uninstall-data
$(MAKE) -C modules $@ $(MAKE) -C modules $@
install-data: installdirs install-data: installdirs
@for file in $(addprefix $(srcdir)/, $(DATA)); do \ $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/'
echo "$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'"; \
$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/extension'; \
done
uninstall-data: uninstall-data:
rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA))) rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA)))