Windows Embedded CE 6.0 build process


When you build an OS image, there are a number of utilities that run in order to produce the final result: the process is quite complex and long (although you can save sometime, see  here). The following stuff is a raw list of which batches and applications are run when you build an OS image, somehow ordered by calling and with some notes about the tasks performed by the single batch/application

Throughout the paragraphs there are some environment variables; as an example to clarify where they are located on your PC, let’s imagine they are set as:

_PROJECTOAKROOT=D:\Work\ReleaseWorkspace\zypad\Wince600\WL1100_ARMV4I\oak
 _PROJECTROOT=D:\Work\ReleaseWorkspace\zypad\Wince600\WL1100_ARMV4I
 PBWORKSPACE=D:\Work\ReleaseWorkspace\zypad\zypad.pbxml

BLDDEMO.BAT

  • call %_WINCEROOT%\developr\%USERNAME%\pblddemo.bat if it exists
  • if %_BLDDEMO_NUKE% (nuke command line option) call %_PROJECTROOT%\BldNuke.bat
    and %_PRIVATEROOT%\bat\BldNuke.bat if they exist
  • if %_BLDDEMO_CLEAN% (clean/noclean command line option) clean
    %_PROJECTROOT%\cesysgen and %_PLATFORMROOT%\cesysgen
  • * if %_BLDDEMO_CLEANPLAT% (cleanplat/nocleanplat command line option) clean
    %_PLATFORMROOT%\target
  • if they exist, delete
    %_PROJECTOAKROOT%\PBPreSysgenCustomBuildActions.bat,
    %_PROJECTOAKROOT%\PBPreSysgenProjects.bat,
    %_PROJECTOAKROOT%\PBPostSysgenCustomBuildActions.bat
    %_PROJECTOAKROOT%\PBPostSysgenProjects.bat
  • if %PBWORKSPACE% (i.e. a .pbxml file for the workspace exists), create the
    PB project specific directories calling ‘pbxmlutils /createfolders’;
    create PB project specific build files calling
    ‘pbxmlutils /generatebuildfiles %_PROJECTOAKROOT%’.
    if they exist, call %_PROJECTOAKROOT%\PBPreSysgenCustomBuildActions.bat
    and %_PROJECTOAKROOT%\PBPreSysgenProjects.bat
  • call CEBUILD.BAT with all the relevant command line parameters
  • if %PBWORKSPACE% call, if they exist,
    %_PROJECTOAKROOT%\PBPostSysgenCustomBuildActions.bat and
    %_PROJECTOAKROOT%\PBPostSysgenProjects.bat
  • if not %_BLDDEMO_NOREL% (rel/norel command line option) call BUILDREL.BAT
  • if not %_BLDDEMO_NOMAKEIMG% (makeimg/nomakeimg command line option)
    invoke MAKEIMG saving the output to %_FLATRELEASEDIR%\makeimg.out
  • call %_PROJECTROOT%\oak\misc\CESYSGEN.BAT then save SYSGEN_ variables to
    %_FLATRELEASEDIR%\SysgenSettings.out

CEBUILD.BAT

  • for each entry in %_DEPTREES% call CEBLDTREE.BAT with preproc option (if ‘-q’ is not specified in BLDDEMO.BAT command line)
  • for each entry in %_DEPTREES% call CEBLDTREE.BAT with postproc option (if ‘-q’ is not specified in BLDDEMO.BAT command line)
  • call SYSGENPLATFORM.BAT %_TARGETPLATROOT% preproc
  • call ‘CEBUILD1.BAT platform’ %_PLATFORMROOT%\common
  • call ‘CEBUILD1.BAT platform’ %_PLATFORMROOT%\%_TGTPLAT%
  • call SYSGENPLATFORM.BAT %_TARGETPLATROOT% postproc
  • if exists %_WINCEROOT%\developr\%USERNAME%\Source invoke BUILD in this
    directory

CEBLDTREE.BAT

  • call ‘CEBUILD1.BAT public’ on the specified project
  • call SYSGEN.BAT on the specified project

SYSGENPLATFORM.BAT

  • call %_PROJECTROOT%\oak\misc\CESYSGEN.BAT. Default CESYSGEN.BAT file for
    project will invoke %_PUBLICROOT%\cebase\oak\misc\cesysgen.bat
  • invoke NMAKE preproc or postproc in the specified platform directory.
  • Default makefile for platform will include:
    $(_WINCEROOT)\public\common\cesysgen\CeSysgenPlatform.mak: this makefile
    will set ‘DUMMY’ for TARGETTYPE, etc and will call CEFILTER on
    %_TARGETPLATROOT%\FILES\platform.* . The output files will be put in
    %_TARGETPLATROOT%\CESYSGEN directory

