Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dissecting the Windows CE Build Process James Y. Wilson Principal Engineer, Windows Embedded MVP CalAmp, Inc. James Y. Wilson Principal Engineer, Windows.

Similar presentations


Presentation on theme: "Dissecting the Windows CE Build Process James Y. Wilson Principal Engineer, Windows Embedded MVP CalAmp, Inc. James Y. Wilson Principal Engineer, Windows."— Presentation transcript:

1 Dissecting the Windows CE Build Process James Y. Wilson Principal Engineer, Windows Embedded MVP CalAmp, Inc. James Y. Wilson Principal Engineer, Windows Embedded MVP CalAmp, Inc.

2 Agenda Build Architecture Command Line Tools Extending the Build Controlling the Build Build Strategies Build Scenarios (Labs) Complete Session Evaluations Build Architecture Command Line Tools Extending the Build Controlling the Build Build Strategies Build Scenarios (Labs) Complete Session Evaluations

3 Build Architecture Batch Files Environment Variables Sysgen Make File Defines initial build environment Executes build for PUBLIC and PRIVATE tree Selects build targets through SYSGEN_ variables and knowledge of intermodule dependencies. Builds PLATFORM COMMON and BSP trees. Constructs content of release directory Calls user defined batch files at various points in the Build and Sysgen stage. Defines initial build environment Executes build for PUBLIC and PRIVATE tree Selects build targets through SYSGEN_ variables and knowledge of intermodule dependencies. Builds PLATFORM COMMON and BSP trees. Constructs content of release directory Calls user defined batch files at various points in the Build and Sysgen stage. Build Make Files

4 Build Architecture “Common Build” aka “Build” Builds Private and Public source trees (generates mostly LIB files) “Sysgen” Assigns SYSGEN_, results in _MODULES, and _COMPONENTS variables assignment Combines selected (_MODULES and _COMPONENTS) component LIB files into DLL and EXE modules Filters header files,.BIB files,.REG files, etc. Builds BSP and Platform Common trees Builds Workspace tree Populates RELDIR Creates OS Image file Essentially, everything else in the build “Common Build” aka “Build” Builds Private and Public source trees (generates mostly LIB files) “Sysgen” Assigns SYSGEN_, results in _MODULES, and _COMPONENTS variables assignment Combines selected (_MODULES and _COMPONENTS) component LIB files into DLL and EXE modules Filters header files,.BIB files,.REG files, etc. Builds BSP and Platform Common trees Builds Workspace tree Populates RELDIR Creates OS Image file Essentially, everything else in the build

5 Build Architecture BldDemo.bat CeBuild.bat Initiates build from within command shell initialized by WinCE.bat WinCE.bat Establishes environment variables used globally, generates DEPTREE, loads developer and project specific environment Enumerates DEPTREE entries, and calls CeBldTree.bat for each entry CeBldTree.bat If enabled builds (compiles) source tree (DEPTREE entry) in Private and Public (Common Build). Initiates Sysgen. CeBuild1.bat Called to build (compile) specified source tree using Build.exe Sysgen.bat CeSysgen.bat Enumerates DEPTREE entries, and calls project specific batch file and CeSysgen.bat for each entry, in four passes (preproc, pass1, pass2, and report). Finally calls “make” to generate EXE and DLL targets.

6 Build Architecture SysgenPlatform.b at Runs CeSysgen.bat (same as above), then builds Platform source tree. BuildRel.bat Enumerates DEPTREE entries, and calls BuildRel1.bat for each.

7 Make Files MAKEFILE: Rules referenced in Makefile.def SOURCES: Assigns variables defining source files, target type, and build options SOURCES.CMN: Contains common SOURCES file entries (in parent directory). _OBJECTS.MAC: List of.obj targets produced during dependency scan. DIRS: Used by Build.exe when performing dependency scan MAKEFILE: Rules referenced in Makefile.def SOURCES: Assigns variables defining source files, target type, and build options SOURCES.CMN: Contains common SOURCES file entries (in parent directory). _OBJECTS.MAC: List of.obj targets produced during dependency scan. DIRS: Used by Build.exe when performing dependency scan

