From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 28 22:30:14 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 44C4F106566C for ; Thu, 28 Jul 2011 22:30:14 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 01F0A8FC08 for ; Thu, 28 Jul 2011 22:30:13 +0000 (UTC) Received: by vxg33 with SMTP id 33so3191727vxg.13 for ; Thu, 28 Jul 2011 15:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=d8gmuEshbjYP5mIzWWwKWREN5SaskN3XAi4/QAZ+pHw=; b=iO03kMsMGknp+5eh3J030cRvKyvC5HH+G0XgTlib36iVmQ76WX7K5oGHxfU7FF0FO6 ZLZtm3HU/2r5ye12fXQFJ8PHRuW04+s/oCqtqXcWIEkjVLehBrbKKyQNstV9HBpqMCTO oWlDU33lcMBVzwgtMss8Iz8HGIR5fQEF2WW1o= MIME-Version: 1.0 Received: by 10.220.150.2 with SMTP id w2mr167649vcv.19.1311890712629; Thu, 28 Jul 2011 15:05:12 -0700 (PDT) Received: by 10.220.176.2 with HTTP; Thu, 28 Jul 2011 15:05:12 -0700 (PDT) In-Reply-To: <4E31AED9.4000105@aldan.algebra.com> References: <4E31AED9.4000105@aldan.algebra.com> Date: Thu, 28 Jul 2011 15:05:12 -0700 Message-ID: From: Garrett Cooper 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 22:30:14 -0000 On Thu, Jul 28, 2011 at 11:47 AM, Mikhail T. wr= ote: > 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? This might cause issues with symlink traversal (it's the one thing that came to mind). It wouldn't be a standard way to do things, but it could cause problems if this change was made. Thanks, -Garrett