From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 28 19:17:23 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 3C6FB106566C for ; Thu, 28 Jul 2011 19:17:23 +0000 (UTC) (envelope-from mi+thun@aldan.algebra.com) Received: from smtp02.lnh.mail.rcn.net (smtp02.lnh.mail.rcn.net [207.172.157.102]) by mx1.freebsd.org (Postfix) with ESMTP id BEEC78FC12 for ; Thu, 28 Jul 2011 19:17:21 +0000 (UTC) Received: from mr16.lnh.mail.rcn.net ([207.172.157.36]) by smtp02.lnh.mail.rcn.net with ESMTP; 28 Jul 2011 14:47:55 -0400 Received: from smtp04.lnh.mail.rcn.net (smtp04.lnh.mail.rcn.net [207.172.157.104]) by mr16.lnh.mail.rcn.net (MOS 4.2.3-GA) with ESMTP id BFG85272; Thu, 28 Jul 2011 14:47:54 -0400 X-Auth-ID: anat Received: from 209-6-61-133.c3-0.sbo-ubr1.sbo.ma.cable.rcn.com (HELO utka.zajac) ([209.6.61.133]) by smtp04.lnh.mail.rcn.net with ESMTP; 28 Jul 2011 14:47:53 -0400 Message-ID: <4E31AED9.4000105@aldan.algebra.com> Date: Thu, 28 Jul 2011 14:47:53 -0400 From: "Mikhail T." User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:5.0) Gecko/20110714 Thunderbird/5.0 MIME-Version: 1.0 To: hackers@FreeBSD.org X-Mailman-Approved-At: Thu, 28 Jul 2011 19:30:46 +0000 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: 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 19:17:23 -0000 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 speeds 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: --- secure/Makefile.inc 3 Aug 2009 08:13:06 -0000 1.25.10.1 +++ secure/Makefile.inc 28 Jul 2011 18:45:52 -0000 @@ -3,8 +3,8 @@ .include -.if exists(${.CURDIR}/../../lib/libcrypt/obj) -CRYPTOBJDIR= ${.CURDIR}/../../lib/libcrypt/obj +.if exists(${.CURDIR:H:H}/lib/libcrypt/obj) +CRYPTOBJDIR= ${.CURDIR:H:H}/lib/libcrypt/obj .else -CRYPTOBJDIR= ${.CURDIR}/../../lib/libcrypt +CRYPTOBJDIR= ${.CURDIR:H:H}/lib/libcrypt .endif @@ -14,4 +14,4 @@ .if ${MK_OPENSSH} != "no" -SSHDIR= ${.CURDIR}/../../../crypto/openssh +SSHDIR= ${.CURDIR:H:H:H}/crypto/openssh .endif The new method is functionally equivalent to the old and I see no drawbacks to it, do you? -mi