<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body style="font-family:"><div style="font-family: 微软雅黑;"><div>Hi Mats,</div><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div><br></div></blockquote><div style=""><span id="_baidu_bookmark_start_0" style="display: none; line-height: 0px;"></span><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div>Thanks for your help.</div></blockquote><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div>I think your solution is better. So that I don't need to create many builders for different suffix.</div></blockquote><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div><br></div></blockquote><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div>I create a new builder(such as below) to build .850, and "AsmBulder_ex" can build .850 also.</div></blockquote><div><div style="color: rgb(212, 212, 212); background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; line-height: 19px; white-space: pre;"><div><span style="color: #9cdcfe;">bld</span> = Builder( <span style="color: #9cdcfe;">action</span>= Action(<span style="color: #ce9178;">'$ASCOM'</span>, <span style="color: #ce9178;">'$ASCOMSTR'</span>), \</div><div> <span style="color: #9cdcfe;">suffix</span>=<span style="color: #ce9178;">'.o'</span>, \</div><div> <span style="color: #9cdcfe;">src_suffix</span>=<span style="color: #ce9178;">'.850'</span>)</div><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div><span style="color: #9cdcfe;">env</span>.Append(<span style="color: #9cdcfe;">BUILDERS</span>={<span style="color: #ce9178;">'AsmBulder_ex'</span>: <span style="color: #9cdcfe;">bld</span>})</div></blockquote></blockquote></div></div></div><div style="text-indent: 2em;"><span id="_baidu_bookmark_start_18" style="display: none; line-height: 0px;"></span><br></div><div style="text-indent: 2em;"><span style="text-indent: 0px;">And could you anwser me a new question? What are the differences between your solution and new builder.</span> <br></div><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"><scons-users-request@scons.org></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">10/30/2024 13:36</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@scons.org></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">Scons-users Digest, Vol 158, Issue 4</td></tr></tbody></table></div>Send Scons-users mailing list submissions to<br> scons-users@scons.org<br><br>To subscribe or unsubscribe via the World Wide Web, visit<br> https://pairlist4.pair.net/mailman/listinfo/scons-users<br>or, via email, send a message with subject or body 'help' to<br> scons-users-request@scons.org<br><br>You can reach the person managing the list at<br> scons-users-owner@scons.org<br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of Scons-users digest..."<br><br><br>Today's Topics:<br><br> 1. scons add source file suffix for env.Object() (?)<br> 2. Re: scons add source file suffix for env.Object() (Mats Wichmann)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Tue, 29 Oct 2024 21:17:43 +0800 (CST)<br>From: ? <yjtyzw@126.com><br>To: scons-users@scons.org<br>Subject: [Scons-users] scons add source file suffix for env.Object()<br>Message-ID: <5a6ab2f7.9f90.192d86cd431.Coremail.yjtyzw@126.com><br>Content-Type: text/plain; charset="gbk"<br><br>Hello,<br><br><br> I use scons to build MCU project, and the project need asm files. The file suffix is *.850.<br> Scons report a error message "scons: *** While building `['']': Cannot deduce file extension from source files".<br> I think I can add environment to resolve the problem. But I don't know how to set src_suffix.<br> Thanks everyone.<br><br><br><br><br><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20241029/9f742eb8/attachment-0001.htm><br><br>------------------------------<br><br>Message: 2<br>Date: Tue, 29 Oct 2024 08:14:14 -0600<br>From: Mats Wichmann <mats@wichmann.us><br>To: scons-users@scons.org<br>Subject: Re: [Scons-users] scons add source file suffix for<br> env.Object()<br>Message-ID: <e8e3b66a-8274-436a-90ed-ab2de49abcd2@wichmann.us><br>Content-Type: text/plain; charset=UTF-8; format=flowed<br><br>On 10/29/24 07:17, ? wrote:<br><blockquote class="mmbqc1">Hello,<br> <br> ? ? ? ? I use scons to build MCU project, and the project need asm <br> files. The file suffix is *.850.<br> ? ? ? ? Scons report a error message "scons: *** While building `['']': <br> Cannot deduce file extension from source files".<br> ? ? ? ? I think I can add environment to resolve the problem. But I <br> don't know how to set src_suffix.<br> ? ? ? ? Thanks everyone.<br></blockquote><br>It's not entirely trivial, and involves using features that are not <br>documented as part of the "public API" - that is, you won't find these <br>in the man page.<br><br>You can write your own builder for those files - that's the place you <br>can specify src_suffix by that name - or you can sneak in and modify the <br>existing Object (and maybe SharedObject?) builders. The latter is <br>probably easier because Object (which is a synonym for StaticObject) is <br>already plumbed into the system.<br><br>In general terms, that could look like this, assuming your situation <br>just uses the regular assembler and doesn't require special syntax, etc. <br>(you didn't say). This has to happen after the construction environment <br>is created:<br><br>import SCons.Defaults<br><br>static_obj = env["BUILDERS"]["StaticObject"]<br>suffix = ".850"<br>static_obj.add_action(suffix, SCons.Defaults.ASAction)<br>static_obj.add_emitter(suffix, SCons.Defaults.StaticObjectEmitter)<br># repeat if needed for SharedObject<br><br>There may be additional steps needed.<br><br>It that works out you can turn it into a tool - see the User Guide for <br>some details on how to do that. The advantage of a tool is you put its <br>name in the tool list when instantiating an Environment, like<br><br>env = Environment(tools=["default", "myasm"])<br><br>and it just gets taken care of...<br><br><br><br><br>------------------------------<br><br>Subject: Digest Footer<br><br>_______________________________________________<br>Scons-users mailing list<br>Scons-users@scons.org<br>https://pairlist4.pair.net/mailman/listinfo/scons-users<br><br><br>------------------------------<br><br>End of Scons-users Digest, Vol 158, Issue 4<br>*******************************************<br></div><!--😀--></body></html>