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 9511C431FBC for ; Wed, 18 Apr 2012 08:58:05 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 1BtTO3lUm5QA for ; Wed, 18 Apr 2012 08:58:00 -0700 (PDT) Received: from mail-ey0-f181.google.com (mail-ey0-f181.google.com [209.85.215.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 9BA45431FAE for ; Wed, 18 Apr 2012 08:58:00 -0700 (PDT) Received: by eaa1 with SMTP id 1so3090887eaa.26 for ; Wed, 18 Apr 2012 08:57:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=3LLVkU9oWKGPR/rXsI7LjkmkzyN2YTYsm4AljcIrZok=; b=DCbyrEm0ZWqqJhmihkivGKDWhpf/2/eo257sYj/bMhFoPgM8wWzelayIPP9XRUbr0g AM2ROb+Rm0uOMsy/7sUKGOTB5VjvgxbRZgX2Rs70n/pew/a27HkxaEwy0eqkBK6UCBBl h8eO5aYBCAGoT1jEpDeeHghR0YIKRROHbDW3PSPHSEizcdn/C3DLTskYE/TYOaAiHULz vDakGTf02q+0Q2rgIEn9X62fDoq0zZfXtYa3a1jfflenbMRqzxyGFAzYXGR9s/Dm4NXO 718Be97wK0su+11QGOcoJWqWXQLnhaQ1RMOVnH/OYeaVaGoqThizNfsCJ87HxmGH82vb lMfA== MIME-Version: 1.0 Received: by 10.14.96.129 with SMTP id r1mr477519eef.86.1334764679414; Wed, 18 Apr 2012 08:57:59 -0700 (PDT) Received: by 10.213.19.67 with HTTP; Wed, 18 Apr 2012 08:57:59 -0700 (PDT) In-Reply-To: References: <1334751115-7216-1-git-send-email-felipe.contreras@gmail.com> <871unlgk7h.fsf@zancas.localnet> Date: Wed, 18 Apr 2012 18:57:59 +0300 Message-ID: Subject: Re: [PATCH] vim: simplify build From: Felipe Contreras To: Tomi Ollila 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 15:58:05 -0000 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/ > 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. Cheers. --=20 Felipe Contreras