Subject: Re: OBJDIR and /usr/src mounted read-only?
To: Gordon Ross <firstname.lastname@example.org>
From: Greg Hudson <email@example.com>
Date: 10/06/1995 20:02:33
> Is there a convenient way keep /usr/src read-only?
I spent a long time on this, and even implemented changes to make to
let the /usr/share/mk files determine OBJDIR instead of having it be
hardcoded to ./obj (or the environment variable MAKEOBJDIR) in make.
I found that subtleties of make wildcard dependency semantics got in
the way, so I wound up backing out those changes.
The system we're currently using at SIPB is pretty gross: we did a
"make obj" so that every source directory had an obj ->
/usr/obj/... symlink, and then added a "make objdir" target to
bsd.subdir.mk which makes the target directory but not the obj
symlink. (This way users without access to the source tree could make
obj files on their machines.) Since we wanted a shared build tree for
our machines, we had /usr/obj -> /<path of actual build tree> on our
local machines. Needless to say, given the number of different
machines we work on, indirecting from AFS to a local filesystem and
back into AFS causes some problems.
In general, the best solution would have you type "make" in the build
tree rather than the source tree so you don't have to go through the
above kind of mess (the fundamental problem being that the source tree
has to know where the build tree is). Union mounts are probably the
best way, but it might be nice to have an alternative method (not
relying on fancy filesystem semantics) where you could make a build
tree which has its own Makefiles, knows where its source tree is, and
would have a command to recursively sync its directory structure with
the source tree when directories are added.