Building a Platform Using Modified Shared Source Code

You can build a platform using modified shared source code, which is typically located in the %_WINCEROOT%\Private directory. Follow the instructions to build a platform containing modified shared source code in the IDE.

Private code, which is provided in the %_WINCEROOT%\Private directory, is covered by the Microsoft Shared Source License Agreement, which allows you to make modifications to the code strictly for non-commercial use, such as in-house debugging. You must restore the original files and binaries, and rebuild your platform before releasing a device for commercial use. You cannot ship modified private code in any shipping device. Follow the instructions to build private code from the command line.

If you are creating a new platform, for information, see How to Use the IDE to Create, Customize, and Build a Platform.

When you have performed these procedures, you will have a platform containing modified shared source code that you can download to your device for debugging and verification. For information on verifying a component, see Verifying a Component.

To build a platform containing modified shared source code

  1. From the File menu in the Platform Builder IDE, choose Open Workspace, open the directory for your platform, and then open the associated Platform Builder Workspace (*.pbw or *.wce) file.

  2. From the Build menu, choose Set Active Configuration, and then select the debug configuration of your platform. Choose OK.

    This permits you to use Shared Source code in your platform.

  3. From the Build menu, choose Build Platform to build your platform without any modified source code.

    This becomes the original platform, from which you can back up the files.

  4. Locate the source code that you want to modify. Before modifying it, ensure that you have created a backup of the original source code files located in %_WINCEROOT%\Private and you have used CeBackup to create a backup of the original Microsoft-provided libraries.

    For information on CeBackup, see CeBackup Tool.

  5. After your source and binaries are backed up, modify the code with the changes that you wish to make, and then save your changes.

  6. Set or clear any environment variables.

    For information on setting or clearing an environment variable, see Setting or Clearing an Environment Variable.

    For information on environment variables that you can set, see Environment Variables.

  7. From the Build menu, choose Build Platform to incorporate the modified code into your platform.

    Note   You can build specific components from the IDE by right-clicking on the component and choosing Build Selected Feature from the context menu. However, it is recommended that you build private code from the command line.

To build private code from the command line

Not all components in the %_WINCEROOT%\Private directory can be built. For information on determining whether your component can be built, see Shared Source Code Directories.

  1. From the Build menu, choose Open Build Release Directory.

  2. To list the environment variables set for your platform, including any new components, at the command prompt, enter the following command.

    Set
    
  3. If you need to set additional environment variables, at the command prompt, enter Set, and then enter the environment variables that you wish to set, separated by spaces.

    For example, to remove USB support from your platform, at the command prompt, enter Set BSP_NOUSB=1.

    For information on environment variables that you can set, see Environment Variables.

  4. Change your directory to the directory that contains the Shared Source code that you have modified and ensure that the current directory contains a dirs or sources file.

  5. At the command prompt, to perform a clean build, enter the following command.

    Build -c
    

    You have built libraries from modified Shared Source code.

  6. Perform the following steps in the IDE:

    1. If errors occur during the build process, review the Build.err and Build.log files, which are located in the root directory from which the build process was called.
    2. From the Build menu, choose Build Platform to build your platform with the binaries that you have built.

See Also

How to Use the IDE to Create, Customize, and Build a Platform | Creating a Backup of the Source Code Files | Shared Source Code | CeBackup Tool

 Last updated on Friday, October 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.