<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>MCUXpresso IDEのトピックRe: Pre-build command is always executed</title>
    <link>https://community.nxp.com/t5/MCUXpresso-IDE/Pre-build-command-is-always-executed/m-p/1884227#M9841</link>
    <description>&lt;P&gt;I don't think that's a problem. Even your analysis shows that execution of pre-build steps is part of the "make all" - "pre-build" is added by the managed build system from CDT. I think that the part related to determining whether the project is up to date is actually done from Eclipse/CDT and it has nothing do do with the generated makefiles. In other words, if Eclipse/CDT determines that project build must not be triggered, pre-build/post-build steps will implicitly not be invoked because "make all" is not invoked.&lt;/P&gt;
&lt;P&gt;As far as I'm concerned, it functions as designed with one note - it's unclear from the Eclipse documentation what is the strategy used to determine whether a function is "up to date" or not.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Adrian&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jun 2024 12:17:40 GMT</pubDate>
    <dc:creator>AdrianOltean</dc:creator>
    <dc:date>2024-06-10T12:17:40Z</dc:date>
    <item>
      <title>Pre-build command is always executed</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/Pre-build-command-is-always-executed/m-p/1876145#M9812</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using MCUXpresso 11.9.1.&lt;/P&gt;&lt;P&gt;I noticed that if I build a project the pre-build command is always executed (if it is configured) regardless the project is up to date or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the MCUXpresso online help it's stated that the pre-build command is not executed if the project is up to date.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="biafra_0-1716884066299.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/281116i3CAF24524BDB4A3A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="biafra_0-1716884066299.png" alt="biafra_0-1716884066299.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a part of the makefile generated in the build process:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# All Target
all:
	+@$(MAKE) --no-print-directory pre-build &amp;amp;&amp;amp; $(MAKE) --no-print-directory main-build &amp;amp;&amp;amp; $(MAKE) --no-print-directory post-build&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the "all" target there are no dependencies, so the target is always executed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To reproduce the issue, I create a new project and I buld it. The first time it is built, the following times it is executed only the post-build command (that is automatically configured on the project creation step).&lt;/P&gt;&lt;P&gt;Then I create a simple batch script prebuild.cmd and configure it to be executed as pre-build step:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;echo ==== Executing pre-build command ====&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, every time I build the project, there is always the message in the build console, even if nothing is&lt;SPAN&gt;&amp;nbsp;modified in the project.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I forget some configuration so that the pre-build command is executed only if the project is not up to date?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Biafra&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 08:40:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/Pre-build-command-is-always-executed/m-p/1876145#M9812</guid>
      <dc:creator>biafra</dc:creator>
      <dc:date>2024-05-28T08:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Pre-build command is always executed</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/Pre-build-command-is-always-executed/m-p/1877052#M9815</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Update:&lt;/P&gt;&lt;P&gt;There is the same behaviour for the post-build command too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Biafra&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 08:45:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/Pre-build-command-is-always-executed/m-p/1877052#M9815</guid>
      <dc:creator>biafra</dc:creator>
      <dc:date>2024-05-29T08:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Pre-build command is always executed</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/Pre-build-command-is-always-executed/m-p/1884227#M9841</link>
      <description>&lt;P&gt;I don't think that's a problem. Even your analysis shows that execution of pre-build steps is part of the "make all" - "pre-build" is added by the managed build system from CDT. I think that the part related to determining whether the project is up to date is actually done from Eclipse/CDT and it has nothing do do with the generated makefiles. In other words, if Eclipse/CDT determines that project build must not be triggered, pre-build/post-build steps will implicitly not be invoked because "make all" is not invoked.&lt;/P&gt;
&lt;P&gt;As far as I'm concerned, it functions as designed with one note - it's unclear from the Eclipse documentation what is the strategy used to determine whether a function is "up to date" or not.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Adrian&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 12:17:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/Pre-build-command-is-always-executed/m-p/1884227#M9841</guid>
      <dc:creator>AdrianOltean</dc:creator>
      <dc:date>2024-06-10T12:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Pre-build command is always executed</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/Pre-build-command-is-always-executed/m-p/1884340#M9843</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/42876"&gt;@AdrianOltean&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to force to build a file that contains the build date (__DATE__) variable and the build count variable, but only if other files have to be built.&lt;/P&gt;&lt;P&gt;I thought to delete the build.o file to force the rebuid of build.c file. So it's problem for me if the prebuild step command is called if no file has to be built. This way the bulid.c file is built every time I call the build process, because the prebuild command deletes the build.o file (and implicitly forces the build count to be updated).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="biafra_1-1718034763137.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/283246i85AC06DCC5ECEBED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="biafra_1-1718034763137.png" alt="biafra_1-1718034763137.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The imagine above shows the output of the build console when the project isn't built, but the pre build command is called anyway.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Biafra&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 15:54:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/Pre-build-command-is-always-executed/m-p/1884340#M9843</guid>
      <dc:creator>biafra</dc:creator>
      <dc:date>2024-06-10T15:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Pre-build command is always executed</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/Pre-build-command-is-always-executed/m-p/1885337#M9850</link>
      <description>&lt;P&gt;I think you'll have to rely on actual makefiles to address your use case. Please inspect one generated makefile and note the "&lt;SPAN&gt;makefile.defs", "makefile.init" and "makefile.targets" that you can contribute to a generated makefile. Also, you have the Behavior tab in the C/C++ Build section of the project's build properties that you can play with, and maybe call custom make targets. It's all Eclipse/CDT-specific implementation so you'll probably find related documentation on the web,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Adrian&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 15:58:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/Pre-build-command-is-always-executed/m-p/1885337#M9850</guid>
      <dc:creator>AdrianOltean</dc:creator>
      <dc:date>2024-06-11T15:58:44Z</dc:date>
    </item>
  </channel>
</rss>

