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