Friday, July 05, 2024

Re: (boring) why is KEEPKERNELS unset and pobj gets cleaned?

Anon Loli <anonloli@autistici.org> writes:

> Hi list
> I marked this thread as "(boring)" so to not anger snowflakes with
> boring/stupid questions.
>
> So this thread's question is: I found out that when recompiling the base
> system I think that it starts from scratch even though there should be object
> files to prevent unnecessary compiling (I did also run "make obj" for the 2nd
> time, maybe that broke something), so why is that? (assuming I didn't fuck up
> something again)
>
> I'm assuming the process will take another too many hours, and experimenting
> with different settings might be too difficult, so that's why I'm here now.
>
> My questions are why that's like that, and if it's better to just recompile
> everything again (but how the fuck would you guys get any development done
> then? lol)
>
> After reading a few manual pages, by which I mean searching for stuff like
> "clean", I stumbled upon the KEEPKERNELS additional variable which after being
> enabled, kernel object directories should not be cleaned during "make build",
>
> I'm assuming that this is what I need, so I enabled it in /etc/mk.conf as
> explained in the mk.conf(5)#DESCRIPTION section, and I have indeed verified
> that the variable was set with `make -p build`.
>
> But then with the power of flex tape(joke) I mean du, I figured out that it
> recompiles /usr/obj/lib anyways, and maybe some other directories too?
>
> P.S. I'm following release(8) if it wasn't clear..
>

release(8) is about generating a full build from scratch. yes it is a
long process.

it doesn't reuse old object files by default because it would mean
mixing old and new elements, and the result wouldn't be necessary the
expected system (the one you just ask to build).

for usual developpement, it is simpler to just build (and install) the
files you are editing (but some developpements still need a full
release(8) process to ensure all is correct).

for example:

$ cd /usr/src/games/adventure
$ vi wizard.c
[do stuff]
$ make obj
$ make
cc -O2 -pipe -Werror-implicit-function-declaration -MD -MP -c /usr/src/games/adventure/main.c
cc -O2 -pipe -Werror-implicit-function-declaration -MD -MP -c /usr/src/games/adventure/init.c
cc -O2 -pipe -Werror-implicit-function-declaration -MD -MP -c /usr/src/games/adventure/done.c
...
cc -o adventure main.o init.o done.o save.o subr.o vocab.o wizard.o io.o data.o crc.o
$ doas make install
...

Regards.
--
Sebastien Marie

No comments:

Post a Comment