Makefile: Quote variables used as filenames in shell commands

This allows support for filenames with spaces in them.
This commit is contained in:
Carl Worth 2011-01-26 23:29:15 +10:00
parent b4b5e9ce4d
commit 1a915d1b38
4 changed files with 20 additions and 20 deletions

View file

@ -265,10 +265,10 @@ notmuch.1.gz: notmuch.1
.PHONY: install .PHONY: install
install: all notmuch.1.gz install: all notmuch.1.gz
mkdir -p $(DESTDIR)$(mandir)/man1 mkdir -p "$(DESTDIR)$(mandir)/man1"
install -m0644 notmuch.1.gz $(DESTDIR)$(mandir)/man1/ install -m0644 notmuch.1.gz "$(DESTDIR)$(mandir)/man1/"
mkdir -p $(DESTDIR)$(prefix)/bin/ mkdir -p "$(DESTDIR)$(prefix)/bin/"
install notmuch-shared $(DESTDIR)$(prefix)/bin/notmuch install notmuch-shared "$(DESTDIR)$(prefix)/bin/notmuch"
ifeq ($(MAKECMDGOALS), install) ifeq ($(MAKECMDGOALS), install)
@echo "" @echo ""
@echo "Notmuch is now installed to $(DESTDIR)$(prefix)" @echo "Notmuch is now installed to $(DESTDIR)$(prefix)"
@ -293,8 +293,8 @@ endif
.PHONY: install-desktop .PHONY: install-desktop
install-desktop: install-desktop:
mkdir -p $(DESTDIR)$(desktop_dir) mkdir -p "$(DESTDIR)$(desktop_dir)"
desktop-file-install --mode 0644 --dir $(DESTDIR)$(desktop_dir) notmuch.desktop desktop-file-install --mode 0644 --dir "$(DESTDIR)$(desktop_dir)" notmuch.desktop
SRCS := $(SRCS) $(notmuch_client_srcs) SRCS := $(SRCS) $(notmuch_client_srcs)
CLEAN := $(CLEAN) notmuch notmuch-shared $(notmuch_client_modules) notmuch.elc notmuch.1.gz CLEAN := $(CLEAN) notmuch notmuch-shared $(notmuch_client_modules) notmuch.elc notmuch.1.gz

View file

@ -13,10 +13,10 @@ install: install-$(dir)
install-$(dir): install-$(dir):
@echo $@ @echo $@
ifeq ($(WITH_BASH),1) ifeq ($(WITH_BASH),1)
mkdir -p $(DESTDIR)$(bash_completion_dir) mkdir -p "$(DESTDIR)$(bash_completion_dir)"
install -m0644 $(bash_script) $(DESTDIR)$(bash_completion_dir)/notmuch install -m0644 $(bash_script) "$(DESTDIR)$(bash_completion_dir)/notmuch"
endif endif
ifeq ($(WITH_ZSH),1) ifeq ($(WITH_ZSH),1)
mkdir -p $(DESTDIR)$(zsh_completion_dir) mkdir -p "$(DESTDIR)$(zsh_completion_dir)"
install -m0644 $(zsh_script) $(DESTDIR)$(zsh_completion_dir)/_notmuch install -m0644 $(zsh_script) "$(DESTDIR)$(zsh_completion_dir)/_notmuch"
endif endif

View file

@ -32,11 +32,11 @@ endif
.PHONY: install-emacs .PHONY: install-emacs
install-emacs: install-emacs:
mkdir -p $(DESTDIR)$(emacslispdir) mkdir -p "$(DESTDIR)$(emacslispdir)"
install -m0644 $(emacs_sources) $(DESTDIR)$(emacslispdir) install -m0644 $(emacs_sources) "$(DESTDIR)$(emacslispdir)"
ifeq ($(HAVE_EMACS),1) ifeq ($(HAVE_EMACS),1)
install -m0644 $(emacs_bytecode) $(DESTDIR)$(emacslispdir) install -m0644 $(emacs_bytecode) "$(DESTDIR)$(emacslispdir)"
endif endif
install -m0644 $(emacs_images) $(DESTDIR)$(emacslispdir) install -m0644 $(emacs_images) "$(DESTDIR)$(emacslispdir)"
CLEAN := $(CLEAN) $(emacs_bytecode) CLEAN := $(CLEAN) $(emacs_bytecode)

View file

@ -86,12 +86,12 @@ install: install-$(dir)
# variable that is not reused. # variable that is not reused.
lib := $(dir) lib := $(dir)
install-$(dir): install-$(dir):
mkdir -p $(DESTDIR)$(libdir)/ mkdir -p "$(DESTDIR)$(libdir)/"
install -m0644 $(lib)/$(LIBNAME) $(DESTDIR)$(libdir)/ install -m0644 "$(lib)/$(LIBNAME)" "$(DESTDIR)$(libdir)/"
ln -sf $(LIBNAME) $(DESTDIR)$(libdir)/$(SONAME) ln -sf $(LIBNAME) "$(DESTDIR)$(libdir)/$(SONAME)"
ln -sf $(LIBNAME) $(DESTDIR)$(libdir)/$(LINKER_NAME) ln -sf $(LIBNAME) "$(DESTDIR)$(libdir)/$(LINKER_NAME)"
mkdir -p $(DESTDIR)$(includedir) mkdir -p "$(DESTDIR)$(includedir)"
install -m0644 $(lib)/notmuch.h $(DESTDIR)$(includedir)/ install -m0644 "$(lib)/notmuch.h" "$(DESTDIR)$(includedir)/"
$(LIBRARY_INSTALL_POST_COMMAND) $(LIBRARY_INSTALL_POST_COMMAND)
SRCS := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs) SRCS := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)