svn commit: r341343 - head/share/man/man7

Rodney W. Grimes freebsd at pdx.rh.CN85.dnsmgr.net
Fri Nov 30 17:07:15 UTC 2018


> On Fri, Nov 30, 2018 at 9:24 AM Bjoern A. Zeeb <
> bzeeb-lists at lists.zabbadoz.net> wrote:
> 
> > On 30 Nov 2018, at 15:56, Edward Tomasz Napierala wrote:
> >
> > > Author: trasz
> > > Date: Fri Nov 30 15:56:14 2018
> > > New Revision: 341343
> > > URL: https://svnweb.freebsd.org/changeset/base/341343
> > >
> > > Log:
> > >   Add an example of rebuilding a single piece of userspace.
> > >
> > > Modified:
> > >   head/share/man/man7/development.7
> > >
> > > Modified: head/share/man/man7/development.7
> > >
> > ==============================================================================
> > > --- head/share/man/man7/development.7 Fri Nov 30 15:52:03
> > > 2018  (r341342)
> > > +++ head/share/man/man7/development.7 Fri Nov 30 15:56:14
> > > 2018  (r341343)
> > > @@ -118,6 +118,14 @@ After reboot:
> > >  cd src
> > >  make -j8 installworld
> > >  reboot
> > > +.Ed
> > > +.Pp
> > > +Rebuild and reinstall a single piece of userspace, in this
> > > +case
> > > +.Xr ls 1 :
> > > +.Bd -literal -offset indent
> > > +cd src/bin/ls
> > > +make clean all install
> >
> > I always thought the proper sequence was:  make clean cleandepend obj
> > depend all install

make clean && make cleandepend && make obj && \
   make depend && make all && make install
If you do not use the && jointers you may actually end up installing
a binary that was from the last build.... or other not so nice side
effects from not stopping your command sequence on failure.

> >
> > However I have recently figured that it?s not actually true as
> > building inside an individual user space source directory seems to pick
> > up headers etc from the installed machine and not from the source tree.
> > I keep arguing with myself if that had always been the case or not..  I
> > am sure some people here do know better than me (so please see this as
> > asking for help/advise).

The original BSD 4.4 lite case, and hence early FreeBSD up to some
point, was that all builds, other than the kernel which is self
isolated by design, picked up the installed include files from
/usr/include.  This is what lead to the original top level Makefile
target make includes which populates DESTDIR/usr/include from the
files in the src tree you are rooted at.  There was also an associated
knob whos name is escaping me right now that says to make the
DESTDIR/usr/include hierarchy symlinks into the source tree, thus
in effect making your userland builds always use the header files
from the current src tree.
> >
> 
> obj and depend are now optional (they are now reconstructed the first time
> something builds), but used to be required though sometime in the 9.x/10.x
> series. Except for on super-weird case involving FS level corruption, I've
> never needed these targets since the cut-over.

obj was orignally optional, and hopefully has always been and still is
optional.  Also true of depend, but you might not get what you wanted/
expected if you do not make the .depends files if your editing the
src's and recompiling.  If your just building from a "clean" src/obj
pair there should be no need for depend until you edit something, then
you need to run a depend build so that make knows what to rebuild.

> cleandepend may be required in some weird edge cases, but it's rarely
> needed that you can omit it most of the time. It used to be required
> whenever the dependencies changed as part of the build. That's mostly, but
> not entirely, fixed today.

cleandepend was traditionally required when depencies changed
in a way that caused the contents of the .depend file to be
incorrect.  If .depend is dependent on every file listed in
the .depend file and Makefile and .mk files make depend should
be able to do the right thing all the time.  I never got to
this idea back in the day, .depend files had no depencies and
the user had to know when they effected the dependency graph
and to run a make cleandepend && make depend pass. 

> Warner

-- 
Rod Grimes                                                 rgrimes at freebsd.org


More information about the svn-src-head mailing list