From owner-freebsd-arch@FreeBSD.ORG Wed May 8 23:01:33 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 81120289; Wed, 8 May 2013 23:01:33 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from exprod7og109.obsmtp.com (exprod7og109.obsmtp.com [64.18.2.171]) by mx1.freebsd.org (Postfix) with ESMTP id 19D111CC; Wed, 8 May 2013 23:01:30 +0000 (UTC) Received: from P-EMHUB02-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob109.postini.com ([64.18.6.12]) with SMTP ID DSNKUYrZSlgTrgeHWUWN4bxmccz3Iv9a+Jyz@postini.com; Wed, 08 May 2013 16:01:33 PDT Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB02-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Wed, 8 May 2013 15:53:03 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id r48Mr3L23585; Wed, 8 May 2013 15:53:03 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id DF7AE58097; Wed, 8 May 2013 15:53:02 -0700 (PDT) To: Warner Losh Subject: Re: [RFC] adding a variable to .mk and Makefile.inc1 to point to top of the FreeBSD source tree In-Reply-To: <9CD1CE3E-C17C-4C63-BA03-190531185D7A@bsdimp.com> References: <20130507213118.5277F58097@chaos.jnpr.net> <20130508054121.DCA7258097@chaos.jnpr.net> <9CD1CE3E-C17C-4C63-BA03-190531185D7A@bsdimp.com> Comments: In-reply-to: Warner Losh message dated "Wed, 08 May 2013 15:49:12 -0600." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Wed, 8 May 2013 15:53:02 -0700 Message-ID: <20130508225302.DF7AE58097@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain Cc: Garrett Cooper , freebsd-toolchain@freebsd.org, "freebsd-arch@FreeBSD.org Arch" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 23:01:33 -0000 On Wed, 8 May 2013 15:49:12 -0600, Warner Losh writes: >> MAKEOBJDIR=3D'${.CURDIR:S,${SRCTOP},${OBJTOP},}' >>=20 >> which gives you a similar - but much neater result than >> MAKEOBJDIRPREFIX. > >Isn't that backwards. MAKEOBJDIRPREFIX in today's FreeBSD is much more = >like OBJTOP than what you've quoted here. That's how I set the top of = No. MAKEOBJDIRPREFIX gives you an objdir by simply doing ${MAKEOBJDIRPREFIX}${.CURDIR} this is very quick and handy, but the paths can be very long and ugly if you happen to be on automounted nfs. For the sake of discussion assume I am in /.amd/server/b/sjg/work/FreeBSD/current/src/bin/cat MAKEOBJDIRPREFIX=/var/obj/current/$MACHINE make -V .OBJDIR /var/obj/current/amd64/.amd/server/b/sjg/work/FreeBSD/current/src/bin/cat MAKEOBJDIR='${.CURDIR:S,${SRCTOP},${OBJTOP},}' make -V .OBJDIR /var/obj/current/amd64/bin/cat (assuming of course that OBJTOP='${OBJROOT}${MACHINE}' as previously mentioned). The ability to do the above is something I added to NetBSD's make ages ago because we found that MAKEOBJDIRPREFIX resulted in pathnames that were blowing the command line limits on FreeBSD 2.x >the tree today, usually with a 'setenv MAKEOBJDIRPREFIX $HOME/obj' in my = >.cshrc so it is always active. That way I can just buildworld or = Yes, MAKEOBJDIRPREFIX is certainly very handy - and I use it for quick & dirty builds and of course for buildworld and such. >problems with /usr/obj being unwritable... I know this trick doesn't = >work for netbsd's make (or didn't years ago when I was building it on a = What trick? MAKEOBJDIRPREFIX has always worked as you describe. Don't confuse limitations imposed by makefiles as being limitations of the tool ;-) >The project currently uses dots without issue. Not quite sure why you'd = The project doesn't currently do anything close to what dirdeps.mk allows.