Share via


Building a Project from the Command Line

  • The following example shows the syntax for building any native project type (such as a .wce or .pbw workspace) from the command line.

    cepb FileName [/MAKE "ProjectName – ConfigName | ALL"] [/REBUILD /CLEAN /NORECURSE /OUT LogFile /USEENV]
    

    Replace FileName with the name of your project file.

  • The following code example shows how to delete all intermediate files, and then build a project called MyProject based on a workspace called MyWorkspace.

    cepb MyWorkspace.pbw /MAKE "MyProject – Win32 (WCE Sh3) Debug" /REBUILD
    
  • The following code example shows how to build two projects, the release configuration of MyProject1 and all configurations of MyProject2, and to direct the build output to a file called MyWorkspace.log.

    cepb MyWorkspace.pbw /MAKE "MyProject1 – Win32 (WCE Sh3) Release" "MyProject2 – ALL" /OUT MyWorkspace.log
    
  • You can also build a project using all configurations of a certain type within a single project, for example, if you have defined multiple types of debug configurations. The build system uses limited pattern matching to recognize the name of the configuration you specify. This pattern matching gives you even more flexibility when you are customizing batch builds.

  • If there are debug and release configurations for both Unicode and other applications, you can build both configurations for only the Unicode application. The following code example shows how to build both configurations for only the Unicode application.

    Cepb MyWorkspace.pbw /MAKE "MyProject – UNICODE" 
    
  • If there are several types of debug and release configurations, you can build a project using all the debug configurations. The following code example shows how to build a project using all the debug configurations.

    Cepb MyWorkspace.pbw /MAKE "MyProject – DEBUG"
    

    The /REBUILD, /CLEAN, and /NORECURSE options all modify the /MAKE option, and are meaningless without it. Also, if you do not specify a FileName after cepb, all /MAKE options are ignored. /MAKE requires at least one configuration.

The following table shows the valid parameters for cepb.

Parameter Description
FileName A valid project file name.
ProjectName The project that contains the configurations to build. The available configurations are listed in the Configurations dialog box, which you open by choosing Configurations on the Build menu.
ConfigName Valid configurations for the project. You can indicate a type of configuration, such as Debug or Release, and then all the debug or release configurations are built. You can indicate a custom configuration, or a microprocessor-specific configuration such as Win32 (WCE Sh3) Release. The microprocessor-specific configurations are listed in the Settings For list of the Project Settings dialog box. To build all configurations, type "ALL" for the configuration value, which must be uppercase.
LogFile Name of an optional file that is used to store the build output information. Valid with the /OUT option only.

The following table shows all the valid options for cepb.

Option Description
/? Displays usage information for the cepb command.
/CLEAN Deletes intermediate files that were created during the build process for the specified configurations. Does not build the project configurations.
/EXMacroName Invokes the named macro. If the associated macro text (.dsm) file is not loaded, this command will fail.
/MAKEprojectname1 configuration1 | projectname1 configuration2 | projectname2 configuration1 | ALL Builds the specified configurations. /CLEAN modifies /MAKE so that the specified configurations are cleaned rather than built.
/MAKEIMG Executes the Makeimg.exe phase.
/NORECURSE Builds a feature using the specified project configurations without building any dependent projects.
/OUTlogfile Creates a log file for the build output. The build output includes such information as syntax errors and warnings. If you do not specify a file name, the build output information appears at the command prompt and is not saved to a file.

The following code example shows how to write data to a file.

Cepb /? /OUT FileName

/REBUILD Cleans and builds the specified configurations, including all dependent projects. Takes precedence if both /CLEAN and /REBUILD are specified.
/ROLL Generates the SDK.
/USEENV Directs the build system to use environment variables for the current build session, rather than the directory settings specified on the Directories tab of the Options command on the Tools menu. The paths for the PATH, INCLUDE, and LIB statements must be set correctly in order for the build to succeed when you specify /USEENV.

Type cepb /USEENV from the command line to launch Platform Builder and use the environment variables for the duration of that integrated development environment (IDE) session.

See Also

Configuration Creation for a Project | Project Creation

 Last updated on Friday, October 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.