8 Command Line Tools Build.exe Processes DIR file Identifies dependencies, determines which files to build after scanning Calls NMake.exe to perform compilation CEFilter.exe Processes @CEFILTER statements to filter out contents of build and header files for undefined SYSGEN_ PBXMLUtils.exe Used to generate environment (variables and files) from existing PB workspace Used during build to generate certain batch files just before execution Build.exe Processes DIR file Identifies dependencies, determines which files to build after scanning Calls NMake.exe to perform compilation CEFilter.exe Processes @CEFILTER statements to filter out contents of build and header files for undefined SYSGEN_ PBXMLUtils.exe Used to generate environment (variables and files) from existing PB workspace Used during build to generate certain batch files just before execution

9 Command Line Tools SysgenMake.exe Used instead of NMake.exe when auto cloning enabled Overrides.lib file dependencies using specially formatted environment variables Appears to call NMake.exe after override SysgenMake.exe Used instead of NMake.exe when auto cloning enabled Overrides.lib file dependencies using specially formatted environment variables Appears to call NMake.exe after override

10 Inspecting Build Progress Build.log Provides more detailed build output, including full error strings SysgenSettings.out Allows inspection of final SYSGEN_ variables set MakeImg.out Contains output from image creation Build.log Provides more detailed build output, including full error strings SysgenSettings.out Allows inspection of final SYSGEN_ variables set MakeImg.out Contains output from image creation

11 Customization: Batch File Hooks %_WINCEROOT%\developr\%USERNA ME%\pblddemo.bat Runs at the beginning of the BldDemo.bat. Could be used to retrieve files from version control %_PROJECTROOT%\BldNuke.batCalled when “nuke” is parameter to BldDemo.bat %_WINCEROOT%\developr\%USERNA ME%\setenv.bat Allows setting of developer specific build environment. Used for command line builds. %_WINCEROOT%\developr\%USERNA ME%\Source Run at very end of build process to build developer specific project. %_WINCEROOT%\developr\%USERNA ME%\pbuildrel.bat Allows release process (copying targets to RelDir) to be customized.

12 Customization: Batch File Hooks %_PROJECTROOT%\postWinCE.batRuns at end of WinCE.bat, project (not user) specific, another possible location for automated retrieval from version control %_PROJECTROOT%\BldNuke.batCalled when “nuke” is parameter to BldDemo.bat

13 Directory Structure C:\WINCE500\PUBLIC\CEBASE\OAK\MISC: Contains SysGen batch files C:\WINCE500\PUBLIC\COMMON\OAK\MISC: Contains build command batch files C:\WINCE500\PLATFORM: Contains drivers and kernel code changes C:\WINCE500\PBWorkspaces: Contains RELDIR, local Public tree, cloned projects C:\WINCE500\PBWorkspaces\%_TGTPROJ%\WINCE500\%_TGT PLAT%\OAK\MISC: Contains parent CESysgen, and a CESysgen hook batch file OAK/DDK/SDK build product folders: OAK contains platform specific modules and libs, DDK contains platform specific interface components, SDK contains Microsoft supplied platform independent, modules and components C:\WINCE500\PUBLIC\CEBASE\OAK\MISC: Contains SysGen batch files C:\WINCE500\PUBLIC\COMMON\OAK\MISC: Contains build command batch files C:\WINCE500\PLATFORM: Contains drivers and kernel code changes C:\WINCE500\PBWorkspaces: Contains RELDIR, local Public tree, cloned projects C:\WINCE500\PBWorkspaces\%_TGTPROJ%\WINCE500\%_TGT PLAT%\OAK\MISC: Contains parent CESysgen, and a CESysgen hook batch file OAK/DDK/SDK build product folders: OAK contains platform specific modules and libs, DDK contains platform specific interface components, SDK contains Microsoft supplied platform independent, modules and components

