It's already there in SVN HEAD. :D
Examples of use:
codeblocks.exe --build --target="Release" c:\some\where\a\project.cbp
Builds the target release of the specified project.
codeblocks.exe --personality=MyBuild --rebuild c:\some\where\a\project.cbp > build.log
Rebuilds all the targets of the specified project, using the specified personality (http://wiki.codeblocks.org/index.php?title=Personalities), and redirecting the build log to a file.
As for having a special build exe so no GUI is hidden, as it's not an easy task, I guess it will be available in Code::Blocks Studio 2007 or so :P
My command line is :
codeblocks --no-splash-screen --target="Release" --personality="Lite" --rebuild myworkspace.cbp > compile.log
Also, I noticed that when the filename/filepath & name myworkspace.cbp is incorrect, I get a notification "The project does not exists" twice, and then codeblocks crashes.
That is truly a bug. The reason is that in compilergcc.cpp in int CompilerGCC::Clean(const wxString& target) the line:
clean = dc.GetCleanSingleFileCommand(Manager::Get()->GetEditorManager()->GetActiveEditor()->GetFilename());
crashes because Manager::Get()->GetEditorManager()->GetActiveEditor() returns NULL. Will fix that in a minute... Thanks for spotting this.
With regards, Morten.
Edit: Fixed in SVN.