Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Nov 1995 22:43:32 GMT
From:      Mark Valentine <mark@linus.demon.co.uk>
To:        rkw@dataplex.net (Richard Wackerbarth)
Cc:        current@FreeBSD.org, root@deadline.snafu.de
Subject:   Re: Getting to the root of  building Makefiles
Message-ID:  <199511122243.WAA00409@linus.demon.co.uk>
In-Reply-To: Richard Wackerbarth's message of Nov 12, 12:19am

next in thread | raw e-mail | index | archive | help
> From: rkw@dataplex.net (Richard Wackerbarth)
> Date: Sun 12 Nov, 1995
> Subject: Getting to the root of  building Makefiles

> Mark Valentine <mark@linus.demon.co.uk> 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?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511122243.WAA00409>