BuildMethod Block

The BuildMethod block provides the information needed for the build system to build and deploy this feature to an OS image. The following code example shows a BuildMethod block.

BuildMethods(
   BuildMethod(
      CPU( "x86" )
      Step( BSP )
      Action('#BUILD(SOURCES,"$(_WINCEROOT)\platform\CEPC\Drivers\PCMCIA")' )
   )

   BuildMethod(
      CPU( "SH3 SH4 x86" )
      Step( makeimg )
      Action( '#ENV(CEPC_NOPCMCIA, "")' )
   )

)

The following table shows the elements of a BuildMethod block.

Element Description
CPU Element that specifies which microprocessors this build method supports. The following microprocessors are supported by default: ARMV4, ARMV4I, ARMV4T, emulator, MIPS16, MIPSII, MIPSII_FP, MIPSIV, MIPSIV_FP, SH3, SH4, and x86.

The microprocessor list must be surrounded by quotation marks. The string "default" refers to the default microprocessor list.

CoreOS Optional element that specifies the CoreOS under which this build method is supported. The IABASE value corresponds to the display-based devices OS configuration. The HLBASE value corresponds to the headless-based devices OS configuration. Uses the one of formats shown in the following code example.
CoreOS( IABASE )
CoreOS( HLBASE )
CoreOS( IABASE HLBASE )
Step Build step. Only one step per build method is allowed. The following entries are valid:

BSP: Feature Build step. Valid actions are #ENV, #BUILD, #CUSTOM

BUILDREL: Release Copy step. Valid actions are #COPY, #CUSTOM

MAKEIMG: Make Image step. Valid actions are #ENV

CESYSGEN: Cesysgen step. Valid actions are #COPY (from a .cec file)

GUID Optional element that supplies the GUID for the build method. If the GUID is not present, it is created when the implementation is imported. The default is none.
Setting Optional element that contains a string in one of the following formats.
Setting ( '#OUTPUT( OUTPUT_NAME )' )
Setting ( '#INPUT( "SETTING_STRING", ENV_VARIABLE, 1|0, INITIAL_VALUE, BSP_VALUE)' )
Setting ( '#CHM( "CHM_FILE" )' )

The following are descriptions of the different setting options:

  • The #INPUT command establishes the settings in the Sysgen tab, located on the Platform Settings dialog box.

    The SETTING_STRING is used as the text for the setting. ENV_VARIABLE is the name of a TRUE/FALSE environment variable that is used during the build. The BSP_VALUE is a quoted string containing the name or GUID of a board support package. A null string in this field indicates that it is the default value, applicable to all board support packages unless it is overridden by a BSP-specific #INPUT setting.

    The 1 | 0 indicates if the environment variable should be marked TRUE in order to obtain the functionality described in SETTING_STRING. The 1 indicates that if ENV_VARIABLE is set to TRUE, then SETTING_STRING is valid. The 0 indicates that ENV_VARIABLE is FALSE in order for SETTING_STRING to be valid. INITIAL_VALUE is the initial value of the variable. For example, MSMQ (1) must be TRUE to include MSMQ features and must be FALSE to exclude them. NOPIE (0) must be FALSE to include Pocket Internet Explorer and must be TRUE to include it.

    The following code example shows the setting for the Configs.cec file.

    Setting( '#INPUT( "Include Cursor features", NOCURSOR, 0, 0, "" )' )
    Setting( '#INPUT( "Include Cursor features", NOCURSOR, 0, 1, "CEPC" )' )

    For this setting, the default value is 0 for all board support packages included in the IDE. If a third-party board support package uses the default value, no additional #INPUT setting is needed. If a third-party board support package uses a value other than the default value, it would add an additional #INPUT setting, with its own values in the various fields and with its name in the BSP_VALUE string.

  • The #OUTPUT command defines your output modules for the Cesysgen.bat file. The following code example shows the outputs for the Enterprise Terminal OS configuration.

    Setting( '#OUTPUT(CE_MODULES)' )
    Setting( '#OUTPUT(WCEAPP_MODULES)' )
    Setting( '#OUTPUT(IE_MODULES)' )
    Setting( '#OUTPUT(WCESHELL_MODULES)' )
    Setting( '#OUTPUT(MSMQ_MODULES)' )
  • The #CHM command attaches an HTML Help file (.chm) or an HTML Help index file (.chi) to the feature described in the .cec file. Exported SDKs that include the feature will also contain the associated HTML help files. This setting used to determine if a help file will be exported to platform's SDK.
