From owner-freebsd-current Sun Nov 12 15:37:01 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id PAA12341 for current-outgoing; Sun, 12 Nov 1995 15:37:01 -0800 Received: from linus.demon.co.uk (linus.demon.co.uk [158.152.10.220]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id PAA12295 for ; Sun, 12 Nov 1995 15:36:44 -0800 Received: (from mark@localhost) by linus.demon.co.uk (8.7.1/8.7.1) id WAA00409; Sun, 12 Nov 1995 22:43:32 GMT Date: Sun, 12 Nov 1995 22:43:32 GMT From: Mark Valentine Message-Id: <199511122243.WAA00409@linus.demon.co.uk> In-Reply-To: Richard Wackerbarth's message of Nov 12, 12:19am X-Mailer: Mail User's Shell (7.2.5 10/14/92) To: rkw@dataplex.net (Richard Wackerbarth) Subject: Re: Getting to the root of building Makefiles Cc: current@FreeBSD.org, root@deadline.snafu.de Sender: owner-current@FreeBSD.org Precedence: bulk > From: rkw@dataplex.net (Richard Wackerbarth) > Date: Sun 12 Nov, 1995 > Subject: Getting to the root of building Makefiles > Mark Valentine writes: > >One way to help make source trees self-sufficient might be to start every > >Makefile with something like: > > > > TOP = ../.. > > > > .MAKEFLAGS: -I${TOP}/share/mk > > > >(where the ../.. varies according to the position in the source tree). > > Generally on the right line of thinking ... > Only you cannot always use ../.. to get back to the correct top of the tree. > If I merge multiple trees with symbolic links, then I cannot follow > the tree up to get to the root of MY tree. I use this scheme with symlinks into multiple source trees all the time* (no obj trees). Granted, you have to symlink everything you need into one symlink tree (no symlinked directories), but I'm happy with that restriction. Am I missing your meaning? > The other problem with this approach is that it is some inconvenience to > move a sub tree. For example, if we wished to merge the gnu tree with the > usr.bin tree, or conversely, if we wished to split a collection out of the > tree and place in its own alternate tree. If the need arises, a fairly simple script can walk a source tree, editing the Makefiles to point TOP at the right level. > My approach would be to establish a ROOT and reference the MAKEFLAGS > relative to that root. After all, we need the same facility for the > includes, etc. Do you mean use an environment variable containing a full path? I've used such a scheme, and it was a pain in the bum when working with multiple trees. I like the makefiles to know where to look by themselves. (And of course, you can't dig the root out of /etc/make.conf, since that also has to move *into* the source tree, say as src/make.conf.) Mark. * Symlink trees are a pain to manage, though! Anyone come up with a useable script to manage a symlink tree pointing at multiple (changing) source trees?