lpcware

LPCXpresso 6.1.0 executing pre-build in parallel with main-build

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by twhittam on Fri Nov 29 03:12:09 MST 2013
I'm using a pre-build step

cd "..\..\..\Rolo_003\modules\version"; cmd /c "genver.bat"


to generate version strings before I build my target.

It works correctly except for one thing: it is run in parallel with the main build. It is started first, but does not complete before the main build starts.

I have parallel build enabled, but this should not be applied to the pre-build which by definition has to be completed before starting the main build.

Below is the console output from the build. The command echo genver.bat finished has been added to genver.bat to allow me to see when it finishes. It is clear that make compiles versionstring.c and links the program before genver.bat finishes.


make -j4 pre-build main-build
Generate version strings.
cd "..\..\..\Rolo_003\modules\version"; cmd /c "genver.bat"
Building file: C:/rolofw/Rolo_003/modules/version/src/versionstring.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ ... versionstring.c

Building target: Nougat_K_M4.axf
Invoking: MCU Linker
arm-none-eabi-gcc ... -o "Nougat_K_M4.axf" ...
genver.bat finished

Finished building target: Nougat_K_M4.axf


I think the reason make does this is that it is being given a list of targets to build. It is then free to build them in parallel since to has not been told that one is dependent on the other. Another Eclipse environment I use operates correctly by telling make to build target all and in the makefile it list pre-build and main-build as commands to build target all.

Is there a known workaround for this or do I have to restrict my environment to non-parallel builds?

Outcomes