5
property pUsingCPlusPlus : false
6
property pProjectFileExtension : ".mcp"
8
property pAlwaysCreateProjects : false
9
property pBuildObsoleteLibraries : false
11
property pCreateBlueTargets : true -- 'Blue' was the codename for System 7. Here, it means pre-Carbon.
12
property pCreateCarbonTargets : true
13
property pCreateDebugTargets : true
14
property pCreateOptimizedTargets : true
16
property pShouldBuild : true
18
property pDirsToCreate : {�
19
{relPath:"", name:"include"}, �
20
{relPath:"", name:"ctools"}, �
21
{relPath:"", name:"lib"}}
23
property pDebugPrefix : ""
24
property pReleasePrefix : ""
26
property pLinkExecutables : false
31
on ProjectData(projName, features, fileData)
33
if (count characters of projName) > 18 then
34
set projName to characters 1 through 18 of projName as string
37
tell application "CodeWarrior IDE 4.2.5"
39
if features does not contain "C" and features does not contain "C++" then
40
--error "Project " & projName & "'s default language (a feature) must be C or C++."
41
copy "C" to end of features
43
set myFeatures to features
44
--copy "BNDL" to end of myFeatures
45
return {name:projName, features:myFeatures, rsrcs:{}, settings:�
46
{Prefix File:"", ppcProject:{}}, projLibs:{}, sysPaths:{}, fileData:�
52
on SimpleProjectData(projName, features, section, fileList)
54
set myPath to section & ":"
55
return ProjectData(projName, features, {{projPath:myPath, fileList:fileList}})
59
on AddSimpleProject(projName, features, section, fileList)
61
AddProject(SimpleProjectData(projName, features, section, fileList))
65
on DataPlusPrefixFile(dataRec, prefix)
66
tell application "CodeWarrior IDE 4.2.5"
68
set the Prefix File of dataRec's settings to prefix
72
end DataPlusPrefixFile
76
AddSimpleProject("mitsock", {}, "connect:mitsock", �
77
{"OTSocketInternal", "OTErrno", "OTSockets", "OTidle", "OTNetdbServices", "OTnetdb"})
79
AddProject(ProjectData("ncbi", {}, {�
81
{projPath:"corelib:", fileList:{�
82
"ncbibs", "ncbienv", "ncbierr", "ncbifile", "ncbimath", "ncbimem", "ncbimisc", �
83
"ncbimsg", "ncbiprop", "ncbisgml", "ncbistr", "ncbitime", "ncbilang", "gifgen", �
84
"togif", "ncbithr", "tsprintf", "tree", "wwwutils", "matrix", "binary", "regex.c"}}, �
86
{projPath:"connect:", fileList:{�
87
"ncbibuf", "ncbisock", "connection", "urlquery"}}, �
89
{projPath:"ctools:", fileList:{�
92
{projPath:"asnlib:", fileList:{�
93
"asnbufo", "asndebin", "asnenbin", "asngen", "asngenob", "asnio", "asnlex", �
94
"asnlext", "asnout", "asnprint", "asntypes"}}}))
96
AddSimpleProject("ncbiconn", {}, "connect", �
97
{"ncbi_buffer", "ncbi_socket_", "ncbi_core", "ncbi_util", "ncbi_priv", "ncbi_ansi_ext", �
98
"ncbi_connection", "ncbi_connector", "ncbi_connutil", "ncbi_file_connector", �
99
"ncbi_http_connector", "ncbi_server_info", "ncbi_service", "ncbi_service_connector", �
100
"ncbi_service_dispd", "ncbi_service_lbsmd_stub", "ncbi_socket_connector", �
103
AddProject(ProjectData("ncbiobj", {}, {�
105
{projPath:"object:", fileList:{�
106
"objacces", "objalign", "objall", "objbibli", "objblock", "objcode", "objfdef", �
107
"objfeat", "objgen", "objloc", "objmdrs", "objmedli", "objproj", �
108
"objprt", "objpub", "objpubme", "objres", "objseq", "objsset", "objalignloc", �
111
{projPath:"access:", fileList:{�
112
"objent2", "ent2api", "pmfapi", "strucapi", "qblastapi", "vecscnapi", "objmim", �
115
{projPath:"api:", fileList:{�
116
"asn2ff1", "asn2ff2", "asn2ff3", "asn2ff4", "asn2ff5", "asn2ff6", "asn2gnbk", "codon", �
117
"edutil", "ffprint", "findrepl", "ftusrstr", "gather", "gbfeat", "gbftglob", "gbparint", �
118
"jzcoll", "jzmisc", "lsqfetch", "maputil", "mconsist", "objmgr", "prtutil", "satutil", �
119
"seqmgr", "seqport", "sequtil", "simple", "sqnutil1", "sqnutil2", "sqnutil3", �
120
"subutil", "tofasta", "tofile", "tomedlin", "utilpars", "utilpub", "salpstat", �
121
"salpedit", "valid", "alignmgr", "alignmgr2", "aliparse", "aliread", "alignval", "wprint", �
122
"salpacc", "salprop", "salsap", "salstruc", "salutil", "udvseq", "blocks", �
123
"pgppop", "samutil", "ddvcolor", "viewmgr", "jsavlt", "needleman", "fdlobj", "txalign"}}, �
125
{projPath:"ddv:", fileList:{�
128
AddSimpleProject("ncbicdr", {}, "cdromlib", �
129
{"casn", "cdconfig", "cdentrez", "cdnewlib", "cdromlib", "objentr"})
131
AddSimpleProject("vibrant", {}, "vibrant", �
132
{"ncbidraw", "vibbutns", "vibextra", "vibfiles", "vibforms", "vibgroup", "viblists", �
133
"vibmenus", "vibprmpt", "vibsbars", "vibslate", "vibtexts", "vibutils", �
134
"vibwndws", "document", "drawing", "mapping", "palette", "picture", "table", �
135
"viewer", "diagnost", "image", "pictur3d", "prim3d1", "prim3d2", "prim3d3", �
136
"prim3d4", "prim3d5", "viewer3d", "vibmouse", "imagelst", "treeview", "shim3d", �
139
AddSimpleProject("ncbidesk", {}, "desktop", �
140
{"asn2graphic", "biosrc", "bspview", "cdrgn", "dlgutil1", "dlgutil2", "dotmatrx", "drawseq", �
141
"e2trmlst", "e2docsum", "fea2seg", "fstyle", "glbpic", "gbfview", "gphview", "gphdraw", �
142
"gxydraw", "gtrdraw", "ingengraph", "ingenext", "ingenwin", "import", "layout", "mapgene", �
143
"medview", "prtgene", "pubdesc", "saldist", "saled", "salfiles", "salpanel", "salparam", �
144
"salsa", "seqsub", "seqfltr", "seqgraph", "seqgrphx", "seqmtrx", "seqpcc", "seqanal", �
145
"aacomp", "seqscrl", "smdlg1", "smdlg2", "smdlg3", "smtools", "styleman", "stylemui", �
146
"vsm", "vsmfile", "vsmutil", "udvgraph", "udvopen", "udvpanel", "salogif", �
149
AddSimpleProject("ddvlib", {}, "ddv", �
150
{"ddvclick", "ddvgraph", "ddvopen", "ddvpanel"})
152
if pBuildObsoleteLibraries then
154
AddSimpleProject("ncbicacc", {}, "cdromlib", �
155
{"accentr", "accutils", "accmmdbs", "acccn3ds"})
157
AddProject(DataPlusPrefixFile(ProjectData("vibgif", {}, {�
159
{projPath:"gif:", fileList:{�
160
"gdfontg", "gdfontl", "gdfontmb", "gdfonts", "gdfontt", "pictogif"}}, �
162
{projPath:"vibrant:", fileList:{�
163
"ncbidraw", "drawing", "mapping", "picture"}}}), "gif.pfx"))
167
AddSimpleProject("ncbitool", {}, "tools", �
168
{"csim", "db_slist", "dust", "falign", "g_any", "pobutil", "stsutil", "sec", "sim2", �
169
"sim3", "sim4", "simutil", "slist", "suggadj", "suggest", "suggslp", "tfuns", �
170
"toasn3", "toporg", "blast", "blastutl", "blastool", "splutil", "actutils", "gapxdrop", �
171
"bandalg0", "bandalg1", "bandalg2", "bandalg3", "bandalg4", "bandalg5", �
172
"bandalgn", "blastkar", "lookup", "posit", "readdb", "ncbisam", "ncbisort", "salign", �
173
"salptool", "urkutil", "urkpcc", "urkptpf", "urkepi", "urkfltr", "urkdust", �
174
"urksigu", "seg", "urkbias", "urkcnsrt", "urktree", "pattern1", "pseed3", �
175
"impatool", "posit2", "newkar", "mbalign", "mblast", "vecscrn", �
176
"rpsutil", "kappa", "xmlblast", "bxmlobj", "dotseq", "spidey", "motif"})
178
AddProject(DataPlusPrefixFile(ProjectData("ncbimmdb", {}, {�
180
{projPath:"biostruc:", fileList:{�
181
"corematx", "dvncode", "objmmdb1", "objmmdb2", "objmmdb3", "mmdbapi", �
182
"mmdbapi1", "mmdbapi2", "mmdbapi3", "mmdbapi4", "mmdbentr", "vastsubs", �
185
{projPath:"object:", fileList:{�
188
{projPath:"biostruc:cn3d:", fileList:{�
191
{projPath:"biostruc:cdd:", fileList:{�
192
"objcdd", "cddutil", "cddposutil", �
193
"thrdalgs", "thrdatd", "thrdbwfi", "thrdcpal", �
194
"thrdcpll", "thrdcprl", "thrdcxei", "thrddgri", "thrdrsmp", �
195
"thrdsal0", "thrdsalr", "thrdsalu", "thrdsgoi", "thrdslo0", �
196
"thrdslor", "thrdslou", "thrdspci", "thrdspea", "thrdspel", �
197
"thrdspni", "thrdttb0", "thrdttbi", "thrdzsc"}}}), "gif.pfx"))
199
AddSimpleProject("ncbicn3d", {}, "cn3d", �
200
{"algorend", "cn3dwin", "cn3dentr", "cn3dmsel", "cn3dopen", "cn3dsave", �
201
"cn3dxprt", "cn3dmsg", "cn3dmatn", "cn3dmodl", "cn3dshim", "cn3dmesh", �
202
"cn3dstyl", "seqcons"})
204
AddSimpleProject("ncbiNacc", {}, "cdromlib", �
205
{"accentr", "accutils", "accmmdbs", "acccn3ds"})
207
AddSimpleProject("netentr", {}, "network:entrez:client", �
208
{"netentr", "netlib", "objneten"})
210
AddSimpleProject("netcli", {}, "network:nsclilib", �
211
{"ncbicli", "ncbiurl", "ni_disp", "ni_encrs", "ni_serv", "ni_error", "ni_lib_", �
212
"ni_macdv", "ni_msg", "ni_www", "ni_debug"})
214
AddSimpleProject("ncbibls3", {}, "network:blast3:client", �
215
{"netblap3", "objblst3"})
217
AddSimpleProject("ncbiid1", {}, "network:id1arch", �
218
{"id1gen", "id1arch", "accid1"})
220
AddSimpleProject("ncbimla", {}, "network:medarch:client", �
221
{"medarch", "medutil", "objmla"})
223
AddProject(DataPlusPrefixFile(ProjectData("ncbitxc2", {}, {�
225
{projPath:"network:taxon1:taxon2:", fileList:{�
226
"parttree", "taxcs", "tc2proc", "txcdproc"}}, �
228
{projPath:"network:taxon1:common:", fileList:{�
229
"objtax1", "taxutil"}}}), "tax2.pfx"))
231
AddSimpleProject("vibnet", {}, "network:vibnet", �
232
{"netcnfg", "trmlst", "docsum"})
237
tell application "Finder"
239
set corelibFolder to folder (my ModuleRoot() & "corelib")
240
set connectFolder to folder (my ModuleRoot() & "connect")
241
set ctoolsFolder to folder (my ModuleRoot() & "ctools")
243
my UpdateRenameHeader("ncbilcl.met", corelibFolder, "ncbilcl.h", "")
244
--my UpdateRenameHeader("asn_connection.h", connectFolder, "", ctoolsFolder)
274
on AddProject(projData)
276
copy projData to end of gProjectData
280
on ResolveAlias(pathname)
281
tell application "Finder"
282
--if the last character of pathname is ":" then error "Don't use a trailing colon with ResolveAlias."
283
if exists folder pathname then return pathname & ":"
284
if exists alias file pathname then return the original item of alias file pathname as string
285
error "The folder (or alias) '" & pathname & "' doesn't exist."
290
tell application "Finder"
292
set vers to the version as string as number
293
return vers > 10 or vers = 10
299
tell application "Finder"
302
return the home as string
312
return ResolveAlias(HomeDir() & "Development")
318
-- "<Boot>:Development:Trees:NCBI:vault.ncbi:"
319
-- "<Boot>:Users:<User>:Development:Trees:NCBI:vault.ncbi:"
321
set Trees to ResolveAlias(DevDir() & "Trees")
322
set NCBIgroup to ResolveAlias(Trees & "NCBI")
323
set Vault to ResolveAlias(NCBIgroup & "vault.ncbi")
330
-- "<Boot>:Development:NCBI:"
331
-- This is NOT the "distrib" directory! This is where toolkit distributions go.
332
return ResolveAlias(DevDir() & "NCBI")
339
set modRoot to ResolveAlias(DistribDir() & "ncbi")
342
set modRoot to ResolveAlias(SandboxDir() & "distrib")
344
set modRoot to ResolveAlias(gMWroot & "ncbi")
352
on CPlusPlusToolkitRoot()
355
set modRoot to ResolveAlias(DistribDir() & "c++")
358
set modRoot to ResolveAlias(ResolveAlias(SandboxDir() & "internal") & "c++")
360
set modRoot to ResolveAlias(gMWroot & "cxx")
366
end CPlusPlusToolkitRoot
370
if pUsingCPlusPlus then
371
return CPlusPlusToolkitRoot()
373
return CToolkitRoot()
381
set mwLocations to {gStartupDisk, gStartupDisk & "Applications:", gStartupDisk & "Applications (Mac OS 9):"}
382
repeat with mwVersion from 6 to 7
383
set dirName to "Metrowerks CodeWarrior " & mwVersion & ".0"
384
repeat with mwLoc in mwLocations
386
set mwRoot to ResolveAlias(mwLoc & dirName)
392
error "Can't find the Metrowerks CodeWarrior folder."
397
tell application "Finder"
399
set gProjectData to {}
401
set gStartupDisk to startup disk as string
402
set gIsOSX to my IsOSX()
403
set gHomeDir to my HomeDir()
404
set gMWroot to my MWRootDir()
405
set gMWCWfolder to gMWroot & "Metrowerks CodeWarrior:"
406
set gMacLibs to gMWCWfolder & "MacOS Support:Universal:Libraries:"
407
set gStubLibs to gMacLibs & "StubLibraries:"
408
set gPPCLibs to gMacLibs & "PPCLibraries:"
409
set gMSLPPCLibs to gMWCWfolder & "MSL:MSL_C:MSL_MacOS:Lib:PPC:"
411
set gDistribRoot to my ModuleRoot()
413
set gIncludeDir to gDistribRoot & "include:"
414
if pUsingCPlusPlus then
415
set gSourceDir to gDistribRoot & "src:"
416
set gLibsDir to gDistribRoot & "compilers:mac_prj:lib:"
417
set gOutputDir to gDistribRoot & "compilers:mac_prj:bin:"
418
set gProjectsDir to gOutputDir
420
set gSourceDir to gDistribRoot
421
set gLibsDir to gDistribRoot & "lib:"
422
set gOutputDir to gDistribRoot & "build:"
423
set gCToolsDir to gDistribRoot & "ctools:"
424
set gRsrcsDir to gDistribRoot & "link:macmet:"
427
if pLinkExecutables then
428
set gProjectsDir to gOutputDir
430
set gProjectsDir to gLibsDir
437
on HeaderExists(header, headerDir)
438
tell application "Finder"
440
if headerDir is "" then set headerDir to folder gIncludeDir
441
return exists file header of headerDir
446
on IsOlderThan(fileA, fileB)
447
tell application "Finder"
449
return (the modification date of fileA < the modification date of fileB)
454
on UpdateRenameHeader(canonicalName, canonicalDir, dotHName, dotHDir)
455
tell application "Finder"
457
set needRename to (dotHName is not "")
458
if not needRename then set dotHName to canonicalName
459
if dotHDir is "" then set dotHDir to folder gIncludeDir
461
-- This file is only present if the script was interrupted.
462
if needRename and my HeaderExists(canonicalName, dotHDir) then
463
delete file canonicalName of dotHDir
466
-- The native config file.
467
-- If it's missing, assume this is a prepared distribution and the header is already up-to-date.
468
if not my HeaderExists(canonicalName, canonicalDir) then return
469
set canonicalFile to file canonicalName of canonicalDir
472
if my HeaderExists(dotHName, dotHDir) then
473
set dotHFile to file dotHName of dotHDir
474
if my IsOlderThan(dotHFile, canonicalFile) then
477
set needCopy to false
482
duplicate canonicalFile to dotHDir
483
if needRename then set name of file canonicalName of dotHDir to dotHName
487
end UpdateRenameHeader
489
on UpdateHeader(headerName, headerDir)
491
UpdateRenameHeader(headerName, headerDir, "", "")
495
on SetDebugSettings(shouldDebug)
496
tell application "CodeWarrior IDE 4.2.5"
499
(* ===== Panel PPC Global Optimizer ===== *)
500
Set Preferences of panel "PPC Global Optimizer" to �
501
{Optimize For:code_Speed, Level:0}
502
(* ===== Panel PPC Linker ===== *)
503
Set Preferences of panel "PPC Linker" to �
504
{Generate SYM File:true �
505
, Suppress Warnings:false}
506
(* ===== Panel C/C++ Language ===== *)
507
Set Preferences of panel "C/C++ Compiler" to �
508
{Inlining:inline_none �
509
, AutoInlining:false}
512
(* ==== optimized/release settings ==== *)
513
(* ===== Panel PPC Global Optimizer ===== *)
514
Set Preferences of panel "PPC Global Optimizer" to �
515
{Optimize For:code_Speed, Level:4}
516
(* ===== Panel PPC Linker ===== *)
517
Set Preferences of panel "PPC Linker" to �
518
{Generate SYM File:false �
519
, Suppress Warnings:true}
520
(* ===== Panel C/C++ Language ===== *)
521
Set Preferences of panel "C/C++ Compiler" to �
522
{Inlining:inline_smart �
530
tell application "CodeWarrior IDE 4.2.5"
532
(* ===== Section "Target" ===== *)
534
-- Panel "Target Settings"
535
Set Preferences of panel "Target Settings" to {Linker:"MacOS PPC Linker"}
537
-- Panel "PPC Target"
538
if pLinkExecutables then
539
Set Preferences of panel "PPC Project" to �
540
{Project Type:standard application, SIZE Flags:22720, File Creator:"NCBI", File Type:"APPL", Preferred Size:8000, Minimum Size:5000, Stack Size:64}
542
Set Preferences of panel "PPC Project" to {Project Type:library}
544
(* ===== Section "Language Settings" ===== *)
546
-- Panel "C/C++ Language"
547
Set Preferences of panel "C/C++ Compiler" to �
548
{Activate CPlusPlus:false �
549
, ARM Conformance:false �
550
, Exception Handling:true �
552
, Pool Strings:true �
553
, Dont Reuse Strings:false �
554
, Require Function Prototypes:true �
555
, ANSI Strict:false �
556
, ANSI Keywords Only:false �
557
, Expand Trigraph Sequences:false �
558
, MPW Newlines:false �
559
, MPW Pointer Type Rules:false �
560
, Enums Always Ints:false}
562
-- Panel "C/C++ Warnings"
563
Set Preferences of panel "C/C++ Warnings" to �
564
{Treat Warnings As Errors:false �
565
, Illegal Pragmas:true �
566
, Empty Declarations:true �
567
, Possible Errors:true �
568
, Unused Variables:true �
569
, Unused Arguments:false �
570
, Extra Commas:true �
571
, Extended Error Checking:true �
572
, Hidden Virtual Functions:true �
573
, Implicit Arithmetic Conversions:false �
574
, NonInlined Functions:false �
575
, Inconsistent Class Struct:true}
577
(* ===== Section "Code Generation" ===== *)
579
-- Panel "PPC Processor"
580
Set Preferences of panel "PPC CodeGen" to �
581
{Struct Alignment:Align_PPC �
582
, Make Strings ReadOnly:true �
583
, Store Data in TOC:true �
584
, Use FMADD Instructions:false �
585
, Use Profiler:false �
586
, Traceback Tables:TB_Inline �
588
, Peephole Optimizer:true}
590
(* ===== Section "Linker" ===== *)
592
-- Panel "PPC Linker"
593
Set Preferences of panel "PPC Linker" to �
594
{Generate SYM File:true �
595
, Full Path In Sym Files:true �
596
, Generate Link Map:false �
598
, Initialization Name:�
600
"__start", Termination Name:""} �
603
Set Preferences of panel "PPC PEF" to �
604
{Export Symbols:none �
606
, Old Implementation:0 �
607
, Current Version:0 �
608
, Code Sorting:nosort �
609
, Share Data Section:false �
610
, Expand Uninitialized Data:false �
613
(* ===== Section "Debugger" ===== *)
615
-- Panel "Debugger Settings"
616
Set Preferences of panel "Debugger Target" to �
617
{Log System Messages:false}
625
tell application "CodeWarrior IDE 4.2.5"
627
(* ===== Panel Access Paths ===== *)
628
-- We need to be able to move the default system compiler folder to the end of the list
629
-- because certain files like "all.h" and "all" are defined by both Metrowerks and NCBI.
630
-- We want to find the NCBI "all.h" first.
631
Set Preferences of panel "Access Paths" to {System Paths:{}} -- This removes the compiler default folder
633
Set Preferences of panel "Access Paths" to {Always Full Search:true, Convert Paths:true}
639
tell application "CodeWarrior IDE 4.2.5"
641
-- Add recursive include dir AFTER source dirs to avoid major performance hit
643
-- gDistribRoot & "link:macmet:",
644
repeat with i in {gDistribRoot, �
645
gLibsDir, gIncludeDir}
646
copy {name:i, recursive:false, origin:absolute} to end of pathsToAdd
648
if not pUsingCPlusPlus then
649
copy {name:gDistribRoot & "link:macmet:", recursive:true, origin:absolute} to end of pathsToAdd
651
Set Preferences of panel "Access Paths" to {User Paths:pathsToAdd}
653
set pathsToAdd to {{name:gIncludeDir, recursive:true, origin:absolute}}
654
if not pUsingCPlusPlus then
655
copy {name:gDistribRoot, recursive:true, origin:absolute} to end of pathsToAdd
658
-- After we have added all paths, reinsert compiler default at end of list
662
-- if gPNGpresent ...
664
repeat with i in dirsToAdd
665
copy {name:i, recursive:true, origin:shell relative} to end of pathsToAdd
667
Set Preferences of panel "Access Paths" to {System Paths:pathsToAdd}
672
on AddFeatures(features, flags)
673
tell application "CodeWarrior IDE 4.2.5"
675
if features contains "BNDL" then
676
Set Preferences of panel "Output Flags" to {Has Bundle:true}
679
if features contains "sockets" and flags does not contain "Carbon" then
681
gStubLibs & "ThreadsLib", �
682
gStubLibs & "OpenTransportLib", �
683
gStubLibs & "OpenTptInternetLib", �
684
gStubLibs & "InternetConfigLib", �
685
gPPCLibs & "OpenTptInetPPC.o", �
686
gPPCLibs & "OpenTransportAppPPC.o"}
695
on SetupTarget(proj, flags)
696
tell application "CodeWarrior IDE 4.2.5"
698
-- initialize variables
700
set projFeatures to {}
703
-- Grab the fields of our project record and store them in local variables.
704
set projName to proj's name
705
set projSettings to proj's settings
707
set projFeatures to proj's features
710
set sysPaths to proj's sysPaths
713
set projRsrcs to proj's rsrcs
715
set projLibs to proj's projLibs
716
set projFileData to proj's fileData
718
-- Figure out what our output file and input libraries will be named.
719
if flags contains "Carbon" then
720
set targetAPI to "C2"
722
set targetAPI to "Mac"
724
if flags contains "debug" then
725
set targetDebug to "dbg"
727
set targetDebug to ""
729
set targetName to projName & " " & targetAPI
730
set libNameSuffix to "-" & targetAPI
731
if targetDebug is not "" then
732
set targetName to targetName & " " & targetDebug
733
set libNameSuffix to libNameSuffix & "-" & targetDebug
735
if pLinkExecutables then
736
set targetFilename to targetName
738
set targetFilename to projName & libNameSuffix & ".lib"
741
-- Make the new target, and set the current target to be it.
742
make new target at project document 1 with properties {name:targetName}
743
set the current target of project document 1 to the result
745
-- Set default settings. do this BEFORE setting per-project settings!
748
-- Set the name of the output file (the application)
749
Set Preferences of panel "PPC Project" to {File Name:targetFilename}
751
-- If we have any per-project override settings, set them.
752
if (count ppcProject of projSettings) > 0 then
753
Set Preferences of panel "PPC Project" to ppcProject of projSettings
755
--Set Preferences of panel "Access Paths" to {User Paths:{{name:NCBISOURCE & projPath, origin:absolute}}}
758
-- Add per-project system paths.
760
repeat with i in sysPaths
761
copy {name:i, recursive:true, origin:absolute} to end of pathsToAdd
763
if (count pathsToAdd) > 0 then �
764
Set Preferences of panel "Access Paths" to {System Paths:pathsToAdd}
766
-- Set the appropriate prefix file.
767
set prefixFile to Prefix File of projSettings
768
if prefixFile is "" then
769
if flags contains "debug" then
770
set prefixFile to pDebugPrefix
772
set prefixFile to pReleasePrefix
775
if flags contains "Carbon" then
776
if prefixFile is "" then
777
set prefixFile to "CarbonPrefix.h"
779
set prefixFile to "Carbon-" & prefixFile
782
Set Preferences of panel "C/C++ Compiler" to {Prefix File:prefixFile}
784
-- Are we assuming a .c or a .cpp extension?
785
if projFeatures contains "C++" then
786
set fileExtension to pCPlusPlusExtension
788
set fileExtension to ".c"
792
repeat with group in projFileData
793
set projPath to projPath of group
794
Set Preferences of panel "Access Paths" to �
795
{User Paths:{{name:gSourceDir & projPath, origin:absolute}}}
796
set fileList to group's fileList
798
repeat with i in fileList
799
if i does not contain "." then set i to i & fileExtension
800
copy gSourceDir & projPath & i to end of filesToAdd
805
if flags contains "debug" then
806
set the debug of every target file of target (count targets of project document 1) �
807
of project document 1 to true
808
my SetDebugSettings(true)
810
my SetDebugSettings(false)
813
-- Add appropriate system libraries.
814
if pLinkExecutables then
815
if flags contains "Carbon" then
821
my AddFeatures(projFeatures, flags)
825
-- Add user libraries.
826
if projFeatures contains "sockets" then
827
if projLibs does not contain "mitsock" then
828
copy "mitsock" to beginning of projLibs
831
repeat with i in projLibs
832
copy gLibsDir & i & libNameSuffix & ".lib" to end of filesToAdd
836
repeat with i in projRsrcs
837
copy gRsrcsDir & i to end of filesToAdd
848
tell application "Finder"
850
repeat with i in pDirsToCreate
851
set pth to relPath of i
852
if pth is not "" then set pth to pth & ":"
853
if not (exists folder (gDistribRoot & pth & i's name)) then
854
make new folder at folder (gDistribRoot & pth) with properties {name:i's name}
861
on CreateProject(proj)
862
tell application "CodeWarrior IDE 4.2.5"
864
-- This statement doesn't work, because AppleScript is broken.
865
if proj is {} then return
873
set projFilename to proj's name & pProjectFileExtension
874
set projPathname to gProjectsDir & projFilename
875
if pAlwaysCreateProjects or not (exists file projPathname of application "Finder") then
878
close (the first project document whose name is projFilename)
881
Create Project {projPathname}
883
if pCreateBlueTargets and pCreateDebugTargets then
884
my SetupTarget(proj, "Blue debug")
887
if pCreateBlueTargets and pCreateOptimizedTargets then
888
my SetupTarget(proj, "Blue")
891
if pCreateCarbonTargets and pCreateDebugTargets then
892
my SetupTarget(proj, "Carbon debug")
895
if pCreateCarbonTargets and pCreateOptimizedTargets then
896
my SetupTarget(proj, "Carbon")
899
set the current target of project document 1 to target 1 of project document 1
908
on CreateAllProjects()
910
repeat with proj in gProjectData
914
end CreateAllProjects
916
on BuildProject(projName)
917
tell application "CodeWarrior IDE 4.2.5"
918
open (gProjectsDir & projName & pProjectFileExtension)
919
repeat with i from 2 to (count targets of project document 1)
920
set the current target of project document 1 to target i of project document 1
922
-- If there were compiler warnings, then a compiler window will be in front.
923
-- For whatever reason, this causes the next "set the current target..." to fail.
924
-- An easy way to make the window go away without having to know if it's there or not
925
-- is to build again, which, because everything is already compiled, finishes instantly
926
-- and produces no warnings.
928
-- An even better way is to check for the window and close it.
929
if the name of window 1 is "Errors & Warnings" then
930
close first window -- "close window 1" becomes "Close Window 1" (different event)
933
set the current target of project document 1 to target 1 of project document 1
938
on BuildAllProjects()
940
repeat with proj in gProjectData
942
set projName to proj's name
946
-- This statement doesn't work, because AppleScript is broken.
947
if proj is not {} then
948
if projName is not "" then
949
BuildProject(projName)
956
on SignalCompletion()
966
with timeout of 60000 seconds
975
tell application "CodeWarrior IDE 4.2.5" to activate