CEBUILD1.BAT

  • invoke BUILD on the specified project

 SYSGEN.BAT

  • call %_PROJECTROOT%\oak\misc\CESYSGEN.BAT. Default CESYSGEN.BAT file for
    project will invoke %_PUBLICROOT%\cebase\oak\misc\cesysgen.bat
  • for each subdirectory in %_WINCEROOT%\public\common\oak\lib\%_CPUINDPATH% (i.e.
    localized resources files) call BLDLIST.BAT which will simply add the locale
    to %{{{__LANGIDLIST}}}%
  • if invoked with ‘preproc’ options:
    set COREDLL_COMPONENTS=%COREDLL_COMPONENTS% %COREDLL_REPLACE_COMPONENTS%
    set COREDLL_COMPONENTS=%COREDLL_COMPONENTS% %COREDLL_REPLACE%
    set COREDLL_REPLACE_COMPONENTS=
    set COREDLL_REPLACE=
  • invoke nmake with the makefile of the specified project

CESYSGEN.BAT

  • calls each %_DEPTREES% batch with the ‘preproc’ command line option to clear
    project specific environment variables
  • calls each %_DEPTREES% batch with the ‘pass1’ command line option to add
    project specific modules according to SYSGEN variables
  • calls each %_DEPTREES% batch with the ‘pass2’ command line option to perform
    actions on the project which can depend on other project settings (rarely
    used: see wceshellfe.bat for an example)

BUILDREL.BAT

  • check if %_TGTPROJ%.bif %_TGTPLAT%.bif %_TGTCPU%.bif exist in %_FLATRELEASEDIR%
    if they do not exist, it means that the configuration changed from the
    latest build.
  • if requested, clean %_FLATRELEASEDIR%
  • create the ‘flag files’ %_TGTPROJ%.bif %_TGTPLAT%.bif %_TGTCPU%.bif
  • delete %_PROJECTOAKROOT%\files\PBUserProjects.* if they exist
  • generate PBWorkspace localization and project files calling
    ‘pbxmlutils /generatebuildrelfiles’
  • for each entry in %_DEPTREES% call BLDREL1.BAT
  • call BLDREL1.BAT platform
  • call BLDREL1.BAT platformcommon
  • call project specific buildrel if it exists (%_PROJECTOAKROOT%\pbuildrel.bat).
  • call platform builder specific buildrel if it exists
    (%_PROJECTOAKROOT%\pbpostbuildrel.bat).
  • call developer specific buildrel if it exists
    (%_WINCEROOT%\developr\%USERNAME%\pbuildrel.bat)

BLDREL1.BAT

  • copy various files from project directory to %_FLATRELEASEDIR%

MAKEIMG

  • call %_WINCEROOT%\public\common\oak\misc\pbpremakeimg.bat which
    deletes %_PROJECTOAKROOT%\PBPreMakeImageCustomBuildActions.bat and
    %_PROJECTOAKROOT%\PBPostMakeImageCustomBuildActions.bat.
  • calls pbxmlutils /generatemakeimgfiles %_PROJECTOAKROOT%
  • calls %_PROJECTOAKROOT%\PBPreMakeImageCustomBuildActions.bat
  • call %_FLATRELEASEDIR%\PreMakeImg.bat if it exists
  • run fmerge * nls
  • run fmerge * txt
  • run cenlscmp to create wince.inf
  • call %_FLATRELEASEDIR%\PreFmergeBib.bat if it exists
  • run fmerge * bib to create ce.bib
  • call %_FLATRELEASEDIR%\PostFmergeBib.bat if it exists
  • call %_FLATRELEASEDIR%\PreFmergeReg.bat if it exists
  • run fmerge * reg to create reginit.ini
  • call %_FLATRELEASEDIR%\PostFmergeReg.bat if it exists
  • run regcompr on reginit.ini to create the image registry files
  • call %_FLATRELEASEDIR%\PreFmergeDb.bat if it exists
  • run fmerge * db to create initdb.ini
  • call %_FLATRELEASEDIR%\PostFmergeDb.bat if it exists
  • call %_FLATRELEASEDIR%\PreFmergeObj.bat if it exists
  • run fmerge * obj to create initobj.tmp from .dat files
  • call %_FLATRELEASEDIR%\PostFmergeObj.bat if it exists
  • run txt2ucde on initobj.tmp to create the UNICODE file initobj.dat
  • run res2exe on the localizable executable modules
  • call %_FLATRELEASEDIR\preromimage.bat. This file is copied from
    %_WINCEROOT%\PUBLIC\CEBASE\OAK\FILES and it performs the following
    actions:

    • for each entry %f in %_DEPTREES% call %f-preri.bat if it exists;
    • if it exists, call %_TGTPLAT%-preri.bat
  • run romimage on ce.bib to create the binary image

 

Advertisements
This entry was posted in Windows Embedded CE, Windows Embedded Compact. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s