Creating a Workspace from the Command-Line

When you create a workspace from the command line, you begin the process by creating a platform directory, which will hold the dynamic-link library (.dll) and executable (.exe) files that are built during the Sysgen phase of the build process. Platform Builder builds these files according to the configuration you have selected for your platform. For more information about the Sysgen phase, see Build Phases.

Creating a workspace from the command line

  1. Create a platform directory by copying one of the two core configuration directories, located in the Public directory of your Windows CE installation, typically located at C:\WINCE420, to a new location.

    You can select HLBASE for a headless device configuration, or IABASE for a display-based device configuration. This determines the features that are available to you when customizing your platform. The following code example shows how to copy the IABASE directory to a directory named MyPlatform.

    xcopy /s public\iabase public\myplatform
    

    For more information, see Feature Dependencies.

  2. From the Platform directory of your Windows CE installation, which contains the board support packages that you selected when you installed Platform Builder on your development workstation, select the BSP you want to use for your platform.

    For example, you can create a platform based on the x86 BSP, targeted toward the Emulator.

    For information about BSPs, see Board Support Package Development.

  3. Create a batch application (.bat) file to set up your build environment.

    For easy reference, it is recommended that you name this file after your platform name, and locate it in the root directory on your development workstation.

    The following table lists the environment variables that you must set in the batch file.

    Environment variable Description
    _WINCEROOT Set this to refer to your Windows CE installation directory, which will typically be C:\WINCE420.
    _FLATRELEASEDIR Set this to refer to the directory where the final Nk.bin image should be built, which will typically be the release directory under your platform directory.
    WINCEDEBUG Set this to specify a debug or retail configuration. This is set to retail by default. If you change the default setting, you must also reset _FLATRELEASEDIR in order to avoid conflicting debug and release binaries.

    The batch file should also call Wince.bat, the Windows CE Build Environment tool, to set up the rest of the default build environment.

    The following code example shows how to set the build environment for a platform named MyPlatform, based on the x86 BSP, and using the Emulator as the target device.

    call %_WINCEROOT%\PUBLIC\common\oak\misc\wince.bat x86 MyPlatform emulator
    

    In this file, set any Sysgen variables that you want to set in your platform. You can call one of the sample configuration batch files to set up defaults for standard configurations.

    The following code example shows how to set the variables for a typical Mobile Handheld configuration.

    call %_WINCEROOT%\Public\IABASE\mobile_handheld.bat

    Finally, to enable you to remember what build environment you have set up, change the title of the command-line build window.

    The following code example shows how to set the title for a build environment targeted toward a Mobile Handheld configuration for the Emulator.

    cd /d %_WINCEROOT%
    title WINCE BUILD - EMULATOR MOBILE
    
  4. Run the batch file to create your build environment.

You have successfully created a workspace from the command line. You are now ready to customize and build your platform. For information about customizing your platform, see Feature Management and Platform Customization. For information about building your platform, see Platform Building.

See Also

Workspace Creation | Workspace Creation in the IDE | How to Use the Command Line to Create, Customize, and Build a Platform | Miscellaneous Environment Variables

 Last updated on Friday, October 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.