-- update C libs -- -- -- Properties -- property pProjectFileExtension : ".mcp" -- -- Global variables -- global gStartupDisk global gHomeDir global gMWroot global gDistribRoot global gProjectsDir global gLibsDir global gProjectData on ResolveAlias(pathname) tell application "Finder" --if the last character of pathname is ":" then error "Don't use a trailing colon with ResolveAlias." if exists folder pathname then return pathname & ":" if exists alias file pathname then return the original item of alias file pathname as string error "The folder (or alias) '" & pathname & "' doesn't exist." end tell end ResolveAlias on IsOSX() tell application "Finder" set vers to the version as text if second character of vers is equal to "." then set vers to "0" & vers end if return vers > 10 or vers = 10 end tell end IsOSX on HomeDir() tell application "Finder" if my IsOSX() then -- return the home as string set hm to home as string set wd to words of hm set rs to rest of wd set text item delimiters of AppleScript to ":" set nw to (rs as string) & ":" set text item delimiters of AppleScript to "" return nw else return gStartupDisk end if end tell end HomeDir on CToolkitRoot() try set modRoot to ResolveAlias(gMWroot & "ncbi") on error try set modRoot to ResolveAlias(gStartupDisk & gHomeDir & "ncbi") end try end try return modRoot end CToolkitRoot on ModuleRoot() return CToolkitRoot() end ModuleRoot on MWRootDir() set mwRoot to "" set mwLocations to {gStartupDisk, gStartupDisk & "Applications:", gStartupDisk & "Applications (Mac OS 9):", Â gStartupDisk & gHomeDir, gStartupDisk & gHomeDir & "Applications:", gStartupDisk & gHomeDir & "Applications (Mac OS 9):"} repeat with mwVersion from 8 to 9 set dirName to "Metrowerks CodeWarrior " & mwVersion & ".0" repeat with mwLoc in mwLocations try set mwRoot to ResolveAlias(mwLoc & dirName) return mwRoot end try end repeat end repeat error "Can't find the Metrowerks CodeWarrior folder." end MWRootDir on SetGlobals() tell application "Finder" set gProjectData to {} set gStartupDisk to startup disk as string set gHomeDir to my HomeDir() set gMWroot to my MWRootDir() set gDistribRoot to my ModuleRoot() set gLibsDir to gDistribRoot & "lib:" set gProjectsDir to gLibsDir end tell end SetGlobals on BuildLibraries(proj) tell application "CodeWarrior IDE" open (gProjectsDir & proj & pProjectFileExtension) repeat with i from 2 to (count targets of project document 1) set the current target of project document 1 to target i of project document 1 Make Project -- If there were compiler warnings, then a compiler window will be in front. -- For whatever reason, this causes the next "set the current target..." to fail. -- An easy way to make the window go away without having to know if it's there or not -- is to build again, which, because everything is already compiled, finishes instantly -- and produces no warnings. --Make Project -- An even better way is to check for the window and close it. if the name of window 1 is "Errors & Warnings" then close first window -- "close window 1" becomes "Close Window 1" (different event) end if end repeat set the current target of project document 1 to target 1 of project document 1 Close Project end tell end BuildLibraries on BuildAllLibraries() set myLibs to {"mitsock", "ncbi", "ncbiconn", "ncbiobj", "ncbicdr", "vibrant", Â "ncbidesk", "ddvlib", "ncbitool", "ncbimmdb", "ncbiNacc", Â "netentr", "netcli", "ncbibls3", "ncbiid1", "ncbimla", "ncbitxc2", "vibnet"} repeat with proj in myLibs BuildLibraries(proj) end repeat end BuildAllLibraries (* ==== This section builds the libraries ==== *) with timeout of 60000 seconds SetGlobals() tell application "CodeWarrior IDE" to activate BuildAllLibraries() beep end timeout