Date: Fri, 10 Apr 2015 04:49:35 +0200 From: Polytropon <freebsd@edvax.de> To: Pratik Singhal <ps06756@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: Compilation taking too long time Message-ID: <20150410044935.5041ae3a.freebsd@edvax.de> In-Reply-To: <CAGf2gkNHdoYv=_QgSMZF0gjHTcXJKJvAy69=HKPU=NgbCsT6ug@mail.gmail.com> References: <CAGf2gkNHdoYv=_QgSMZF0gjHTcXJKJvAy69=HKPU=NgbCsT6ug@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 10 Apr 2015 01:08:25 +0530, Pratik Singhal wrote: > Whenever I make a small change in the kernel, say apply a patch which only > affects 1 or 2 files and compile the kernel using the command :- > > > make KERNCONF=config_file buildkernel > > It takes a lot of time (around 1 hour) and starts rebuilding the whole > kernel instead of just building the relevant files. > > > I have checked the freeBSD handbook and checked the targets in Makefile , > but none of them provide information about this situation. Check the comment headers of /usr/src/Makefile and /usr/src/Makefile.inc1, as well as "man src.conf". > How, can I make sure that only the relevant files are built and not the > whole kernel again and again ? Building an operating system kernel is a complex task. It's usually not as easy as "just compile this one file into machine code, then magically splice it into the whole process that creates the kernel". ;-) In fact, running a _clean_ building process (when a source file has changed) is something quite typical and intended. The make utility, aided by several Makefiles across the source tree, decides what to do. Interfering with this logic can lead to a nonfunctional kernel, even if you say that just "1 or 2 files" are affecte by a change. The make utility is meant to deal with the decisions that those changes imply. Doing things like "resume an interrupted build process" or "cope with a small change" are therefore hard to achieve. However, it's possible to build parts of the kernel (and especially kernel modules) by running "make" in their respective subdirectories. Of course this does not lead to a fully-functional kernel, but in case you just want to rebuild a module, this approach might work. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150410044935.5041ae3a.freebsd>