This blog is initiated to share my working experiences on Windows CE and Windows mobile. I intend to reproduce, in most simple language, intersting facts and insights that I unearth in my day to day spade-WORK.

Creating a Command line build environment

Long time no see... have been awfully tied up with work, and have been equally lazy too!

Many a times, people have asked me how to create a command-line build enviroment. A complete documentation for it is available in PB documentation, here is an easy summary for lazy people like me:

  1. From command line, browse to: Windows\Program Files\Platform Builder for Windows Mobile\5.00\CEPB\BIN
  2. Type the following commmand:

pbxmlutils /getbuildenv /workspace "\PBWorkspaces\MyWorkspace\MyWorkspace.pbxml" /config " MyBSP:TargetDevice"> SetMyBuildEnv.bat

Volah, the batch file (SetMyBuildEnv.bat) now has the build environment setup!!

Here's an example:

To set up build environment for an OS design called MyWorkspace, based on an x86 CPU and targeted for the Emulator, type the following command:

pbxmlutils /getbuildenv /workspace "C:\WINCE500\PBWorkspaces\MyWorkspace\MyWorkspace.pbxml" /config "Emulator: x86_Debug" > SetEnv.bat

Do I hear: "Okay, so the documentation already tells me that... what's new?"

Value addition is here: Create a shortcut on Desktop that takes you there....

  1. Copy the SetMyBuildEnv.bat to a convenient location. Lets say C:\MyEnvironment
  2. Browse to \WINDOWS\system32, right click on cmd.exe and create its shortcut to Desktop.
  3. Browse to Desktop, rename Shortcut to cmd.exe to MyBuild.exe, or any name you like.
  4. Right-Click, select properties. In Shortcut tab, observe Target : C:\WINDOWS\system32\cmd.exe.
  5. Change this to:

C:\WINDOWS\system32\cmd.exe /k C:\MyEnvironment\SetMyBuildEnv.bat

Click Apply, and you are done!!

No more need to use PB for building small changes..... Command line build would do it faster, in a more controlled fashion.