On Sat, Jul 06, 2024 at 07:10:37AM +0200, Sebastien Marie wrote:
> Anon Loli <anonl...@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

I see, so this full rebuild (ignoring object files) is most useful when for
example fetching an update to the CVS repository?
Is that what you meant by old and new elements?

But as far as I understand, for local(not updated) development/changes, keeping
object files is what I want for fast compiling, and to get that I need to set
the KEEPKERNELS variable, and that alone?
It's weird that one needs a full clean rebuild.. like why even use a version
control system if it doesn't help when it comes to that?

I don't know how object files are made, and all that is within them, but it
would be nice if they would prevent a differential between a clean build and a
build with old object files... for example with CVS you can probably see the
difference between locally made changes and CVS repository updates...

Reply via email to