<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body style="font-family:"><div style="font-family: 微软雅黑;"><div><br></div><div style="text-indent: 2em;"><span id="_baidu_bookmark_start_0" style="display: none; line-height: 0px;">‍</span><span id="_baidu_bookmark_start_2" style="display: none; line-height: 0px;">‍</span>My problem:</div><div style=""><span id="_baidu_bookmark_start_4" style="display: none; line-height: 0px;">‍</span><div style="text-indent: 2em;"><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;">In my project, there are those code in some source files,</blockquote><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div style="color: rgb(204, 204, 204); background-color: rgb(31, 31, 31); font-family: Consolas, "Courier New", monospace; line-height: 19px; white-space: pre;"><div><span style="color: #c586c0;">#define</span><span style="color: #569cd6;"> FOO_HEADER </span><span style="color: #ce9178;">"foo.h"</span></div><div><span style="color: #c586c0;">#include</span><span style="color: #569cd6;"> FOO_HEADER</span></div></div></blockquote></div></div><div style="text-indent: 2em;"><span id="_baidu_bookmark_start_11" style="display: none; line-height: 0px;">‍</span><span id="_baidu_bookmark_start_13" style="display: none; line-height: 0px;">‍</span><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div>and the files are independent module, I can't modify them.</div></blockquote></div><div style="text-indent: 2em;"><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div>the <span style="white-space: pre-wrap;">scons-user.pdf said, scons </span><span style="font-family: Times-Roman; font-size: 10pt;">the built-in C scanner is unable to extract the implicit dependency </span><span style="font-family: Times-Roman; font-size: 10pt;">on a header file.</span></div><div><span style="font-family: Times-Roman; font-size: 10pt;">So I create .d file for every source file, and parse dependencies from .d, and then add dependency by Depends function.</span></div></blockquote></div><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div style="text-indent: 2em;"><span id="_baidu_bookmark_start_21" style="display: none; line-height: 0px;">‍</span><span id="_baidu_bookmark_start_23" style="display: none; line-height: 0px;">‍</span>And then, there is a new problem, when there are no .d, (for example the first building or dependencies are changed), I need to build project with two times, and then I can push all the dependencies into signature.</div></blockquote><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div style="text-indent: 2em;"><span id="_baidu_bookmark_start_25" style="display: none; line-height: 0px;">‍</span><span id="_baidu_bookmark_start_27" style="display: none; line-height: 0px;">‍</span><br></div><div style="text-indent: 2em;">So I consider that whether could I update all the dependencies into signature with just one building.</div><div style="text-indent: 2em;">that is my problem.</div></blockquote><div><br></div><div><br></div><div spellcheck="false" id="ntes-pcmac-signature" style="font-family:微软雅黑" data-ntes-signature="true"><div style="font-size:14px;padding:0;margin:0"></div></div></div><div class="J-reply ntes-mailmaster-quote" style="padding-top: 1px; padding-bottom: 1px; font-family: 微软雅黑;"><div style="margin:2em 0 1em;font-size:14px;line-height:1.25;color:#78787a">---- Replied Message ----</div><div style="margin-bottom:1em;font-size:12px;line-height:1.25;color:#232324;padding:0.5em 0.25em;border-radius:0.67em;background-color:#f0f0f0"><table width="100%" cellpadding="0" cellspacing="9" border="0" id="ntes_editor_table_10010" class="ntes_editor_table ntes_editor_ext_table "><tbody><tr><td valign="top" style="width:4.25em;font-size:12px;line-height:1.25;color:#78787a">From</td><td class="" valign="top" style="font-size:12px;line-height:1.25;color:#232324;word-break:break-all"><a class="mail-from" style="color:#3061f2;text-decoration:none" href="mailto:undefined">Mats Wichmann<mats@wichmann.us></a></td></tr><tr><td valign="top" style="width:4.25em;font-size:12px;line-height:1.25;color:#78787a">Date</td><td class="mail-date" valign="top" style="font-size:12px;line-height:1.25;color:#232324;word-break:break-all">6/6/2025 22:47</td></tr><tr><td valign="top" style="width:4.25em;font-size:12px;line-height:1.25;color:#78787a">To</td><td class="" valign="top" style="font-size:12px;line-height:1.25;color:#232324;word-break:break-all"><a class="mail-to" style="color:#3061f2;text-decoration:none" href="mailto:scons-users@scons.org">SCons users mailing list<scons-users@scons.org>,<br></a><a class="mail-to" style="color:#3061f2;text-decoration:none" href="mailto:yjtyzw@126.com">于<yjtyzw@126.com></a></td></tr><tr><td valign="top" style="width:4.25em;font-size:12px;line-height:1.25;color:#78787a">Subject</td><td class="" valign="top" style="font-size:12px;line-height:1.25;color:#232324;word-break:break-all">Re: [Scons-users] update dependency and signatures.dblite after biilding</td></tr></tbody></table></div>On 6/6/25 08:29, 于 wrote:<br><blockquote class="mmbqc1">Hi Bill,<br> <br> ‍As what you said,  ParseDepends Function will lead to unnecessary <br> recompilations.<br> I have use ParseDepends Function to parse dependencies, and then, I need <br> two times to trace all the denpendencies.<br> I want trace all the dependencies with one building. I think that serval <br> steps can do it, but I don't know how to do it. So I ask for help form <br> community.<br> ‍1. build source files to .o;<br> 2. parse dependencies from .d;<br> 3. update dependencies of source files manuly;<br> 4. build elf;<br>         I don't know how to implement the step 3, please experts help <br> me, thsnks.<br></blockquote><br>Do you have a setup which produces the .d files? Not sure where you are <br>in this process.<br><br>ParseDepends() isn't very smart, and what it does under the covers ends <br>up being just issuing as many Depends() calls as necessary - another <br>function we usually advise against using, because you're forcing the <br>issue rather than letting SCons build up its own dependency tree. This <br>is what happens in ParseDepends after it's done with the parsing part:<br><br>         for target, depends in tdlist:<br>             self.Depends(target, depends)<br><br><blockquote class="mmbqc1">My question is that could I update dependency and database manually<br> after building?<br></blockquote><br>The signature database is in a format that can't be edited, as it <br>consists of pickled internal objects.  All you can do is include <br>Depends() calls in your build to instruct SCons - or make the scanner <br>work correctly for your use case.<br><br>Sorry for not quite understanding - what is the actual problem you're <br>trying to solve?<br></div><!--😀--></body></html>