blob: 88108bfebe39948593fcc98cfd6938b8ba6c9af4 [file] [log] [blame]
Jack Jansen6655c4e1995-09-01 12:03:32 +00001#
2# fullbuild creates everything that needs to be created before a
3# distribution can be made, and puts it all in the right place.
4#
5# It expects the projects to be in the places where Jack likes them:
6# in directories named like 'build.macppc.shared'. That is fixable,
7# however.
8#
9# NOTE: You should proably make a copy of python with which to execute this
10# script, rebuilding running programs does not work...
11
12import os
13import sys
14import macfs
15
16import addpack
17addpack.addpack('Tools')
18addpack.addpack('bgen')
19addpack.addpack('AE')
20import aetools
21from Metrowerks_Shell_Suite import Metrowerks_Shell_Suite
22from Required_Suite import Required_Suite
23
24addpack.addpack('Mac')
25addpack.addpack('scripts')
26import mkapplet
27
28class MwShell(aetools.TalkTo, Metrowerks_Shell_Suite, Required_Suite):
29 pass
30
31
32def buildmwproject(top, creator, projects):
33 """Build projects with an MW compiler"""
34 print 'Please start project mgr with signature', creator,'-'
35 sys.stdin.readline()
36 try:
37 mgr = MwShell(creator)
38 except 'foo':
39 print 'Not handled:', creator
40 return
41 for file in projects:
42 file = os.path.join(top, file)
43 fss = macfs.FSSpec(file)
44 print 'Building', file
45 mgr.open(fss)
46 mgr.Make_Project()
47 mgr.Close_Project()
48 mgr.quit()
49
50def buildapplet(top, dummy, list):
51 """Create a PPC python applet"""
52 template = mkapplet.findtemplate()
53 for src in list:
54 if src[-3:] != '.py':
55 raise 'Should end in .py', src
56 base = os.path.basename(src)
57 dst = os.path.join(top, base)[:-3]
58 src = os.path.join(top, src)
59 try:
60 os.unlink(dst)
61 except os.error:
62 pass
63 print 'Building applet', dst
64 mkapplet.process(template, src, dst)
65
66#
67# The build instructions. Entries are (routine, arg, list-of-files)
68# XXXX We could also include the builds for stdwin and such here...
69INSTRUCTIONS=[
70 (buildmwproject, "MPCC", [
71 ":build.macppc.shared:PythonCore.µ",
72 ":build.macppc.shared:PythonPPC.µ",
73 ":build.macppc.shared:PythonApplet.µ",
74
75 ":PlugIns:ctbmodule.µ",
76 ":PlugIns:imgmodules.µ",
77 ":PlugIns:macspeechmodule.µ",
78 ":PlugIns:mactcpmodules.µ",
79 ":PlugIns:stdwinmodule.µ",
80 ":PlugIns:toolboxmodules.µ",
81 ]),
82 (buildmwproject, "MMCC", [
83 ":build.mac68k.stand:Python68K.µ",
84 ]),
85 (buildapplet, None, [
86 ":Mac:scripts:EditPythonPrefs.py",
87 ":Mac:scripts:mkapplet.py",
88 ":Mac:scripts:RunLibScript.py"
89 ])
90]
91
92def main():
93 dir, ok = macfs.GetDirectory('Python source folder:')
94 if not ok:
95 sys.exit(0)
96 dir = dir.as_pathname()
97 for routine, arg, list in INSTRUCTIONS:
98 routine(dir, arg, list)
99 print "All done!"
100 sys.exit(1)
101
102if __name__ == '__main__':
103 main()
104