Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 25043431FB6 for ; Wed, 18 Apr 2012 09:03:53 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dfn02u-yn0SJ for ; Wed, 18 Apr 2012 09:03:48 -0700 (PDT) Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66]) by olra.theworths.org (Postfix) with ESMTP id 476AF431FAE for ; Wed, 18 Apr 2012 09:03:48 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id 2C46068056; Wed, 18 Apr 2012 19:03:45 +0300 (EEST) From: Tomi Ollila To: Felipe Contreras Subject: Re: [PATCH] vim: simplify build In-Reply-To: References: <1334751115-7216-1-git-send-email-felipe.contreras@gmail.com> <871unlgk7h.fsf@zancas.localnet> User-Agent: Notmuch/0.12+113~gde05574 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2012 16:03:53 -0000 On Wed, Apr 18 2012, Felipe Contreras wrote: > On Wed, Apr 18, 2012 at 6:40 PM, Tomi Ollila wrote: >> On Wed, Apr 18 2012, David Bremner wrote: >> >>> Felipe Contreras 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]. =C2=A0I'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 <> all: >> =C2=A0 =C2=A0 =C2=A0 =C2=A0pwd=3D`pwd`; echo $pwd >> =C2=A0 =C2=A0 =C2=A0 =C2=A0echo $(CURDIR) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0echo $(PWD) >> EOF >> $ PWD=3D make -f foo.mk >> pwd=3D`pwd`; echo $pwd > > Agh! Complete confusion. Add an '@' before echo =3D/ Actually I wonder where one '$' was lose in line pwd=3D`pwd`; echo $$pwd >> So, most portable option would be using pwd=3D`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. > > --=20 > Felipe Contreras Tomi