From: Tomi Ollila <tomi.ollila@iki.fi>
To: David Bremner <david@tethera.net>,
Felipe Contreras <felipe.contreras@gmail.com>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH] vim: simplify build
Date: Wed, 18 Apr 2012 18:40:42 +0300 [thread overview]
Message-ID: <m2sjg1dp51.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <871unlgk7h.fsf@zancas.localnet>
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
next prev parent reply other threads:[~2012-04-18 15:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2012-04-18 15:57 ` Felipe Contreras
2012-04-18 16:03 ` Tomi Ollila
2012-04-21 2:21 ` Felipe Contreras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2sjg1dp51.fsf@guru.guru-group.fi \
--to=tomi.ollila@iki.fi \
--cc=david@tethera.net \
--cc=felipe.contreras@gmail.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).