aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-04-28 14:02:57 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-04-28 14:02:57 -0400
commitbc19b7836215b1a847524041a1bd138d7bb5cbef (patch)
tree1e27625c219affefa8cb447c36f9dbb0eefba217
parent4094031dd3392b2f49b190a5617d0c247167bcf6 (diff)
downloadpostgresql-bc19b7836215b1a847524041a1bd138d7bb5cbef.tar.gz
postgresql-bc19b7836215b1a847524041a1bd138d7bb5cbef.zip
Minor cleanups for install_llvm_module/uninstall_llvm_module Make macros.
Don't put comments inside the macros, per complaint from Michael Paquier. Quote target directory path with single quotes, not double; that seems to be our project standard. Not quoting it at all definitely isn't per standard. Remove excess slash in one instance of path. Remove useless semicolon. Discussion: https://postgr.es/m/20180428073935.GB1736@paquier.xyz
-rw-r--r--src/Makefile.global.in19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 252920279fc..ab64038e675 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -1017,19 +1017,14 @@ endif
# $(1) name of the module (e.g. an extension's name or postgres for core code)
# $(2) source objects, with .o suffix
#
-define install_llvm_module
-# Create target directory
-$(MKDIR_P) "$(DESTDIR)${bitcodedir}/$(1)"
-# Create sub-directories, if files are in subdirectories
-$(MKDIR_P) $(sort $(dir $(addprefix $(DESTDIR)${bitcodedir}/$(1)/, $(2))))
-# Then install files
-#
# 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.
-$(foreach obj, ${2}, $(INSTALL_DATA) $(patsubst %.o,%.bc, $(obj)) $(DESTDIR)/${bitcodedir}/$(1)/$(dir $(obj));
+define install_llvm_module
+$(MKDIR_P) '$(DESTDIR)${bitcodedir}/$(1)'
+$(MKDIR_P) $(sort $(dir $(addprefix '$(DESTDIR)${bitcodedir}'/$(1)/, $(2))))
+$(foreach obj, ${2}, $(INSTALL_DATA) $(patsubst %.o,%.bc, $(obj)) '$(DESTDIR)${bitcodedir}'/$(1)/$(dir $(obj))
)
-# and generate index
-(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
# Uninstall LLVM bitcode module.
@@ -1040,6 +1035,6 @@ endef
# This intentionally doesn't use the explicit installed file list,
# seems too likely to change regularly.
define uninstall_llvm_module
-rm -rf "$(DESTDIR)${bitcodedir}/$(1)/"
-rm -f "$(DESTDIR)${bitcodedir}/$(1).index.bc"
+rm -rf '$(DESTDIR)${bitcodedir}/$(1)/'
+rm -f '$(DESTDIR)${bitcodedir}/$(1).index.bc'
endef