Nuts and Bolts of the CE Build System


This is a high-level view of the Windows CE command-line build system. It is intended to give a general understanding of what is happening behind the scenes when a build is run so that the selected operating system components (by an OEM) are included in the CE image. It doesn't attempt to cover all the details of the build system.

One unique term used by the CE team that is not mentioned anywhere else in this book is sysgen. This term refers to the process of selecting Windows CE components and the actual building of an image from these components.

Note

The build system supports the compiling of debug and retail variants of multiple CPU architectures in the same source tree. This is another unique aspect of CE builds.


Following are the steps for a complete clean build:

1.

Build project (compilation) In the build phase, the build system compiles operating system (OS) component source files and produces libraries. The basic unit of componentization in Windows CE is the library components are not conditionally compiled. Because of this, components can be mixed and matched without worrying about changes in their behavior.

2.

Link project During the link phase, the build system attempts to build all target modules. Modules are drivers and executables produced from Windows CE components. In CE 4.0 and later, you can select modules via sysgen environment variables. For example, the "common" project's modules are listed in CE_MODULES, the DirectX project's modules are listed in DIRECTX_MODULES, Internet Explorer's modules are listed in IE_MODULES, and so on.

Microsoft introduced the separation of the build phase and the link phase in Windows CE .NET. Because the operating system was getting more and more complex, linking drivers and other components during the build phase could possibly cause hard-to-diagnose crashes at runtime because coredll entry points that were present during the build phase (which occurs prior to componentization) might not be present in an OEM's final platform.

3.

Copy/filter project (headers and libraries) The Copy/Filter phase of system generation is responsible for moving parts of the operating system to the target project's cesysgen directory. Note: only the components of the OS that the OEM has selected are moved. In addition, header files and various configuration files such as common.bib and common.reg are "filtered" to remove the parts that are unrelated to the OEM's selected components. The copy/filter is performed at the same time as linking.

4.

Post-process project (miscellaneous post-sysgen cleanup) The "postproc" sysgen target provides the build system with a mechanism to do some work after most of the system has been generated. Although the post-process phase is important for the small number of OEMs who use it, most developers don't do much with it.

5.

Platform sysgen If an OEM wants to write his platform in such a way that it can be used with any selection of OS components, he immediately runs into a problem. Some of the drivers, Control Panel applets, or applications in the platform directory might depend on unselected components. When these source files are built, there are compilation or linker errors because header files or coredll entry points are missing.

The platform sysgen step helps address this problem by checking for a platform sysgen makefile.

6.

Build platform This phase consists of running a clean build on all projects and building only the projects that sysgen settings specify.

7.

Create release directory After all the OS components and the platform have been compiled and linked, you need to assemble all the appropriate binaries and configuration files into one place so that you can combine them into a downloadable image. You can use a batch file to perform this step.

8.

Create downloadable image After you populate the release directory with the appropriate binaries, the next step is to create a binary file that is suitable for flashing or downloading to your device's RAM. Use the makeimg command for this step. For details of this command, see the Platform Builder documentation. (The link is provided at the end of this appendix.)

Repeat steps 1 to 4 several times during a complete build, once for each "project."

For more information check the following sources:

  • General Embedded information from Microsoft (http://msdn.microsoft.com/embedded/)

  • Platform Builders Documentation (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceintro5/html/wce50oriWelcomeToWindowsCE.asp)

  • Mike Hall's Embedded Web Log (http://blogs.msdn.com/mikehall/default.aspx)



The Build Master(c) Microsoft's Software Configuration Management Best Practices
The Build Master: Microsofts Software Configuration Management Best Practices
ISBN: 0321332059
EAN: 2147483647
Year: 2006
Pages: 186

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net