From 1a915d1b3852c5771507710ed470547b53b1c7ec Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 26 Jan 2011 23:29:15 +1000 Subject: [PATCH] Makefile: Quote variables used as filenames in shell commands This allows support for filenames with spaces in them. --- Makefile.local | 12 ++++++------ completion/Makefile.local | 8 ++++---- emacs/Makefile.local | 8 ++++---- lib/Makefile.local | 12 ++++++------ 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Makefile.local b/Makefile.local index 3c6151cf..38ead11d 100644 --- a/Makefile.local +++ b/Makefile.local @@ -265,10 +265,10 @@ notmuch.1.gz: notmuch.1 .PHONY: install install: all notmuch.1.gz - mkdir -p $(DESTDIR)$(mandir)/man1 - install -m0644 notmuch.1.gz $(DESTDIR)$(mandir)/man1/ - mkdir -p $(DESTDIR)$(prefix)/bin/ - install notmuch-shared $(DESTDIR)$(prefix)/bin/notmuch + mkdir -p "$(DESTDIR)$(mandir)/man1" + install -m0644 notmuch.1.gz "$(DESTDIR)$(mandir)/man1/" + mkdir -p "$(DESTDIR)$(prefix)/bin/" + install notmuch-shared "$(DESTDIR)$(prefix)/bin/notmuch" ifeq ($(MAKECMDGOALS), install) @echo "" @echo "Notmuch is now installed to $(DESTDIR)$(prefix)" @@ -293,8 +293,8 @@ endif .PHONY: install-desktop install-desktop: - mkdir -p $(DESTDIR)$(desktop_dir) - desktop-file-install --mode 0644 --dir $(DESTDIR)$(desktop_dir) notmuch.desktop + mkdir -p "$(DESTDIR)$(desktop_dir)" + desktop-file-install --mode 0644 --dir "$(DESTDIR)$(desktop_dir)" notmuch.desktop SRCS := $(SRCS) $(notmuch_client_srcs) CLEAN := $(CLEAN) notmuch notmuch-shared $(notmuch_client_modules) notmuch.elc notmuch.1.gz diff --git a/completion/Makefile.local b/completion/Makefile.local index 911358da..755b0f7e 100644 --- a/completion/Makefile.local +++ b/completion/Makefile.local @@ -13,10 +13,10 @@ install: install-$(dir) install-$(dir): @echo $@ ifeq ($(WITH_BASH),1) - mkdir -p $(DESTDIR)$(bash_completion_dir) - install -m0644 $(bash_script) $(DESTDIR)$(bash_completion_dir)/notmuch + mkdir -p "$(DESTDIR)$(bash_completion_dir)" + install -m0644 $(bash_script) "$(DESTDIR)$(bash_completion_dir)/notmuch" endif ifeq ($(WITH_ZSH),1) - mkdir -p $(DESTDIR)$(zsh_completion_dir) - install -m0644 $(zsh_script) $(DESTDIR)$(zsh_completion_dir)/_notmuch + mkdir -p "$(DESTDIR)$(zsh_completion_dir)" + install -m0644 $(zsh_script) "$(DESTDIR)$(zsh_completion_dir)/_notmuch" endif diff --git a/emacs/Makefile.local b/emacs/Makefile.local index 9ea8e491..1c4166fe 100644 --- a/emacs/Makefile.local +++ b/emacs/Makefile.local @@ -32,11 +32,11 @@ endif .PHONY: install-emacs install-emacs: - mkdir -p $(DESTDIR)$(emacslispdir) - install -m0644 $(emacs_sources) $(DESTDIR)$(emacslispdir) + mkdir -p "$(DESTDIR)$(emacslispdir)" + install -m0644 $(emacs_sources) "$(DESTDIR)$(emacslispdir)" ifeq ($(HAVE_EMACS),1) - install -m0644 $(emacs_bytecode) $(DESTDIR)$(emacslispdir) + install -m0644 $(emacs_bytecode) "$(DESTDIR)$(emacslispdir)" endif - install -m0644 $(emacs_images) $(DESTDIR)$(emacslispdir) + install -m0644 $(emacs_images) "$(DESTDIR)$(emacslispdir)" CLEAN := $(CLEAN) $(emacs_bytecode) diff --git a/lib/Makefile.local b/lib/Makefile.local index 5233ea6a..f4b2c7b9 100644 --- a/lib/Makefile.local +++ b/lib/Makefile.local @@ -86,12 +86,12 @@ install: install-$(dir) # variable that is not reused. lib := $(dir) install-$(dir): - mkdir -p $(DESTDIR)$(libdir)/ - install -m0644 $(lib)/$(LIBNAME) $(DESTDIR)$(libdir)/ - ln -sf $(LIBNAME) $(DESTDIR)$(libdir)/$(SONAME) - ln -sf $(LIBNAME) $(DESTDIR)$(libdir)/$(LINKER_NAME) - mkdir -p $(DESTDIR)$(includedir) - install -m0644 $(lib)/notmuch.h $(DESTDIR)$(includedir)/ + mkdir -p "$(DESTDIR)$(libdir)/" + install -m0644 "$(lib)/$(LIBNAME)" "$(DESTDIR)$(libdir)/" + ln -sf $(LIBNAME) "$(DESTDIR)$(libdir)/$(SONAME)" + ln -sf $(LIBNAME) "$(DESTDIR)$(libdir)/$(LINKER_NAME)" + mkdir -p "$(DESTDIR)$(includedir)" + install -m0644 "$(lib)/notmuch.h" "$(DESTDIR)$(includedir)/" $(LIBRARY_INSTALL_POST_COMMAND) SRCS := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)