From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 28 20:55:31 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18784106564A for ; Thu, 28 Jul 2011 20:55:31 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id DA8B88FC16 for ; Thu, 28 Jul 2011 20:55:30 +0000 (UTC) Received: by iyb11 with SMTP id 11so4401537iyb.13 for ; Thu, 28 Jul 2011 13:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=x1Huh7XG1UL8XpQPfMK4LA/YaRXIV+nlNMV31CN5ZU8=; b=gMF68KmvvKoDI3T4sppfuyDwwZEJLJSnxKxyjFuGjArbjEdyBariA73n+VL4PLd5o+ yGXsPe/7ama06KIoePsYn2o9e9LU4hfo6LNDbGvjCq8OKwxxRtIfoyVRAZDE0aWQlZpc ltUV2Gv2lTDGKevrkTxhYBqpZfSYDQ4D89F1g= Received: by 10.231.92.196 with SMTP id s4mr371811ibm.10.1311886530078; Thu, 28 Jul 2011 13:55:30 -0700 (PDT) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.231.67.211 with HTTP; Thu, 28 Jul 2011 13:55:00 -0700 (PDT) In-Reply-To: <4E31AED9.4000105@aldan.algebra.com> References: <4E31AED9.4000105@aldan.algebra.com> From: Chris Rees Date: Thu, 28 Jul 2011 21:55:00 +0100 X-Google-Sender-Auth: ygOgD6Bnkg0AtLEvgVFgz-qXnHk Message-ID: To: "Mikhail T." Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: hackers@freebsd.org Subject: Re: A style proposal for referring to upper-level directories in Makefiles X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jul 2011 20:55:31 -0000 On 28 July 2011 19:47, Mikhail T. wrote: > The most common method to refer to the upper directory in Makefile is as > ${.CURDIR}/.. > > I'd like to propose we begin using ${.CURDIR:H} instead. For one this spe= eds > up the filesystem-traversal for the invoked tool. And, perhaps more > importantly, it makes the various build-logs look nicer (and be smaller). > The lines in Makefiles will also be shorter (two characters per level > instead of three). For example: > > =A0 --- secure/Makefile.inc 3 Aug 2009 08:13:06 -0000 =A0 =A0 =A0 1.25.10= .1 > =A0 +++ secure/Makefile.inc 28 Jul 2011 18:45:52 -0000 > =A0 @@ -3,8 +3,8 @@ > =A0 =A0 .include > > =A0 -.if exists(${.CURDIR}/../../lib/libcrypt/obj) > =A0 -CRYPTOBJDIR=3D =A0 ${.CURDIR}/../../lib/libcrypt/obj > =A0 +.if exists(${.CURDIR:H:H}/lib/libcrypt/obj) > =A0 +CRYPTOBJDIR=3D =A0 ${.CURDIR:H:H}/lib/libcrypt/obj > =A0 =A0 .else > =A0 -CRYPTOBJDIR=3D =A0 ${.CURDIR}/../../lib/libcrypt > =A0 +CRYPTOBJDIR=3D =A0 ${.CURDIR:H:H}/lib/libcrypt > =A0 =A0 .endif > > =A0 @@ -14,4 +14,4 @@ > > =A0 =A0 .if ${MK_OPENSSH} !=3D "no" > =A0 -SSHDIR=3D =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0${.CURDIR}/../../../crypto/= openssh > =A0 +SSHDIR=3D =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0${.CURDIR:H:H:H}/crypto/ope= nssh > =A0 =A0 .endif > > The new method is functionally equivalent to the old and I see no drawbac= ks > to it, do you? > > =A0 -mi Not too convinced I'm afraid-- in the logs I can at least see at a glance where ${CURDIR} is, and how many directories it's traversing etc etc. Chris