Codewarrior and the Perl/Shell Tools
The Perl/Shell Tool is useful - being able to run arbitrary Perl and Shell Scripts during a build is very cool.
CodeWarrior will pass the following enviromental variables to your script.
HOME LANG MW_CURRENT_TARGET MW_OUTPUT_DIRECTORY MW_OUTPUT_FILE MW_OUTPUT_NAME MW_PROJECT_DIRECTORY MW_PROJECT_FILE MW_PROJECT_NAME PATH SHELL USER __CF_USER_TEXT_ENCODING
Some sample values are here:
CVS_RSH= ssh
HOME= /Users/aias
LANG= en_US
MW_CURRENT_TARGET= Carbon Toolbox Debug
MW_OUTPUT_DIRECTORY= /Users/aias/Temp/shelltoool
MW_OUTPUT_FILE= /Users/aias/Temp/shelltoool/Carbon Toolbox Debug
MW_OUTPUT_NAME= Carbon Toolbox Debug
MW_PROJECT_DIRECTORY= /Users/aias/Temp/shelltoool
MW_PROJECT_FILE= /Users/aias/Temp/shelltoool/shelltoool
MW_PROJECT_NAME= shelltoool
PATH= /usr/bin:/bin:/usr/sbin:/sbin:/Users/aias
SHELL= /opt/local/bin/ksh
USER= aias
__CF_USER_TEXT_ENCODING= 0x1F5:0:0
We extracted these values with our own little Perl script (based on a script from Greg Tavares post in codewarrior.games on 2003-01-07)
for $key (sort(keys %ENV))
{
#print ($key, "=", $ENV`[Unknown macro: {$key, "\n"}]`, "n");
print (" ", "$key= " . $ENV`[Unknown macro: {$key}]`, "n");
}
print "n";
print $ENV`[Unknown macro: {MW_PROJECT_DIRECTORY}]`;
A bit of power goes a long ways.