How to build and install only part of base source tree

Yasuhiro KIMURA yasu at utahime.org
Wed Feb 19 00:03:14 UTC 2020


From: Polytropon <freebsd at edvax.de>
Subject: Re: How to build and install only part of base source tree
Date: Tue, 18 Feb 2020 18:18:53 +0100

> First of all, there's /etc/src.conf to control aspects of the
> whole build process (see "man 5 src.conf"). Additionally, you
> can change into a specific program's directory within the source
> tree, then build and install it from there, for example:
> 
> 	# /usr/src/usr.bin/mt
> 	[... you change mt.c ...]
> 	# make
> 	# make install
> 
> However be careful that, depending on the kind of changes you
> make, it's possible that you need to rebuild other programs or
> libraries, too. While "make buildworld" and "make installworld"
> will handle such changes in an optimal manner (also see the
> comment header of /usr/src/Makefile), the manual approach is
> quite convenient for smaller changes, and in case of user
> programs, can often be tested immediately.

I'm a bit surprised because I didn't expect this simplest way works
fine. But I should have tried it before asking here;-).

> PS. I've done the same in /usr/src/sbin/fsck_ffs while trying
>     to debug and finally solving a very rare data recovery
>     problem.

At first I intended to add support of new envirionment varialbe to
libfetch. But while investigating source code I suspect libfetch
doesn't work as is documented under some conditions. So now I switched
to check if the problem actually happens. And if I'm convinced I'll
also debug the problem in a same way.

---
Yasuhiro KIMURA


More information about the freebsd-questions mailing list