Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 1 | # |
| 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: |
Jack Jansen | faad995 | 1997-09-01 15:37:07 +0000 | [diff] [blame] | 6 | # in directories named like 'build.mac'. That is fixable, |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 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 | |
Jack Jansen | faad995 | 1997-09-01 15:37:07 +0000 | [diff] [blame] | 12 | MACBUILDNO=":Mac:Include:macbuildno.h" |
| 13 | |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 14 | import os |
| 15 | import sys |
| 16 | import macfs |
Jack Jansen | 1023dff | 1996-02-21 15:28:49 +0000 | [diff] [blame] | 17 | import MacOS |
Jack Jansen | f04fa72 | 1996-04-10 14:51:14 +0000 | [diff] [blame] | 18 | import EasyDialogs |
Jack Jansen | be614ee | 2001-01-02 22:02:02 +0000 | [diff] [blame] | 19 | import re |
Jack Jansen | faad995 | 1997-09-01 15:37:07 +0000 | [diff] [blame] | 20 | import string |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 21 | |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 22 | import aetools |
Jack Jansen | 1023dff | 1996-02-21 15:28:49 +0000 | [diff] [blame] | 23 | import AppleEvents |
Jack Jansen | 87426b9 | 2000-08-17 22:12:12 +0000 | [diff] [blame] | 24 | |
| 25 | OLDAESUPPORT = 0 |
| 26 | |
| 27 | if OLDAESUPPORT: |
| 28 | from Metrowerks_Shell_Suite import Metrowerks_Shell_Suite |
| 29 | from CodeWarrior_suite import CodeWarrior_suite |
| 30 | from Metrowerks_Standard_Suite import Metrowerks_Standard_Suite |
| 31 | from Required_Suite import Required_Suite |
| 32 | else: |
| 33 | import CodeWarrior |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 34 | |
| 35 | import Res |
| 36 | import Dlg |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 37 | |
Jack Jansen | 490ec9c | 1998-07-31 09:45:27 +0000 | [diff] [blame] | 38 | import buildtools |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 39 | import cfmfile |
| 40 | |
| 41 | # Dialog resource. Note that the item numbers should correspond |
| 42 | # to those in the DITL resource. Also note that the order is important: |
| 43 | # things are built in this order, so there should be no forward dependencies. |
| 44 | DIALOG_ID = 512 |
| 45 | |
| 46 | I_OK=1 |
| 47 | I_CANCEL=2 |
Jack Jansen | e56e87d | 2001-01-03 11:12:21 +0000 | [diff] [blame] | 48 | # label 3 |
| 49 | I_PPC_EXTLIBS=4 |
| 50 | I_GEN_PROJECTS=5 |
Jack Jansen | 1f5cd70 | 2001-01-21 22:25:11 +0000 | [diff] [blame] | 51 | I_GEN_PROJECTS_FORCE=6 |
| 52 | I_GEN_IMGPROJECTS=7 |
| 53 | I_GEN_IMGPROJECTS_FORCE=8 |
| 54 | I_INC_BUILDNO=9 |
| 55 | # label 10 |
| 56 | I_PPC_CORE=11 |
| 57 | I_PPC_PLUGINS=12 |
| 58 | I_PPC_EXTENSIONS=13 |
| 59 | # label 14 |
| 60 | I_CARBON_CORE=15 |
| 61 | I_CARBON_PLUGINS=16 |
| 62 | I_CARBON_EXTENSIONS=17 |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 63 | I_INTERPRETER=18 |
| 64 | # label 19 |
| 65 | I_PPC_FULL=20 |
| 66 | I_PPC_SMALL=21 |
| 67 | # label 22 |
| 68 | I_CARBON_FULL=23 |
| 69 | I_CARBON_SMALL=24 |
| 70 | # label 25 |
| 71 | I_APPLETS=26 |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 72 | |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 73 | N_BUTTONS=27 |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 74 | |
Jack Jansen | 87426b9 | 2000-08-17 22:12:12 +0000 | [diff] [blame] | 75 | if OLDAESUPPORT: |
| 76 | class MwShell(Metrowerks_Shell_Suite, CodeWarrior_suite, Metrowerks_Standard_Suite, |
| 77 | Required_Suite, aetools.TalkTo): |
| 78 | pass |
| 79 | else: |
| 80 | MwShell = CodeWarrior.CodeWarrior |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 81 | |
Jack Jansen | f04fa72 | 1996-04-10 14:51:14 +0000 | [diff] [blame] | 82 | RUNNING=[] |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 83 | |
| 84 | def buildmwproject(top, creator, projects): |
| 85 | """Build projects with an MW compiler""" |
Jack Jansen | b9e5e14 | 1996-09-20 15:30:52 +0000 | [diff] [blame] | 86 | mgr = MwShell(creator, start=1) |
Jack Jansen | 1023dff | 1996-02-21 15:28:49 +0000 | [diff] [blame] | 87 | mgr.send_timeout = AppleEvents.kNoTimeOut |
| 88 | |
Jack Jansen | bc66f95 | 2000-07-24 19:45:07 +0000 | [diff] [blame] | 89 | failed = [] |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 90 | for file in projects: |
Jack Jansen | 82bfde9 | 1997-08-27 14:10:29 +0000 | [diff] [blame] | 91 | if type(file) == type(()): |
| 92 | file, target = file |
| 93 | else: |
| 94 | target = '' |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 95 | file = os.path.join(top, file) |
Just van Rossum | 2607a44 | 1999-01-30 18:27:12 +0000 | [diff] [blame] | 96 | try: |
| 97 | fss = macfs.FSSpec(file) |
Jack Jansen | e56e87d | 2001-01-03 11:12:21 +0000 | [diff] [blame] | 98 | except MacOS.Error: |
Just van Rossum | 2607a44 | 1999-01-30 18:27:12 +0000 | [diff] [blame] | 99 | print '** file not found:', file |
| 100 | continue |
Jack Jansen | 82bfde9 | 1997-08-27 14:10:29 +0000 | [diff] [blame] | 101 | print 'Building', file, target |
Just van Rossum | 2607a44 | 1999-01-30 18:27:12 +0000 | [diff] [blame] | 102 | try: |
| 103 | mgr.open(fss) |
| 104 | except aetools.Error, detail: |
| 105 | print '**', detail, file |
| 106 | continue |
Jack Jansen | 82bfde9 | 1997-08-27 14:10:29 +0000 | [diff] [blame] | 107 | if target: |
| 108 | try: |
| 109 | mgr.Set_Current_Target(target) |
| 110 | except aetools.Error, arg: |
| 111 | print '**', file, target, 'Cannot select:', arg |
Jack Jansen | 1023dff | 1996-02-21 15:28:49 +0000 | [diff] [blame] | 112 | try: |
| 113 | mgr.Make_Project() |
Jack Jansen | b9e5e14 | 1996-09-20 15:30:52 +0000 | [diff] [blame] | 114 | except aetools.Error, arg: |
Jack Jansen | 82bfde9 | 1997-08-27 14:10:29 +0000 | [diff] [blame] | 115 | print '**', file, target, 'Failed:', arg |
Jack Jansen | bc66f95 | 2000-07-24 19:45:07 +0000 | [diff] [blame] | 116 | failed.append(fss) |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 117 | mgr.Close_Project() |
Jack Jansen | bc66f95 | 2000-07-24 19:45:07 +0000 | [diff] [blame] | 118 | if failed: |
| 119 | print 'Open failed projects and exit?', |
| 120 | rv = sys.stdin.readline() |
| 121 | if rv[0] in ('y', 'Y'): |
| 122 | for fss in failed: |
| 123 | mgr.open(fss) |
| 124 | sys.exit(0) |
Jack Jansen | f04fa72 | 1996-04-10 14:51:14 +0000 | [diff] [blame] | 125 | ## mgr.quit() |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 126 | |
| 127 | def buildapplet(top, dummy, list): |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 128 | """Create python applets""" |
Jack Jansen | cbb5d49 | 2001-02-17 23:31:48 +0000 | [diff] [blame] | 129 | for src, dst, tmpl in list: |
| 130 | template = buildtools.findtemplate(tmpl) |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 131 | if src[-3:] != '.py': |
| 132 | raise 'Should end in .py', src |
| 133 | base = os.path.basename(src) |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 134 | src = os.path.join(top, src) |
Just van Rossum | 9d609b4 | 1999-02-01 01:21:18 +0000 | [diff] [blame] | 135 | dst = os.path.join(top, dst) |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 136 | try: |
| 137 | os.unlink(dst) |
| 138 | except os.error: |
| 139 | pass |
| 140 | print 'Building applet', dst |
Jack Jansen | cbb5d49 | 2001-02-17 23:31:48 +0000 | [diff] [blame] | 141 | try: |
| 142 | buildtools.process(template, src, dst, 1) |
| 143 | except buildtools.BuildError, arg: |
| 144 | print '**', dst, arg |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 145 | |
Jack Jansen | 1f5cd70 | 2001-01-21 22:25:11 +0000 | [diff] [blame] | 146 | def buildprojectfile(top, arg, list): |
Jack Jansen | e56e87d | 2001-01-03 11:12:21 +0000 | [diff] [blame] | 147 | """Create CodeWarrior project files with a script""" |
| 148 | for folder, module, routine in list: |
| 149 | print "Generating project files with", module |
| 150 | sys.path.insert(0, os.path.join(top, folder)) |
| 151 | m = __import__(module) |
| 152 | r = getattr(m, routine) |
Jack Jansen | 1f5cd70 | 2001-01-21 22:25:11 +0000 | [diff] [blame] | 153 | r(arg) |
Jack Jansen | e56e87d | 2001-01-03 11:12:21 +0000 | [diff] [blame] | 154 | del sys.path[0] |
| 155 | |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 156 | def buildfat(top, dummy, list): |
| 157 | """Build fat binaries""" |
| 158 | for dst, src1, src2 in list: |
| 159 | dst = os.path.join(top, dst) |
| 160 | src1 = os.path.join(top, src1) |
| 161 | src2 = os.path.join(top, src2) |
| 162 | print 'Building fat binary', dst |
| 163 | cfmfile.mergecfmfiles((src1, src2), dst) |
| 164 | |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 165 | def buildcopy(top, dummy, list): |
| 166 | import macostools |
| 167 | for src, dst in list: |
| 168 | src = os.path.join(top, src) |
| 169 | dst = os.path.join(top, dst) |
Jack Jansen | c1463c98 | 2001-03-06 22:46:25 +0000 | [diff] [blame] | 170 | macostools.copy(src, dst, forcetype="APPL") |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 171 | |
Jack Jansen | 675cda0 | 1997-09-09 13:57:15 +0000 | [diff] [blame] | 172 | def handle_dialog(filename): |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 173 | """Handle selection dialog, return list of selected items""" |
| 174 | d = Dlg.GetNewDialog(DIALOG_ID, -1) |
| 175 | d.SetDialogDefaultItem(I_OK) |
| 176 | d.SetDialogCancelItem(I_CANCEL) |
| 177 | results = [0]*N_BUTTONS |
| 178 | while 1: |
| 179 | n = Dlg.ModalDialog(None) |
| 180 | if n == I_OK: |
| 181 | break |
| 182 | if n == I_CANCEL: |
| 183 | return [] |
Jack Jansen | 675cda0 | 1997-09-09 13:57:15 +0000 | [diff] [blame] | 184 | if n == I_INC_BUILDNO: |
| 185 | incbuildno(filename) |
| 186 | continue |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 187 | if n < len(results): |
| 188 | results[n] = (not results[n]) |
Jack Jansen | c9b1e90 | 1999-12-24 13:39:23 +0000 | [diff] [blame] | 189 | ctl = d.GetDialogItemAsControl(n) |
| 190 | ctl.SetControlValue(results[n]) |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 191 | rv = [] |
| 192 | for i in range(len(results)): |
| 193 | if results[i]: |
| 194 | rv.append(i) |
| 195 | return rv |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 196 | |
| 197 | # |
| 198 | # The build instructions. Entries are (routine, arg, list-of-files) |
| 199 | # XXXX We could also include the builds for stdwin and such here... |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 200 | BUILD_DICT = { |
Jack Jansen | 1f5cd70 | 2001-01-21 22:25:11 +0000 | [diff] [blame] | 201 | I_GEN_PROJECTS : (buildprojectfile, 0, [ |
Jack Jansen | e56e87d | 2001-01-03 11:12:21 +0000 | [diff] [blame] | 202 | (":Mac:scripts", "genpluginprojects", "genallprojects") |
| 203 | ]), |
| 204 | |
Jack Jansen | 1f5cd70 | 2001-01-21 22:25:11 +0000 | [diff] [blame] | 205 | I_GEN_PROJECTS_FORCE : (buildprojectfile, 1, [ |
| 206 | (":Mac:scripts", "genpluginprojects", "genallprojects") |
| 207 | ]), |
| 208 | |
| 209 | I_GEN_IMGPROJECTS : (buildprojectfile, 0, [ |
Jack Jansen | e56e87d | 2001-01-03 11:12:21 +0000 | [diff] [blame] | 210 | (":Extensions:img:Mac", "genimgprojects", "genallprojects") |
| 211 | ]), |
| 212 | |
Jack Jansen | 1f5cd70 | 2001-01-21 22:25:11 +0000 | [diff] [blame] | 213 | I_GEN_IMGPROJECTS_FORCE : (buildprojectfile, 1, [ |
| 214 | (":Extensions:img:Mac", "genimgprojects", "genallprojects") |
| 215 | ]), |
| 216 | |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 217 | I_INTERPRETER : (buildcopy, None, [ |
| 218 | ("PythonInterpreterCarbon", "PythonInterpreter"), |
| 219 | ]), |
| 220 | |
Jack Jansen | 1f5cd70 | 2001-01-21 22:25:11 +0000 | [diff] [blame] | 221 | I_PPC_CORE : (buildmwproject, "CWIE", [ |
Jack Jansen | a5d384d | 2000-12-03 22:36:42 +0000 | [diff] [blame] | 222 | (":Mac:Build:PythonCore.mcp", "PythonCore"), |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 223 | (":Mac:Build:PythonInterpreter.mcp", "PythonInterpreterClassic"), |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 224 | ]), |
| 225 | |
Jack Jansen | 1f5cd70 | 2001-01-21 22:25:11 +0000 | [diff] [blame] | 226 | I_CARBON_CORE : (buildmwproject, "CWIE", [ |
| 227 | (":Mac:Build:PythonCore.mcp", "PythonCoreCarbon"), |
| 228 | (":Mac:Build:PythonInterpreter.mcp", "PythonInterpreterCarbon"), |
| 229 | ]), |
| 230 | |
Jack Jansen | e56e87d | 2001-01-03 11:12:21 +0000 | [diff] [blame] | 231 | I_PPC_EXTLIBS : (buildmwproject, "CWIE", [ |
| 232 | ## (":Mac:Build:buildlibs.mcp", "buildlibs ppc plus tcl/tk"), |
| 233 | (":Mac:Build:buildlibs.mcp", "buildlibs ppc"), |
| 234 | ]), |
| 235 | |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 236 | I_PPC_PLUGINS : (buildmwproject, "CWIE", [ |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 237 | (":Mac:Build:_weakref.mcp", "_weakref.ppc"), |
| 238 | (":Mac:Build:_symtable.mcp", "_symtable.ppc"), |
| 239 | (":Mac:Build:_testcapi.mcp", "_testcapi.ppc"), |
Jack Jansen | a5d384d | 2000-12-03 22:36:42 +0000 | [diff] [blame] | 240 | (":Mac:Build:pyexpat.mcp", "pyexpat.ppc"), |
| 241 | (":Mac:Build:calldll.mcp", "calldll.ppc"), |
| 242 | (":Mac:Build:ctb.mcp", "ctb.ppc"), |
| 243 | (":Mac:Build:gdbm.mcp", "gdbm.ppc"), |
| 244 | (":Mac:Build:icglue.mcp", "icglue.ppc"), |
| 245 | (":Mac:Build:macspeech.mcp", "macspeech.ppc"), |
| 246 | (":Mac:Build:waste.mcp", "waste.ppc"), |
| 247 | (":Mac:Build:zlib.mcp", "zlib.ppc"), |
| 248 | ## (":Mac:Build:_tkinter.mcp", "_tkinter.ppc"), |
Jack Jansen | 07d69f6 | 2001-01-01 21:51:33 +0000 | [diff] [blame] | 249 | (":Extensions:Imaging:_tkinter.mcp", "_tkinter.ppc"), |
Jack Jansen | a5d384d | 2000-12-03 22:36:42 +0000 | [diff] [blame] | 250 | (":Mac:Build:ColorPicker.mcp", "ColorPicker.ppc"), |
| 251 | (":Mac:Build:Printing.mcp", "Printing.ppc"), |
| 252 | (":Mac:Build:App.mcp", "App.ppc"), |
| 253 | (":Mac:Build:Cm.mcp", "Cm.ppc"), |
Jack Jansen | a5d384d | 2000-12-03 22:36:42 +0000 | [diff] [blame] | 254 | (":Mac:Build:Fm.mcp", "Fm.ppc"), |
| 255 | (":Mac:Build:Help.mcp", "Help.ppc"), |
| 256 | (":Mac:Build:Icn.mcp", "Icn.ppc"), |
| 257 | (":Mac:Build:List.mcp", "List.ppc"), |
| 258 | (":Mac:Build:Qdoffs.mcp", "Qdoffs.ppc"), |
| 259 | (":Mac:Build:Qt.mcp", "Qt.ppc"), |
| 260 | (":Mac:Build:Scrap.mcp", "Scrap.ppc"), |
| 261 | (":Mac:Build:Snd.mcp", "Snd.ppc"), |
| 262 | (":Mac:Build:Sndihooks.mcp", "Sndihooks.ppc"), |
| 263 | (":Mac:Build:TE.mcp", "TE.ppc"), |
Jack Jansen | 654c8db | 2001-07-16 22:04:08 +0000 | [diff] [blame] | 264 | (":Mac:Build:Mlte.mcp", "Mlte.ppc"), |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 265 | ]), |
| 266 | |
Jack Jansen | c3fc51f | 2001-01-23 22:36:52 +0000 | [diff] [blame] | 267 | I_CARBON_PLUGINS : (buildmwproject, "CWIE", [ |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 268 | (":Mac:Build:_weakref.carbon.mcp", "_weakref.carbon"), |
| 269 | (":Mac:Build:_symtable.carbon.mcp", "_symtable.carbon"), |
| 270 | (":Mac:Build:_testcapi.carbon.mcp", "_testcapi.carbon"), |
Jack Jansen | c3fc51f | 2001-01-23 22:36:52 +0000 | [diff] [blame] | 271 | (":Mac:Build:pyexpat.carbon.mcp", "pyexpat.carbon"), |
| 272 | (":Mac:Build:calldll.carbon.mcp", "calldll.carbon"), |
| 273 | (":Mac:Build:gdbm.carbon.mcp", "gdbm.carbon"), |
Jack Jansen | 5a8115c | 2001-01-29 13:27:46 +0000 | [diff] [blame] | 274 | (":Mac:Build:icglue.carbon.mcp", "icglue.carbon"), |
Jack Jansen | 8c98266 | 2001-01-24 16:02:07 +0000 | [diff] [blame] | 275 | (":Mac:Build:waste.carbon.mcp", "waste.carbon"), |
Jack Jansen | c3fc51f | 2001-01-23 22:36:52 +0000 | [diff] [blame] | 276 | (":Mac:Build:zlib.carbon.mcp", "zlib.carbon"), |
Jack Jansen | 875b51d | 2001-03-20 23:30:06 +0000 | [diff] [blame] | 277 | (":Mac:Build:_dummy_tkinter.mcp", "_tkinter.carbon"), |
Jack Jansen | c3fc51f | 2001-01-23 22:36:52 +0000 | [diff] [blame] | 278 | ## (":Extensions:Imaging:_tkinter.carbon.mcp", "_tkinter.carbon"), |
| 279 | (":Mac:Build:ColorPicker.carbon.mcp", "ColorPicker.carbon"), |
| 280 | (":Mac:Build:App.carbon.mcp", "App.carbon"), |
| 281 | (":Mac:Build:Cm.carbon.mcp", "Cm.carbon"), |
| 282 | (":Mac:Build:Fm.carbon.mcp", "Fm.carbon"), |
| 283 | (":Mac:Build:Icn.carbon.mcp", "Icn.carbon"), |
| 284 | (":Mac:Build:List.carbon.mcp", "List.carbon"), |
| 285 | (":Mac:Build:Qdoffs.carbon.mcp", "Qdoffs.carbon"), |
| 286 | (":Mac:Build:Qt.carbon.mcp", "Qt.carbon"), |
Jack Jansen | 8c98266 | 2001-01-24 16:02:07 +0000 | [diff] [blame] | 287 | (":Mac:Build:Scrap.carbon.mcp", "Scrap.carbon"), |
Jack Jansen | c3fc51f | 2001-01-23 22:36:52 +0000 | [diff] [blame] | 288 | (":Mac:Build:Snd.carbon.mcp", "Snd.carbon"), |
| 289 | (":Mac:Build:Sndihooks.carbon.mcp", "Sndihooks.carbon"), |
| 290 | (":Mac:Build:TE.carbon.mcp", "TE.carbon"), |
Jack Jansen | f4b9fb7 | 2001-06-26 21:52:08 +0000 | [diff] [blame] | 291 | |
| 292 | (":Mac:Build:CF.carbon.mcp", "CF.carbon"), |
Jack Jansen | 1986412 | 2001-07-13 20:57:47 +0000 | [diff] [blame] | 293 | (":Mac:Build:Mlte.carbon.mcp", "Mlte.carbon"), |
Jack Jansen | c3fc51f | 2001-01-23 22:36:52 +0000 | [diff] [blame] | 294 | ]), |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 295 | |
Jack Jansen | 131c288 | 2001-01-24 14:06:35 +0000 | [diff] [blame] | 296 | I_PPC_FULL : (buildmwproject, "CWIE", [ |
| 297 | (":Mac:Build:PythonStandalone.mcp", "PythonStandalone"), |
| 298 | ]), |
| 299 | |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 300 | I_PPC_SMALL : (buildmwproject, "CWIE", [ |
Jack Jansen | a5d384d | 2000-12-03 22:36:42 +0000 | [diff] [blame] | 301 | (":Mac:Build:PythonStandSmall.mcp", "PythonStandSmall"), |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 302 | ]), |
| 303 | |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 304 | I_CARBON_FULL : (buildmwproject, "CWIE", [ |
| 305 | (":Mac:Build:PythonStandalone.mcp", "PythonCarbonStandalone"), |
| 306 | ]), |
| 307 | |
| 308 | I_CARBON_SMALL : (buildmwproject, "CWIE", [ |
| 309 | (":Mac:Build:PythonStandSmall.mcp", "PythonStandSmallCarbon"), |
| 310 | ]), |
| 311 | |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 312 | I_PPC_EXTENSIONS : (buildmwproject, "CWIE", [ |
Jack Jansen | a5d384d | 2000-12-03 22:36:42 +0000 | [diff] [blame] | 313 | (":Extensions:Imaging:_imaging.mcp", "_imaging.ppc"), |
| 314 | ## (":Extensions:Imaging:_tkinter.mcp", "_tkinter.ppc"), |
Jack Jansen | 7b7e713 | 2001-01-23 23:19:41 +0000 | [diff] [blame] | 315 | (":Extensions:img:Mac:imgmodules.mcp", "imgmodules.ppc"), |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 316 | ]), |
| 317 | |
Jack Jansen | 7b7e713 | 2001-01-23 23:19:41 +0000 | [diff] [blame] | 318 | I_CARBON_EXTENSIONS : (buildmwproject, "CWIE", [ |
Jack Jansen | a647807 | 2001-03-01 23:15:01 +0000 | [diff] [blame] | 319 | (":Extensions:Imaging:_imaging.mcp", "_imaging.carbon"), |
Jack Jansen | 7b7e713 | 2001-01-23 23:19:41 +0000 | [diff] [blame] | 320 | ## (":Extensions:Imaging:_tkinter.mcp", "_tkinter.carbon"), |
| 321 | (":Extensions:img:Mac:imgmodules.mcp", "imgmodules.carbon"), |
Jack Jansen | 7b7e713 | 2001-01-23 23:19:41 +0000 | [diff] [blame] | 322 | ]), |
| 323 | |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 324 | I_APPLETS : (buildapplet, None, [ |
Jack Jansen | cbb5d49 | 2001-02-17 23:31:48 +0000 | [diff] [blame] | 325 | (":Mac:scripts:EditPythonPrefs.py", "EditPythonPrefs", None), |
| 326 | (":Mac:scripts:BuildApplet.py", "BuildApplet", None), |
| 327 | (":Mac:scripts:BuildApplication.py", "BuildApplication", None), |
| 328 | (":Mac:scripts:ConfigurePython.py", "ConfigurePython", None), |
| 329 | (":Mac:scripts:ConfigurePython.py", "ConfigurePythonCarbon", "PythonInterpreterCarbon"), |
| 330 | (":Mac:scripts:ConfigurePython.py", "ConfigurePythonClassic", "PythonInterpreterClassic"), |
| 331 | (":Mac:Tools:IDE:PythonIDE.py", "Python IDE", None), |
| 332 | (":Mac:Tools:CGI:PythonCGISlave.py", ":Mac:Tools:CGI:PythonCGISlave", None), |
| 333 | (":Mac:Tools:CGI:BuildCGIApplet.py", ":Mac:Tools:CGI:BuildCGIApplet", None), |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 334 | ]), |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 335 | } |
Jack Jansen | faad995 | 1997-09-01 15:37:07 +0000 | [diff] [blame] | 336 | |
| 337 | def incbuildno(filename): |
| 338 | fp = open(filename) |
| 339 | line = fp.readline() |
| 340 | fp.close() |
| 341 | |
Jack Jansen | be614ee | 2001-01-02 22:02:02 +0000 | [diff] [blame] | 342 | pat = re.compile('#define BUILD ([0-9]+)') |
| 343 | m = pat.search(line) |
| 344 | if not m or not m.group(1): |
Jack Jansen | faad995 | 1997-09-01 15:37:07 +0000 | [diff] [blame] | 345 | raise 'Incorrect macbuildno.h line', line |
Jack Jansen | be614ee | 2001-01-02 22:02:02 +0000 | [diff] [blame] | 346 | buildno = m.group(1) |
Jack Jansen | faad995 | 1997-09-01 15:37:07 +0000 | [diff] [blame] | 347 | new = string.atoi(buildno) + 1 |
| 348 | fp = open(filename, 'w') |
| 349 | fp.write('#define BUILD %d\n'%new) |
| 350 | fp.close() |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 351 | |
| 352 | def main(): |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 353 | try: |
Jack Jansen | d13c385 | 2000-06-20 21:59:25 +0000 | [diff] [blame] | 354 | h = Res.FSpOpenResFile('fullbuild.rsrc', 1) |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 355 | except Res.Error: |
| 356 | pass # Assume we already have acces to our own resource |
| 357 | |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 358 | dir, ok = macfs.GetDirectory('Python source folder:') |
| 359 | if not ok: |
| 360 | sys.exit(0) |
| 361 | dir = dir.as_pathname() |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 362 | |
Jack Jansen | 675cda0 | 1997-09-09 13:57:15 +0000 | [diff] [blame] | 363 | todo = handle_dialog(os.path.join(dir, MACBUILDNO)) |
| 364 | |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 365 | instructions = [] |
| 366 | for i in todo: |
| 367 | instructions.append(BUILD_DICT[i]) |
| 368 | |
| 369 | for routine, arg, list in instructions: |
Jack Jansen | 8b4c987 | 1997-05-07 15:52:12 +0000 | [diff] [blame] | 370 | routine(dir, arg, list) |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 371 | |
Jack Jansen | e56e87d | 2001-01-03 11:12:21 +0000 | [diff] [blame] | 372 | if todo: |
| 373 | print "All done!" |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 374 | |
| 375 | if __name__ == '__main__': |
| 376 | main() |
| 377 | |