Friday, September 25, 2015

Manage BSP build dependencies under Windows Embedded Compact 2013

Hi Folks,

The Build process of the Windows Embedded Compact 2013 source code is a complex process that is usually divided within different build steps.


Usually the pre-sysgen and sysgen steps are automated and part of what Microsoft provided within the installation package. So lets focus on the the Build step, the one that builds the source code of your BSP.

  • The build tool is used to compile source code and link binary modules using the build environment created during the Sysgen phase.
  • The build tool navigates inside the a directory tree to find directories containing source code.
  • It then invokes the nmake tool to perform the actual build.
  • The build tool is configured using the dirs configuration file
The DIRS files are the only way for the build engine to get through the folders to be proceed, and is a text file that should be present in any folder that contains sub-folders involved in the build process.
Folders listed in the DIRS files are proceed in the description order, this allows you to select the build order of subfolder, and therefore five you the chance to manage components dependencies.


There si a drawback when compiling source code that is split into libraries, all over the BSP subfolders. In that case due to the large amount of binaries that compose a BSP and drviers, it is not possible to do so, and an alternative solution is required at the build directive level.

Located within you source files folder, of the BSP components, the SOURCES and MAKEFILE.DEF contains the build directives, and in Windows Embedded Compact 2013, it has been introduce the module depency directives that allows build engine to postpone the build of sources files if dependency is not satisfied.

The  LINK_PRODUCES and LINK_CONSUMES directives can be used to mange those dependencies. The generated libraries are using the LINK_PRODUCES to define a library name and the sources that requires the generated library specify this requirement using the LINK_CONSUMES directive.

Library producer SOURCES sample
TARGETNAME=cspddk
TARGETTYPE=DYNLINK
RELEASETYPE=PLATFORM

LINK_PRODUCES=cspddk

Library consumer SOURCES sample
TARGETNAME=hcd
TARGETTYPE=DYNLINK

LINK_CONSUMES=cspddk
Now the hcd library, will requires the cspddk library to be built first.

Enjoy!
-Nicolas

1 comment:

  1. Payroll services can bring about new business insights and help you focus on what you do best - running your own business.
    Payroll processing consultants

    ReplyDelete