Commit f2bb32db authored by Tom Lane's avatar Tom Lane

Un-break contrib install with llvm.

Apparently $(foreach ... $(call install_llvm_module,...)) doesn't work
too well without a blank line ending the install_llvm_module macro.
The previous coding hackishly dodged this problem with some parens,
but that's not really a good solution because make misunderstands
where the command boundaries are that way.

Discussion: https://postgr.es/m/20180428073935.GB1736@paquier.xyz
parent bc19b783
...@@ -1019,12 +1019,15 @@ endif ...@@ -1019,12 +1019,15 @@ endif
# #
# The many INSTALL_DATA invocations aren't particularly fast, it'd be # The many INSTALL_DATA invocations aren't particularly fast, it'd be
# good if we could coalesce them, but I didn't find a good way. # good if we could coalesce them, but I didn't find a good way.
#
# Note: blank line at end of macro is necessary to let it be used in foreach
define install_llvm_module define install_llvm_module
$(MKDIR_P) '$(DESTDIR)${bitcodedir}/$(1)' $(MKDIR_P) '$(DESTDIR)${bitcodedir}/$(1)'
$(MKDIR_P) $(sort $(dir $(addprefix '$(DESTDIR)${bitcodedir}'/$(1)/, $(2)))) $(MKDIR_P) $(sort $(dir $(addprefix '$(DESTDIR)${bitcodedir}'/$(1)/, $(2))))
$(foreach obj, ${2}, $(INSTALL_DATA) $(patsubst %.o,%.bc, $(obj)) '$(DESTDIR)${bitcodedir}'/$(1)/$(dir $(obj)) $(foreach obj, ${2}, $(INSTALL_DATA) $(patsubst %.o,%.bc, $(obj)) '$(DESTDIR)${bitcodedir}'/$(1)/$(dir $(obj))
) )
cd '$(DESTDIR)${bitcodedir}' && $(LLVM_BINPATH)/llvm-lto -thinlto -thinlto-action=thinlink -o $(1).index.bc $(addprefix $(1)/,$(patsubst %.o,%.bc, $(2))) cd '$(DESTDIR)${bitcodedir}' && $(LLVM_BINPATH)/llvm-lto -thinlto -thinlto-action=thinlink -o $(1).index.bc $(addprefix $(1)/,$(patsubst %.o,%.bc, $(2)))
endef endef
# Uninstall LLVM bitcode module. # Uninstall LLVM bitcode module.
...@@ -1037,4 +1040,5 @@ endef ...@@ -1037,4 +1040,5 @@ endef
define uninstall_llvm_module define uninstall_llvm_module
rm -rf '$(DESTDIR)${bitcodedir}/$(1)/' rm -rf '$(DESTDIR)${bitcodedir}/$(1)/'
rm -f '$(DESTDIR)${bitcodedir}/$(1).index.bc' rm -f '$(DESTDIR)${bitcodedir}/$(1).index.bc'
endef endef
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment