Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Apr 1995 03:27:18 -0500 (CDT)
From:      Mike Pritchard <pritc003@maroon.tc.umn.edu>
To:        rkw@dataplex.net (Richard Wackerbarth)
Cc:        current@FreeBSD.org
Subject:   Re: NOTICE: If you care, speak now!
Message-ID:  <199504050827.DAA03477@mpp.com>
In-Reply-To: <v02120b08aba77e0068f0@[199.183.109.242]> from "Richard Wackerbarth" at Apr 4, 95 09:23:21 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> I WANT to make a significant change to the way new systems get built.
> ...
> 1) The environment of the host system is NOT disturbed by the "making" of a
> new release.
> 2) The source and object files MAY be shared by multiple releases without
> impacting each other.
> 3) The tree MAY be on read-only media. If you wish to change only a part of
> the tree, only the affected parts need be on writeable media.
> 4) Redundant compiles are eliminated. "make all" folled by a second "make
> all" will not cause anything to be recompiled. (The compressed man pages
> are another, but related, issue)
> 
> The "downside":
> 
> 1) To build a new kernel, etc. you must place it in a proper "tree"
> structure. That tree can be rooted anywhere you wish. ( This could be
> handled by a script or possibly special "make" targets.)
> 2) Unless you are in a "proper" tree, you must either do a make from the
> root of the tree OR predefine the TREE environmental variable.
> 
> An "aside":
> ...
> "Obj" links could optionally be added and would work IF you have only one
> version of the tree. They would be "for reference only" and not used to
> build the system.
> Richard Wackerbarth

There may be a way to do what I am asking below  right now, but I haven'
t really seen a way to do this, so forgive me if I'm wrong (and tell me 
how to do it if it can be done!).  Right now I don't really see a way to 
do any type of kernel development without actually changing the sources out
in /usr/src/sys, unless I want to copy /usr/src/sys off somewhere else and
work on those sources.  That is kinda a pain if I really only want to
work on one particular module, and would like the rest of the kernel
to be up-to-date (I run sup daily) while I'm working on my change (and if 
other changes get added to my module while I'm working on it, I'm responsible 
for reconciling those differences).  For non-kernel sources
(/usr/src/{bin,usr.bin,sbin,...} you can usually just copy the directory
containing the program in question off somewhere and work on it and
this usually only involves a very small number or a handful of files
at most.  The kernel is 1,400+ files.

On other systems I've worked on I was able to do something like this:

# SETENV SRCROOT /usr/src
# cd /usr/src/mpp/sys
# mkdir -p compile/mpp
# [do the right stuff to get a Makefile & whatever else in 
   /usr/src/mpp/compile/mpp that I need.  E.g. all the "config" stuff]
# cd compile/mpp
# pwd
/usr/src/mpp/sys/compile/mpp
# vi ../../kern/kern_proc.c
[make my changes to my copy of kern_proc.c]
# make
[this would do a make, picking up my ../../kern/kern_proc.c over the
 /usr/src/sys/kern/kern_proc.c, and any files not found in ../.. (/usr/src/mpp)
 would be picked up from $SRCROOT, or /usr/src/sys]

Something that allowed me to do what I mentioned above would also let me
compile off a CD-ROM, if I pointed SRCROOT to the directory on the
CD-ROM that contained my sources and if copied off the appropriate makefile
and whatever other support files I needed.

It doesn't look too hard to do to the current kernel makefile, and it
looks similar to part of what Richard is proposing above.  About 5 minutes 
of hacking tells me that it is possible, but it looks like it will take
a bit of work to get it all working correctly.

It would also be nice to be able to do this with every system makefile 
(e.g. just copy /usr/src/Makefile somewhere, cd there, set SRCROOT to 
/usr/src and then type make and everything would work), thus eliminating the
need for the "make obj" stuff, but would require hacking a lot of makefiles.
I would settle for the kernel for now.

For most programs, something as simple as the following in the makefile
might just do the trick:

.PATH:	../../usr.bin/progname ${SRCROOT}/usr.bin/progname

(modify the above to fit the appropriate command)
-- 
Mike Pritchard
pritc003@maroon.tc.umn.edu
"Go that way.  Really fast.  If something gets in your way, turn"



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