bartop

palmoswerks ARCHIVE
Palm OS programming tips from a (former) CodeWarrior insider

header

Navigation

Search
Home
About
Stories
Stuff I Like
Articles
PilRC
CodeWarrior
palmos.techwood.org
DevTools List
Palm OS Dev FAQ

IDE Command Line Support

One question I seem to answer about every month is how do I build my project from the command line. The easy way is to get the IDE to do the build for you. The CW IDE supports several command line arguments that will allow you to launch it, have it load a project, build one or more targets, and then make it quit.

To use the IDE from the command line or from a batch file, you first need to know on what OS you're running. Mac OS users don't have this ability, while Win95/98/Me users need to use the cmdide.exe proxy program instead of ide.exe, the favored choice of WinNT/2000/XP users.

Here's a dump of the IDE's help message:

Metrowerks CodeWarrior IDE. Hit /? for help

This program invokes the CodeWarrior IDE, passes the proper parameters to produce a build, and waits for the IDE to finish its operation. Arguments:

/t targetname    specifies a target to become the current target
/r               remove objects of the current target before building
/b               build the current target
/c               close the project after building
/q               quit the IDE after building
/v y|n|a         option for converting projects on open
                 (y = convert without asking; n = don't convert;
                    a =ask whether to convert)
/s               Forces the command line to be processed in a new
                 instance of the IDE (rather than using a current instance)

Notes:

1) If more than one project document is specified to be opened in the command line, the /t and build command flags apply to the first project document found in the list of documents. If no project is specified in the command line, it will use the usual logic in the IDE (front project or default project) to figure out which project to build. If no target is specified it uses whatever the current target is for that project.

2) All build commands are executed in a different process from the one launched from the command line. The original process will return as soon as the command line has been completely processed and the build has completed.

3) The following codes are returned:

0       no error
1       error opening file
2       project not open
3       IDE is already building
4       invalid target name (for /t flag)
5       error changing current target
6       error removing objects
7       build was cancelled
8       build failed
9       process aborted

brought to you by weblogger.com


Send feedback to combee@techwood.org
Copyright © 2004 Benjamin L. Combee
Palm OS is a registered trademark of PalmSource, Inc.
Metrowerks and CodeWarrior are registered trademarks of Metrowerks Inc.

The views expressed on this website/weblog are those of mine alone and do not necessarily reflect the views of PalmSource or Metrowerks.

This is a Manila Site

qwertYAK / frobnovich