Compartilhar via


Specifying Custom Build Steps for a Project (Windows CE 5.0)

Send Feedback

After you create a project and add it to a workspace, you can specify custom actions that are performed before and after the Sysgen phase of the build process. These steps are known as pre-link and post-link steps.

This is accomplished by modifying batch files and the sources file for the project. The project must be in the %_WINCEROOT% path.

To specify custom build steps for a project

  1. If your project does not include two batch files named Prelink.bat and Postlink.bat, create and add them to the root directory of your project.

    For example, if your project is located at %_WINCEROOT%\PBWorkspaces\MyOSDesign\MyProject, create Prelink.bat and Postlink.bat in this directory.

    In these files, use batch file syntax to specify the custom actions you want to run during the pre-link and post-link steps.

  2. Navigate to the directory where the sources file for the project you want to modify is located.

  3. Open the sources file in an editor, and modify it as shown in the following code example, which shows part of a sample sources file:

    PRELINK_PASS_CMD=prelink.bat
    POSTLINK_PASS_CMD=postlink.bat
    SOURCE=\
    
  4. Save and close the sources file.

  5. Copy the batch files to the release directory and update Project.bib to add entries for these files.

    For more information, see Adding a File to a Run-time Image.

  6. When you are ready to build your project, from the Build Project menu, verify that Clean Before Building and Copy Files to Release Directory After Build are selected.

  7. From the Build Project menu, select Build Current Project.

    This performs a clean build of your project, decreasing the possibility of build errors appearing due to intermediate and output files from an earlier build.

When you build the run-time image based on your OS design, the build system uses the Build tool (Build.exe) to perform a pre-link pass on files related to your OS design, and then calls Prelink.bat. After the files in your project are linked, Build.exe calls Postlink.bat.

See Also

Projects | Build Tool | Build Phases

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.