<?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>topic Re: How to assure pre-build action finishes before proceeding? in Kinetis Design Studio</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/How-to-assure-pre-build-action-finishes-before-proceeding/m-p/841926#M9876</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Suspecting that this is a generic problem with Eclipse and not a problem specific to KDS, I found&amp;nbsp;&lt;A href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=501065"&gt; "Bug 501065 - Pre-build steps not terminated before build is started with enabled parallel build option (make -j)"&lt;/A&gt;&amp;nbsp;in the Eclipse bug database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And good news: In Project =&amp;gt; Properties =&amp;gt; C/C++ Build =&amp;gt; [Behavior], unchecking the "Enable Parallel Build" box&amp;nbsp;forces the pre-build step to complete before moving on to the rest of the build.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Sep 2018 01:51:06 GMT</pubDate>
    <dc:creator>robertpoor</dc:creator>
    <dc:date>2018-09-19T01:51:06Z</dc:date>
    <item>
      <title>How to assure pre-build action finishes before proceeding?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/How-to-assure-pre-build-action-finishes-before-proceeding/m-p/841925#M9875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the Pre-build steps and Post-build-steps feature of KDS 3.2. &lt;EM&gt;(Yes, I&amp;nbsp;will&amp;nbsp;switch to&amp;nbsp;MCUXpresso as soon as I can figure out how to create a Bootloader Configuration Area in MCUXpresso.)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have observed that the build process proceeds asynchronously: it doesn't wait for the pre-build script to complete before moving on.&amp;nbsp; In my case, that causes an error, since the pre-build step creates a file that is required by other parts of the build.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question: is there a way to make the pre-build step synchronous, that is, cause the build process to wait until the pre-build step completes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To demonstrate the problem, here are two simple scripts, pre-build.sh and post-build.sh.&amp;nbsp; pre-build creates a file, post-build prints out its size.&amp;nbsp; Note that pre-build.sh imposes an artificial&amp;nbsp;ten second delay to expose the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;file: pre-build.sh&lt;/P&gt;&lt;PRE style="padding-left: 30px;"&gt;#/bin/sh
/bin/echo === pre start ===
rm -f woof.txt
sleep 10
/bin/echo woof &amp;gt; woof.txt
/bin/echo -n pre `date "+%H:%M:%S"` " "
ls -l woof.txt
/bin/echo === pre end ===&lt;/PRE&gt;&lt;P&gt;file: post-build.sh&lt;/P&gt;&lt;PRE style="padding-left: 30px;"&gt;#/bin/sh
/bin/echo === post start ===
/bin/echo -n post `date "+%H:%M:%S"` " "
ls -l woof.txt
/bin/echo === post end ===&lt;/PRE&gt;&lt;P&gt;The result of running:&lt;/P&gt;&lt;PRE style="padding-left: 30px;"&gt;**** Incremental Build of configuration Debug for project myproj ****
make -j7 pre-build main-build 
./pre-script.sh
Building file: ../source/probe.c
=== pre start ===
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m0plus -mthumb -O0 ...
Finished building: ../source/probe.c
 
Building target: myproj.elf
Invoking: Cross ARM C++ Linker
arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -O0 ...
Finished building target: myproj.elf
 
make --no-print-directory post-build
./post-script.sh
=== post start ===
ls: woof.txt: No such file or directory
post 18:16:45 === post end ===
 
Invoking: Cross ARM GNU Create Flash Image
arm-none-eabi-objcopy -O srec "myproj.elf" "myproj.srec"
Invoking: Cross ARM GNU Print Size
arm-none-eabi-size --format=berkeley "myproj.elf"
 text data bss dec hex filename
 35124 1516 3216 39856 9bb0 myproj.elf
Finished building: myproj.siz
Finished building: myproj.srec
 
pre 18:16:55 -rw-r--r-- 1 r staff 5 Sep 18 18:16 woof.txt
=== pre end ===
 
18:16:55 Build Finished (took 10s.162ms)&lt;/PRE&gt;&lt;P&gt;Note that pre-build created the file long after post-build (unsuccessfully) tried to access it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 01:34:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/How-to-assure-pre-build-action-finishes-before-proceeding/m-p/841925#M9875</guid>
      <dc:creator>robertpoor</dc:creator>
      <dc:date>2018-09-19T01:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to assure pre-build action finishes before proceeding?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/How-to-assure-pre-build-action-finishes-before-proceeding/m-p/841926#M9876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Suspecting that this is a generic problem with Eclipse and not a problem specific to KDS, I found&amp;nbsp;&lt;A href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=501065"&gt; "Bug 501065 - Pre-build steps not terminated before build is started with enabled parallel build option (make -j)"&lt;/A&gt;&amp;nbsp;in the Eclipse bug database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And good news: In Project =&amp;gt; Properties =&amp;gt; C/C++ Build =&amp;gt; [Behavior], unchecking the "Enable Parallel Build" box&amp;nbsp;forces the pre-build step to complete before moving on to the rest of the build.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 01:51:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/How-to-assure-pre-build-action-finishes-before-proceeding/m-p/841926#M9876</guid>
      <dc:creator>robertpoor</dc:creator>
      <dc:date>2018-09-19T01:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to assure pre-build action finishes before proceeding?</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/How-to-assure-pre-build-action-finishes-before-proceeding/m-p/1159503#M10148</link>
      <description>&lt;P&gt;A perhaps better workaround, that will let you keep the parallel builds, can be found here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=340300" target="_self"&gt;Parallel build using generated makefile doesn't manage dependencies&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Until CDT 9.3 is out, the following workaround can be used:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1. Add a makefile.init in the project root with the following content:&lt;BR /&gt;allwithpre :&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(MAKE) --no-print-directory pre-build&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(MAKE) --no-print-directory main-build&lt;BR /&gt;2. Remove the pre-build task from the configuration&lt;BR /&gt;3. In the project settings, C/C++ Build -&amp;gt; Behavior -&amp;gt; Workbench Build Behavior, Change "all" to "allwithpre"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 19:35:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/How-to-assure-pre-build-action-finishes-before-proceeding/m-p/1159503#M10148</guid>
      <dc:creator>wrljet</dc:creator>
      <dc:date>2020-09-25T19:35:56Z</dc:date>
    </item>
  </channel>
</rss>