14 Platform Builder Options Build OS “Sysgen”: Use when Public SYSGEN_ variable has changed “Build and Sysgen”: Use when code in Public tree has changed “Build and Sysgen Current BSP”: Use when Platform SYSGEN_ variable has changed or Platform code has changed Build Project “Build and Sysgen Current Project”: Used when project consists of Public component or module “Build Current Project”: Used for all Platform projects and anything else Build OS “Sysgen”: Use when Public SYSGEN_ variable has changed “Build and Sysgen”: Use when code in Public tree has changed “Build and Sysgen Current BSP”: Use when Platform SYSGEN_ variable has changed or Platform code has changed Build Project “Build and Sysgen Current Project”: Used when project consists of Public component or module “Build Current Project”: Used for all Platform projects and anything else

15 Build Strategies Create ALL source code in PBWorkspace and Platform (only if making BSP) tree Clone (see Lab for manual cloning) to minimize changes to Platform tree Try hard to avoid changes to Public tree Strive for a Workspace only build (unless creating a BSP) to provide a greater degree of “Project Portability” Create ALL source code in PBWorkspace and Platform (only if making BSP) tree Clone (see Lab for manual cloning) to minimize changes to Platform tree Try hard to avoid changes to Public tree Strive for a Workspace only build (unless creating a BSP) to provide a greater degree of “Project Portability”

16 Build Strategies Build without generating a new OS image and use RelDir mirroring to download changes Reserve OS image generation for flashing image to target Build in background console window(s) Build using –M {n+2} even on uniprocessor systems for 30% to 40% enhancement Build on XP x64, install using link in references Build without generating a new OS image and use RelDir mirroring to download changes Reserve OS image generation for flashing image to target Build in background console window(s) Build using –M {n+2} even on uniprocessor systems for 30% to 40% enhancement Build on XP x64, install using link in references

17 Lab Exercise 1 Creating a Command Line Build Environment

18 Lab Exercise 2 Manual Cloning of a Platform Common Component

19 Lab Exercise 3 Manual Cloning of a Public Driver

20 Lab Exercise 4 Using External IDE’s

21 Conclusion PBWorkspaces provides total flexibility to modify PUBLIC and PLATFORM components Possible to customize an OS design entirely from PBWorkspaces Various options are provided to hook into build Ability to maintain command line build configured from PB IDE Running multiprocessor builds saves time, more common as dual core processors proliferate PBWorkspaces provides total flexibility to modify PUBLIC and PLATFORM components Possible to customize an OS design entirely from PBWorkspaces Various options are provided to hook into build Ability to maintain command line build configured from PB IDE Running multiprocessor builds saves time, more common as dual core processors proliferate

22 References Visit http://www.LearningCE.com for more discussion on this topichttp://www.LearningCE.com For a batch file debugging and command shell replacement see: http://www.jpsoft.com/http://www.jpsoft.com/ Provides single-step debugging Compatible with default XP command shell For information on PB install under XP x64 see: http://blogs.msdn.com/mikehall/archive/2006/04/ 24/582444.aspx http://blogs.msdn.com/mikehall/archive/2006/04/ 24/582444.aspx Visit http://www.LearningCE.com for more discussion on this topichttp://www.LearningCE.com For a batch file debugging and command shell replacement see: http://www.jpsoft.com/http://www.jpsoft.com/ Provides single-step debugging Compatible with default XP command shell For information on PB install under XP x64 see: http://blogs.msdn.com/mikehall/archive/2006/04/ 24/582444.aspx http://blogs.msdn.com/mikehall/archive/2006/04/ 24/582444.aspx

23 Please Complete Session Evaluations


Download ppt "Dissecting the Windows CE Build Process James Y. Wilson Principal Engineer, Windows Embedded MVP CalAmp, Inc. James Y. Wilson Principal Engineer, Windows."

Similar presentations


Ads by Google