* [PATCH] vim: simplify build
@ 2012-04-18 12:11 Felipe Contreras
2012-04-18 13:11 ` Tomi Ollila
0 siblings, 1 reply; 8+ messages in thread
From: Felipe Contreras @ 2012-04-18 12:11 UTC (permalink / raw)
To: notmuch
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@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] vim: simplify build
2012-04-18 12:11 [PATCH] vim: simplify build Felipe Contreras
@ 2012-04-18 13:11 ` Tomi Ollila
2012-04-18 13:41 ` Felipe Contreras
0 siblings, 1 reply; 8+ messages in thread
From: Tomi Ollila @ 2012-04-18 13:11 UTC (permalink / raw)
To: Felipe Contreras, notmuch
On Wed, Apr 18 2012, Felipe Contreras <felipe.contreras@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@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@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] vim: simplify build
2012-04-18 13:11 ` Tomi Ollila
@ 2012-04-18 13:41 ` Felipe Contreras
2012-04-18 14:58 ` David Bremner
0 siblings, 1 reply; 8+ messages in thread
From: Felipe Contreras @ 2012-04-18 13:41 UTC (permalink / raw)
To: Tomi Ollila; +Cc: notmuch
On Wed, Apr 18, 2012 at 4:11 PM, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> On Wed, Apr 18 2012, Felipe Contreras <felipe.contreras@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@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.
I don't know, I have always used $(PWD), unless anybody else prefers
$(CURDIR), I'll push that.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] vim: simplify build
2012-04-18 13:41 ` Felipe Contreras
@ 2012-04-18 14:58 ` David Bremner
2012-04-18 15:40 ` Tomi Ollila
0 siblings, 1 reply; 8+ messages in thread
From: David Bremner @ 2012-04-18 14:58 UTC (permalink / raw)
To: Felipe Contreras, Tomi Ollila; +Cc: notmuch
Felipe Contreras <felipe.contreras@gmail.com> writes:
>> If this is not an issue, then LGTM.
>
> I don't know, I have always used $(PWD), unless anybody else prefers
> $(CURDIR), I'll push that.
I think CURDIR is better; if only because it is the standard (GNU) make
way of doing things [1]. I'm not sure if there is a functional
difference or not. At least CURDIR definitely works with make -C [2]
d
[1]: http://www.gnu.org/software/make/manual/make.html#Recursion
[2]: http://www.gnu.org/software/make/manual/make.html#Options-Summary
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] vim: simplify build
2012-04-18 14:58 ` David Bremner
@ 2012-04-18 15:40 ` Tomi Ollila
2012-04-18 15:57 ` Felipe Contreras
0 siblings, 1 reply; 8+ messages in thread
From: Tomi Ollila @ 2012-04-18 15:40 UTC (permalink / raw)
To: David Bremner, Felipe Contreras; +Cc: notmuch
On Wed, Apr 18 2012, David Bremner <david@tethera.net> wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>>> If this is not an issue, then LGTM.
>>
>> I don't know, I have always used $(PWD), unless anybody else prefers
>> $(CURDIR), I'll push that.
>
> I think CURDIR is better; if only because it is the standard (GNU) make
> way of doing things [1]. I'm not sure if there is a functional
> difference or not. At least CURDIR definitely works with make -C [2]
I read some web pages and then did an experiment; GNU make (v 3.77+)
has builtin variable $(CURDIR). $(PWD) gets value from environment:
doing the following:
$ cat > foo.mk <<EOF
all:
pwd=`pwd`; echo $pwd
echo $(CURDIR)
echo $(PWD)
EOF
$ PWD= make -f foo.mk
pwd=`pwd`; echo $pwd
/home/too
echo /home/too
/home/too
echo
$ cd ..
$ make -C too -f foo.mk
make: Entering directory `/home/too'
pwd=`pwd`; echo $pwd
/home/too
echo /home/too
/home/too
echo /home
/home
make: Leaving directory `/home/too'
So, most portable option would be using pwd=`pwd`; echo $pwd
construct in the makefile. Next option would be using $(CURDIR)
and it works with -C (and with original bourne shell which does
not manage $PWD). That is GNU make (v 3.77+) spesific but the makefiles
use GNU make constructs elsewhere too.
> d
Tomi
>
>
> [1]: http://www.gnu.org/software/make/manual/make.html#Recursion
> [2]: http://www.gnu.org/software/make/manual/make.html#Options-Summary
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] vim: simplify build
2012-04-18 15:40 ` Tomi Ollila
@ 2012-04-18 15:57 ` Felipe Contreras
2012-04-18 16:03 ` Tomi Ollila
0 siblings, 1 reply; 8+ messages in thread
From: Felipe Contreras @ 2012-04-18 15:57 UTC (permalink / raw)
To: Tomi Ollila; +Cc: notmuch
On Wed, Apr 18, 2012 at 6:40 PM, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> On Wed, Apr 18 2012, David Bremner <david@tethera.net> wrote:
>
>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>>>> If this is not an issue, then LGTM.
>>>
>>> I don't know, I have always used $(PWD), unless anybody else prefers
>>> $(CURDIR), I'll push that.
>>
>> I think CURDIR is better; if only because it is the standard (GNU) make
>> way of doing things [1]. I'm not sure if there is a functional
>> difference or not. At least CURDIR definitely works with make -C [2]
>
> I read some web pages and then did an experiment; GNU make (v 3.77+)
> has builtin variable $(CURDIR). $(PWD) gets value from environment:
>
> doing the following:
>
> $ cat > foo.mk <<EOF
> all:
> pwd=`pwd`; echo $pwd
> echo $(CURDIR)
> echo $(PWD)
> EOF
> $ PWD= make -f foo.mk
> pwd=`pwd`; echo $pwd
Agh! Complete confusion. Add an '@' before echo =/
> So, most portable option would be using pwd=`pwd`; echo $pwd
> construct in the makefile. Next option would be using $(CURDIR)
> and it works with -C (and with original bourne shell which does
> not manage $PWD). That is GNU make (v 3.77+) spesific but the makefiles
> use GNU make constructs elsewhere too.
I think `pwd` is overkill. I vote for $(CURDIR), although $$PWD
wouldn't be bad either.
Cheers.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] vim: simplify build
2012-04-18 15:57 ` Felipe Contreras
@ 2012-04-18 16:03 ` Tomi Ollila
2012-04-21 2:21 ` Felipe Contreras
0 siblings, 1 reply; 8+ messages in thread
From: Tomi Ollila @ 2012-04-18 16:03 UTC (permalink / raw)
To: Felipe Contreras; +Cc: notmuch
On Wed, Apr 18 2012, Felipe Contreras <felipe.contreras@gmail.com> wrote:
> On Wed, Apr 18, 2012 at 6:40 PM, Tomi Ollila <tomi.ollila@iki.fi> wrote:
>> On Wed, Apr 18 2012, David Bremner <david@tethera.net> wrote:
>>
>>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>>>>> If this is not an issue, then LGTM.
>>>>
>>>> I don't know, I have always used $(PWD), unless anybody else prefers
>>>> $(CURDIR), I'll push that.
>>>
>>> I think CURDIR is better; if only because it is the standard (GNU) make
>>> way of doing things [1]. I'm not sure if there is a functional
>>> difference or not. At least CURDIR definitely works with make -C [2]
>>
>> I read some web pages and then did an experiment; GNU make (v 3.77+)
>> has builtin variable $(CURDIR). $(PWD) gets value from environment:
>>
>> doing the following:
>>
>> $ cat > foo.mk <<EOF
>> all:
>> pwd=`pwd`; echo $pwd
>> echo $(CURDIR)
>> echo $(PWD)
>> EOF
>> $ PWD= make -f foo.mk
>> pwd=`pwd`; echo $pwd
>
> Agh! Complete confusion. Add an '@' before echo =/
Actually I wonder where one '$' was lose in line pwd=`pwd`; echo $$pwd
>> So, most portable option would be using pwd=`pwd`; echo $pwd
>> construct in the makefile. Next option would be using $(CURDIR)
>> and it works with -C (and with original bourne shell which does
>> not manage $PWD). That is GNU make (v 3.77+) spesific but the makefiles
>> use GNU make constructs elsewhere too.
>
> I think `pwd` is overkill. I vote for $(CURDIR), although $$PWD
> wouldn't be bad either.
So, $(CURDIR) has 3 votes :D
>
> Cheers.
>
> --
> Felipe Contreras
Tomi
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-04-21 2:21 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-18 12:11 [PATCH] vim: simplify build Felipe Contreras
2012-04-18 13:11 ` Tomi Ollila
2012-04-18 13:41 ` Felipe Contreras
2012-04-18 14:58 ` David Bremner
2012-04-18 15:40 ` Tomi Ollila
2012-04-18 15:57 ` Felipe Contreras
2012-04-18 16:03 ` Tomi Ollila
2012-04-21 2:21 ` Felipe Contreras
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).