Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Feb 2022 10:19:27 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: How to generate a Makefile.depend?
Message-ID:  <CANCZdfoH0h7CdH7da5-5nf9tZTWUkObQnM=bMe4dR32tLc%2BnNQ@mail.gmail.com>
In-Reply-To: <20220218165702.jlfiqrngjzsc2b45@nexus.home.palmen-it.de>
References:  <20220218142803.t444nf77dh2sfkgb@nexus.home.palmen-it.de> <CACNAnaFmxxGeX1rp3vhFkkVTL3JDFz%2BLs7jW1-F-QM_NtEvFow@mail.gmail.com> <20220218165702.jlfiqrngjzsc2b45@nexus.home.palmen-it.de>

next in thread | previous in thread | raw e-mail | index | archive | help
--00000000000066d55c05d84e1653
Content-Type: text/plain; charset="UTF-8"

On Fri, Feb 18, 2022 at 9:58 AM Felix Palmen <felix@palmen-it.de> wrote:

> * Kyle Evans <kevans@freebsd.org> [20220218 09:44]:
> > Makefile.depend falls in "do not worry about it" territory; they're
> > only used for dirdeps mode, which to my understanding will tolerate
> > and generate the missing Makefile.depend as it goes anyways. bdrewery
> > or sjg periodically commit/update .depend files.
>
> Oh, that's really good to know, thanks!
>
> I guess I was confused because I found some old slides and other stuff
> about meta mode suggesting you had to generate them somehow, but lacking
> clear instructions. Could be worth mentioning in the developers
> handbook!
>
> So, to phab we go soon I guess, thanks again.
>

So, Makefile.depend is used only for dirdep mode. It is not used for
normal META mode. In dirdep mode, you can cd src/bin/ls and type
make from a clean tree. It will rebuild libc, csu, compiler_rt and whatever
else ls might depend on. Unless you are using dirdep and have mostly
clean trees, you won't notice if it's missing. There is an out-of-tree
python
script that generates these from time to time quickly. There's a make target
'make bootstrap-this' which will generate it for the current directory (I
believe, I'm reading code here). There's also a 'make bootstrap-empty'
that might be needed depending on the bootstrap method.

I *think* from the comments you could do a meta mode build, which
would populate the objdir with all the artifacts that the above targets use
to generate Makefile.depend and then use the above target to generate
the Makefile.depend for the one directory.

I usually don't bother, as I know these are regenerated from time to
time, but I'm always happy to change my workflow if there's enough
hassle to people from it.

Warner

--00000000000066d55c05d84e1653
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, Feb 18, 2022 at 9:58 AM Felix=
 Palmen &lt;<a href=3D"mailto:felix@palmen-it.de">felix@palmen-it.de</a>&gt=
; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px=
 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">* Kyle =
Evans &lt;<a href=3D"mailto:kevans@freebsd.org" target=3D"_blank">kevans@fr=
eebsd.org</a>&gt; [20220218 09:44]:<br>
&gt; Makefile.depend falls in &quot;do not worry about it&quot; territory; =
they&#39;re<br>
&gt; only used for dirdeps mode, which to my understanding will tolerate<br=
>
&gt; and generate the missing Makefile.depend as it goes anyways. bdrewery<=
br>
&gt; or sjg periodically commit/update .depend files.<br>
<br>
Oh, that&#39;s really good to know, thanks!<br>
<br>
I guess I was confused because I found some old slides and other stuff<br>
about meta mode suggesting you had to generate them somehow, but lacking<br=
>
clear instructions. Could be worth mentioning in the developers<br>
handbook!<br>
<br>
So, to phab we go soon I guess, thanks again.<br></blockquote><div><br></di=
v><div>So, Makefile.depend is used only for dirdep mode. It is not used for=
</div><div>normal META mode. In dirdep mode, you can cd src/bin/ls and type=
</div><div>make from a clean tree. It will rebuild libc, csu, compiler_rt a=
nd whatever</div><div>else ls might depend on. Unless you are using dirdep =
and have mostly</div><div>clean trees, you won&#39;t notice if it&#39;s mis=
sing. There is an out-of-tree python</div><div>script that generates these =
from time to time quickly. There&#39;s a make target</div><div>&#39;make bo=
otstrap-this&#39; which will generate it for the current directory (I</div>=
<div>believe, I&#39;m reading code here). There&#39;s also a &#39;make boot=
strap-empty&#39;</div><div>that might be needed depending on the bootstrap =
method.</div><div><br></div><div>I *think* from the comments you could do a=
 meta mode build, which</div><div>would populate the objdir with all the ar=
tifacts that the above targets use</div><div>to generate Makefile.depend an=
d then use the above target to generate</div><div>the Makefile.depend for t=
he one directory.</div><div><br></div><div>I usually don&#39;t bother, as I=
 know these are regenerated from time to</div><div>time, but I&#39;m always=
 happy to change my workflow if there&#39;s enough</div><div>hassle to peop=
le from it.</div><div><br></div><div>Warner</div></div></div>

--00000000000066d55c05d84e1653--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfoH0h7CdH7da5-5nf9tZTWUkObQnM=bMe4dR32tLc%2BnNQ>