Action Element that specifies actions performed by Platform Builder during the platform build, using a string in one of the following formats.
Action( '#BUILD( DIR|SOURCES, "SOURCES_FULLPATH" )' )
Action( '#BUILD( MAK, "MAKEFILE_DIR", "MAKEFILE_NAME" )' )
Action( '#CUSTOM( "DIRECTORY_TO_EXECUTE_FROM", "PATH_TO_COMMAND" )' )
Action( '#ENV( "VARIABLE", "VALUE" )' )
Action( '#COPY("SOURCE_FILE_FULLPATH", "TARGET_DIRECTORY" )' )

The following are the different types of actions:

  • SRCCODE

    This action specifies the directory that contains source files that this build method uses.

  • CUSTOM

    This action causes Platform Builder to execute a command from the directory specified in DIRECTORY_TO_EXECUTE_FROM.

  • ENV

    This action sets an environment variable to a value for the current build step.

  • COPY

    This action causes Platform Builder to copy the file specified by SOURCE_FILE_FULLPATH. This action will work in the Cesysgen phase.

  • BUILD

    This action causes Platform Builder to use the dirs or source file located in the specified SOURCS_FULLPATH directory in order to build this implementation.

    BUILD uses MAK keyword for building a user-specified makefile file.

    The following code example shows how to build the TMKConsole.mak file.

    Action( '#BUILD( MAK, "$(_WINCEROOT)\public\TMKConsole", "TMKConsole.mak" )' )

The following are additional examples.

Action( '#BUILD( SOURCES, "$(_WINCEROOT)\platform\CEPC\Drivers\DISPLAY\2BPP")' )
Action( '#BUILD( DIRS, "e:\wince400\public\test")')
Action( '#CUSTOM( "$(_WINCEROOT)\platform\CEPC", "$(_WINCEROOT)\platform\CEPC\myfile.bat")')
Action( '#CUSTOM( "d:\wince400\testsrc" , "xcopy d:\wince400\testsrc\build.bat .." )')
Action( '#COPY( "d:\wince400\testsrc\myfile.dll", "e:\RelDir" )')
Action( '#ENV("MY_ENV_VAR", "")')
Action( '#ENV("RUN_MINIMIZED", "0")')

Platform Builder performs actions during the build process in the order in which they are listed in the .cec file. Each build method can have zero or more actions. Certain actions will only work with certain steps, as shown in the table that follows.

Note   An action must be in single quotation marks, and the parameters must be in double quotation marks.

The following table shows which actions will work with which steps in the build method.

Actions Cesysgen step BSP step BuildRel step Makeimg step
#BUILD(DIR,... ) NO YES NO NO
#BUILD(SOURCES,... ) NO YES NO NO
#BUILD(MAK,... ) NO YES NO NO
#CUSTOM( ... , ... ) NO YES YES NO
#COPY( ... , ... ) YES NO YES NO
#ENV( ... , ... ) NO YES NO YES
#SRCCODE( ... ) NO NO NO NO

Registry information is not exposed in a .cec file in the same way that .bib information is exposed. However, you can use the #COPY command in a .cec file to copy a .reg file to the release directory for the platform. The following code example shows how to use the #COPY command in a BuildMethod block to merge .reg file snippets together as part of the MAKEIMG phase of the build.

BuildMethod
(
    GUID( {CA8E4E82-29B4-4FB2-A63E-708C7BAA824A} )
    Step( PreMakeImg )
    CPU( x86 )
    Action ( '#COPY("$(_WINCEROOT)\Examples\Display\Display.reg", "$(_FLATRELEASEDIR)")' )
)

See Also

Catalog Feature Files | Build Phases

 Last updated on Friday, October 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.