[PATCH] vim: simplify build

Tomi Ollila tomi.ollila at iki.fi
Wed Apr 18 06:11:02 PDT 2012


On Wed, Apr 18 2012, Felipe Contreras <felipe.contreras at gmail.com> wrote:

> There should be no functional changes, except that you don't need to
> make the directories before installing.
>
> Signed-off-by: Felipe Contreras <felipe.contreras at gmail.com>
> ---

Hmm, Where is $(PWD) make variable documented; I found only $(CURDIR)
anyway, te following test makefile works OK.

all:
        echo $(PWD)
        echo $(CURDIR)

(i.e. both echo the current directory)

If this is not an issue, then LGTM.

Tomi

>  vim/Makefile |   19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/vim/Makefile b/vim/Makefile
> index 89e18be..e7b7faa 100644
> --- a/vim/Makefile
> +++ b/vim/Makefile
> @@ -1,11 +1,11 @@
>  .PHONY: all help install link symlink
>  
> -FILES     = plugin/notmuch.vim \
> -	    $(wildcard syntax/notmuch-*.vim)
> +files = plugin/notmuch.vim \
> +	$(wildcard syntax/notmuch-*.vim)
> +prefix = $(HOME)/.vim
> +destdir = $(prefix)/plugin
>  
> -PREFIX    = $(shell ls -d ~/.vim/)
> -
> -OUT_FILES = $(FILES:%=${PREFIX}/%)
> +INSTALL = install -D -m644
>  
>  all: help
>  
> @@ -16,9 +16,8 @@ help:
>  	@echo "    make install     - copy plugin scripts and syntax files to ~/.vim"
>  	@echo "    make symlink     - create symlinks in ~/.vim (useful for development)"
>  
> -install: ${OUT_FILES}
> -link symlink:
> -	${MAKE} SYMLINK=1 install
> +install:
> +	@for x in $(files); do $(INSTALL) $(PWD)/$$x $(prefix)/$$x; done
>  
> -${OUT_FILES}: ${PREFIX}/%: %
> -	$(if ${SYMLINK},ln -fs,cp) `pwd`/$< $@
> +link symlink: INSTALL = ln -fs
> +link symlink: install
> -- 
> 1.7.10
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list