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 | c70815a | 2002-06-26 22:06:08 +0000 | [diff] [blame] | 12 | CARBON_ONLY = 1 |
| 13 | |
Jack Jansen | faad995 | 1997-09-01 15:37:07 +0000 | [diff] [blame] | 14 | MACBUILDNO=":Mac:Include:macbuildno.h" |
| 15 | |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 16 | import os |
| 17 | import sys |
Jack Jansen | 6fa2dc7 | 2003-03-21 12:56:27 +0000 | [diff] [blame] | 18 | import Carbon.File |
Jack Jansen | 1023dff | 1996-02-21 15:28:49 +0000 | [diff] [blame] | 19 | import MacOS |
Jack Jansen | f04fa72 | 1996-04-10 14:51:14 +0000 | [diff] [blame] | 20 | import EasyDialogs |
Jack Jansen | be614ee | 2001-01-02 22:02:02 +0000 | [diff] [blame] | 21 | import re |
Jack Jansen | faad995 | 1997-09-01 15:37:07 +0000 | [diff] [blame] | 22 | import string |
Jack Jansen | e791a64 | 2001-08-16 20:39:17 +0000 | [diff] [blame] | 23 | import genpluginprojects |
Jack Jansen | 3c06b9a | 2001-08-27 21:41:23 +0000 | [diff] [blame] | 24 | import macresource |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 25 | |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 26 | import aetools |
Jack Jansen | 5a6fdcd | 2001-08-25 12:15:04 +0000 | [diff] [blame] | 27 | from Carbon import AppleEvents |
Jack Jansen | 87426b9 | 2000-08-17 22:12:12 +0000 | [diff] [blame] | 28 | |
Jack Jansen | c70815a | 2002-06-26 22:06:08 +0000 | [diff] [blame] | 29 | import CodeWarrior |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 30 | |
Jack Jansen | 5a6fdcd | 2001-08-25 12:15:04 +0000 | [diff] [blame] | 31 | from Carbon import Res |
| 32 | from Carbon import Dlg |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 33 | |
Jack Jansen | 490ec9c | 1998-07-31 09:45:27 +0000 | [diff] [blame] | 34 | import buildtools |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 35 | import cfmfile |
| 36 | |
| 37 | # Dialog resource. Note that the item numbers should correspond |
| 38 | # to those in the DITL resource. Also note that the order is important: |
| 39 | # things are built in this order, so there should be no forward dependencies. |
| 40 | DIALOG_ID = 512 |
| 41 | |
| 42 | I_OK=1 |
| 43 | I_CANCEL=2 |
Jack Jansen | e56e87d | 2001-01-03 11:12:21 +0000 | [diff] [blame] | 44 | # label 3 |
| 45 | I_PPC_EXTLIBS=4 |
| 46 | I_GEN_PROJECTS=5 |
Jack Jansen | 1f5cd70 | 2001-01-21 22:25:11 +0000 | [diff] [blame] | 47 | I_GEN_PROJECTS_FORCE=6 |
| 48 | I_GEN_IMGPROJECTS=7 |
| 49 | I_GEN_IMGPROJECTS_FORCE=8 |
| 50 | I_INC_BUILDNO=9 |
| 51 | # label 10 |
| 52 | I_PPC_CORE=11 |
| 53 | I_PPC_PLUGINS=12 |
| 54 | I_PPC_EXTENSIONS=13 |
| 55 | # label 14 |
| 56 | I_CARBON_CORE=15 |
| 57 | I_CARBON_PLUGINS=16 |
| 58 | I_CARBON_EXTENSIONS=17 |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 59 | I_INTERPRETER=18 |
| 60 | # label 19 |
| 61 | I_PPC_FULL=20 |
| 62 | I_PPC_SMALL=21 |
| 63 | # label 22 |
| 64 | I_CARBON_FULL=23 |
| 65 | I_CARBON_SMALL=24 |
| 66 | # label 25 |
| 67 | I_APPLETS=26 |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 68 | |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 69 | N_BUTTONS=27 |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 70 | |
Jack Jansen | c70815a | 2002-06-26 22:06:08 +0000 | [diff] [blame] | 71 | if CARBON_ONLY: |
| 72 | BUTTONS_DISABLE = [ |
| 73 | I_PPC_EXTLIBS, |
| 74 | I_PPC_CORE, |
| 75 | I_PPC_PLUGINS, |
| 76 | I_PPC_EXTENSIONS, |
| 77 | I_INTERPRETER, |
| 78 | I_PPC_FULL, |
| 79 | I_PPC_SMALL, |
| 80 | ] |
Jack Jansen | 87426b9 | 2000-08-17 22:12:12 +0000 | [diff] [blame] | 81 | else: |
Jack Jansen | c70815a | 2002-06-26 22:06:08 +0000 | [diff] [blame] | 82 | BUTTONS_DISABLE = [] |
| 83 | |
Jack Jansen | f04fa72 | 1996-04-10 14:51:14 +0000 | [diff] [blame] | 84 | RUNNING=[] |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 85 | |
| 86 | def buildmwproject(top, creator, projects): |
| 87 | """Build projects with an MW compiler""" |
Jack Jansen | c70815a | 2002-06-26 22:06:08 +0000 | [diff] [blame] | 88 | mgr = CodeWarrior.CodeWarrior(creator, start=1) |
Jack Jansen | 1023dff | 1996-02-21 15:28:49 +0000 | [diff] [blame] | 89 | mgr.send_timeout = AppleEvents.kNoTimeOut |
| 90 | |
Jack Jansen | bc66f95 | 2000-07-24 19:45:07 +0000 | [diff] [blame] | 91 | failed = [] |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 92 | for file in projects: |
Jack Jansen | 82bfde9 | 1997-08-27 14:10:29 +0000 | [diff] [blame] | 93 | if type(file) == type(()): |
| 94 | file, target = file |
| 95 | else: |
| 96 | target = '' |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 97 | file = os.path.join(top, file) |
Just van Rossum | 2607a44 | 1999-01-30 18:27:12 +0000 | [diff] [blame] | 98 | try: |
Jack Jansen | 6fa2dc7 | 2003-03-21 12:56:27 +0000 | [diff] [blame] | 99 | fss = Carbon.File.FSSpec(file) |
Jack Jansen | e56e87d | 2001-01-03 11:12:21 +0000 | [diff] [blame] | 100 | except MacOS.Error: |
Just van Rossum | 2607a44 | 1999-01-30 18:27:12 +0000 | [diff] [blame] | 101 | print '** file not found:', file |
| 102 | continue |
Jack Jansen | 82bfde9 | 1997-08-27 14:10:29 +0000 | [diff] [blame] | 103 | print 'Building', file, target |
Just van Rossum | 2607a44 | 1999-01-30 18:27:12 +0000 | [diff] [blame] | 104 | try: |
| 105 | mgr.open(fss) |
| 106 | except aetools.Error, detail: |
| 107 | print '**', detail, file |
| 108 | continue |
Jack Jansen | 82bfde9 | 1997-08-27 14:10:29 +0000 | [diff] [blame] | 109 | if target: |
| 110 | try: |
| 111 | mgr.Set_Current_Target(target) |
| 112 | except aetools.Error, arg: |
| 113 | print '**', file, target, 'Cannot select:', arg |
Jack Jansen | 1023dff | 1996-02-21 15:28:49 +0000 | [diff] [blame] | 114 | try: |
| 115 | mgr.Make_Project() |
Jack Jansen | b9e5e14 | 1996-09-20 15:30:52 +0000 | [diff] [blame] | 116 | except aetools.Error, arg: |
Jack Jansen | 82bfde9 | 1997-08-27 14:10:29 +0000 | [diff] [blame] | 117 | print '**', file, target, 'Failed:', arg |
Jack Jansen | bc66f95 | 2000-07-24 19:45:07 +0000 | [diff] [blame] | 118 | failed.append(fss) |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 119 | mgr.Close_Project() |
Jack Jansen | bc66f95 | 2000-07-24 19:45:07 +0000 | [diff] [blame] | 120 | if failed: |
| 121 | print 'Open failed projects and exit?', |
| 122 | rv = sys.stdin.readline() |
| 123 | if rv[0] in ('y', 'Y'): |
| 124 | for fss in failed: |
| 125 | mgr.open(fss) |
| 126 | sys.exit(0) |
Jack Jansen | f04fa72 | 1996-04-10 14:51:14 +0000 | [diff] [blame] | 127 | ## mgr.quit() |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 128 | |
| 129 | def buildapplet(top, dummy, list): |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 130 | """Create python applets""" |
Jack Jansen | cbb5d49 | 2001-02-17 23:31:48 +0000 | [diff] [blame] | 131 | for src, dst, tmpl in list: |
| 132 | template = buildtools.findtemplate(tmpl) |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 133 | if src[-3:] != '.py': |
| 134 | raise 'Should end in .py', src |
| 135 | base = os.path.basename(src) |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 136 | src = os.path.join(top, src) |
Just van Rossum | 9d609b4 | 1999-02-01 01:21:18 +0000 | [diff] [blame] | 137 | dst = os.path.join(top, dst) |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 138 | try: |
| 139 | os.unlink(dst) |
| 140 | except os.error: |
| 141 | pass |
| 142 | print 'Building applet', dst |
Jack Jansen | cbb5d49 | 2001-02-17 23:31:48 +0000 | [diff] [blame] | 143 | try: |
| 144 | buildtools.process(template, src, dst, 1) |
| 145 | except buildtools.BuildError, arg: |
| 146 | print '**', dst, arg |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 147 | |
Jack Jansen | 1f5cd70 | 2001-01-21 22:25:11 +0000 | [diff] [blame] | 148 | def buildprojectfile(top, arg, list): |
Jack Jansen | e56e87d | 2001-01-03 11:12:21 +0000 | [diff] [blame] | 149 | """Create CodeWarrior project files with a script""" |
| 150 | for folder, module, routine in list: |
| 151 | print "Generating project files with", module |
| 152 | sys.path.insert(0, os.path.join(top, folder)) |
| 153 | m = __import__(module) |
| 154 | r = getattr(m, routine) |
Jack Jansen | 1f5cd70 | 2001-01-21 22:25:11 +0000 | [diff] [blame] | 155 | r(arg) |
Jack Jansen | e56e87d | 2001-01-03 11:12:21 +0000 | [diff] [blame] | 156 | del sys.path[0] |
| 157 | |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 158 | def buildfat(top, dummy, list): |
| 159 | """Build fat binaries""" |
| 160 | for dst, src1, src2 in list: |
| 161 | dst = os.path.join(top, dst) |
| 162 | src1 = os.path.join(top, src1) |
| 163 | src2 = os.path.join(top, src2) |
| 164 | print 'Building fat binary', dst |
| 165 | cfmfile.mergecfmfiles((src1, src2), dst) |
| 166 | |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 167 | def buildcopy(top, dummy, list): |
| 168 | import macostools |
| 169 | for src, dst in list: |
| 170 | src = os.path.join(top, src) |
| 171 | dst = os.path.join(top, dst) |
Jack Jansen | c1463c98 | 2001-03-06 22:46:25 +0000 | [diff] [blame] | 172 | macostools.copy(src, dst, forcetype="APPL") |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 173 | |
Jack Jansen | 1892cf0 | 2002-06-27 22:09:19 +0000 | [diff] [blame] | 174 | def buildsetup(top, dummy, list): |
| 175 | print 'Building extensions with setup.py ', ' '.join(list) |
| 176 | argv = ['setup.py'] + list[:] |
| 177 | save_argv = sys.argv |
| 178 | sys.argv = argv |
| 179 | sys.path.insert(0, top) |
| 180 | m = __import__('setup') |
| 181 | r = getattr(m, 'main') |
| 182 | r() |
| 183 | del sys.path[0] |
| 184 | sys.argv = save_argv |
| 185 | |
| 186 | def buildcarbonplugins(top, dummy1, dummy2): |
| 187 | ## XXXX Need to convert pathnames, I guess, and adapt distutils Mac-specific |
| 188 | ## code to not call GetArgv if not needed. |
| 189 | ## buildsetup(top, None, [ |
| 190 | ## '--dry_run', |
| 191 | ## 'install', |
| 192 | ## '--prefix=%s' % sys.prefix, |
| 193 | ## '--install-scripts=%s' % os.path.join(sys.prefix, 'Scripts'), |
| 194 | ## '--install-platlib=%s' % os.path.join(sys.prefix, 'Lib', 'lib-dynload') |
| 195 | ## ]) |
| 196 | buildmwproject(top, "CWIE", [ |
Jack Jansen | 6fa2dc7 | 2003-03-21 12:56:27 +0000 | [diff] [blame] | 197 | (":Mac:Build:_csv.carbon.mcp", "_csv.carbon"), |
Jack Jansen | 1892cf0 | 2002-06-27 22:09:19 +0000 | [diff] [blame] | 198 | (":Mac:Build:_weakref.carbon.mcp", "_weakref.carbon"), |
| 199 | (":Mac:Build:_symtable.carbon.mcp", "_symtable.carbon"), |
| 200 | (":Mac:Build:_testcapi.carbon.mcp", "_testcapi.carbon"), |
| 201 | (":Mac:Build:_hotshot.carbon.mcp", "_hotshot.carbon"), |
| 202 | (":Mac:Build:xx.carbon.mcp", "xx.carbon"), |
| 203 | (":Mac:Build:xxsubtype.carbon.mcp", "xxsubtype.carbon"), |
| 204 | (":Mac:Build:pyexpat.carbon.mcp", "pyexpat.carbon"), |
| 205 | (":Mac:Build:calldll.carbon.mcp", "calldll.carbon"), |
Jack Jansen | 3e82872 | 2003-01-08 16:27:44 +0000 | [diff] [blame] | 206 | (":Mac:Build:datetime.carbon.mcp", "datetime.carbon"), |
Jack Jansen | 1892cf0 | 2002-06-27 22:09:19 +0000 | [diff] [blame] | 207 | (":Mac:Build:gdbm.carbon.mcp", "gdbm.carbon"), |
| 208 | (":Mac:Build:icglue.carbon.mcp", "icglue.carbon"), |
| 209 | (":Mac:Build:waste.carbon.mcp", "waste.carbon"), |
| 210 | (":Mac:Build:zlib.carbon.mcp", "zlib.carbon"), |
| 211 | (":Mac:Build:hfsplus.carbon.mcp", "hfsplus.carbon"), |
Jack Jansen | 1892cf0 | 2002-06-27 22:09:19 +0000 | [diff] [blame] | 212 | (":Mac:Build:ColorPicker.carbon.mcp", "ColorPicker.carbon"), |
| 213 | (":Mac:Build:_AE.carbon.mcp", "_AE.carbon"), |
Jack Jansen | 25a8f0d | 2002-09-06 22:59:00 +0000 | [diff] [blame] | 214 | (":Mac:Build:_AH.carbon.mcp", "_AH.carbon"), |
Jack Jansen | 1892cf0 | 2002-06-27 22:09:19 +0000 | [diff] [blame] | 215 | (":Mac:Build:_App.carbon.mcp", "_App.carbon"), |
| 216 | (":Mac:Build:_CF.carbon.mcp", "_CF.carbon"), |
| 217 | (":Mac:Build:_CG.carbon.mcp", "_CG.carbon"), |
| 218 | (":Mac:Build:_CarbonEvt.carbon.mcp", "_CarbonEvt.carbon"), |
| 219 | (":Mac:Build:_Cm.carbon.mcp", "_Cm.carbon"), |
| 220 | (":Mac:Build:_Ctl.carbon.mcp", "_Ctl.carbon"), |
| 221 | (":Mac:Build:_Dlg.carbon.mcp", "_Dlg.carbon"), |
| 222 | (":Mac:Build:_Drag.carbon.mcp", "_Drag.carbon"), |
| 223 | (":Mac:Build:_Evt.carbon.mcp", "_Evt.carbon"), |
Jack Jansen | 9ea729c | 2002-12-13 23:34:03 +0000 | [diff] [blame] | 224 | (":Mac:Build:_File.carbon.mcp", "_File.carbon"), |
Jack Jansen | 1892cf0 | 2002-06-27 22:09:19 +0000 | [diff] [blame] | 225 | (":Mac:Build:_Fm.carbon.mcp", "_Fm.carbon"), |
Jack Jansen | 9ea729c | 2002-12-13 23:34:03 +0000 | [diff] [blame] | 226 | (":Mac:Build:_Folder.carbon.mcp", "_Folder.carbon"), |
| 227 | (":Mac:Build:_Help.carbon.mcp", "_Help.carbon"), |
Jack Jansen | 3bd3fed | 2002-08-05 14:12:24 +0000 | [diff] [blame] | 228 | (":Mac:Build:_IBCarbon.carbon.mcp", "_IBCarbon.carbon"), |
Jack Jansen | 1892cf0 | 2002-06-27 22:09:19 +0000 | [diff] [blame] | 229 | (":Mac:Build:_Icn.carbon.mcp", "_Icn.carbon"), |
| 230 | (":Mac:Build:_List.carbon.mcp", "_List.carbon"), |
| 231 | (":Mac:Build:_Menu.carbon.mcp", "_Menu.carbon"), |
| 232 | (":Mac:Build:_Mlte.carbon.mcp", "_Mlte.carbon"), |
| 233 | (":Mac:Build:_Qd.carbon.mcp", "_Qd.carbon"), |
| 234 | (":Mac:Build:_Qdoffs.carbon.mcp", "_Qdoffs.carbon"), |
| 235 | (":Mac:Build:_Qt.carbon.mcp", "_Qt.carbon"), |
| 236 | (":Mac:Build:_Res.carbon.mcp", "_Res.carbon"), |
| 237 | (":Mac:Build:_Scrap.carbon.mcp", "_Scrap.carbon"), |
| 238 | (":Mac:Build:_Snd.carbon.mcp", "_Snd.carbon"), |
| 239 | (":Mac:Build:_Sndihooks.carbon.mcp", "_Sndihooks.carbon"), |
| 240 | (":Mac:Build:_TE.carbon.mcp", "_TE.carbon"), |
| 241 | (":Mac:Build:_Win.carbon.mcp", "_Win.carbon"), |
| 242 | ]) |
| 243 | |
Jack Jansen | 675cda0 | 1997-09-09 13:57:15 +0000 | [diff] [blame] | 244 | def handle_dialog(filename): |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 245 | """Handle selection dialog, return list of selected items""" |
| 246 | d = Dlg.GetNewDialog(DIALOG_ID, -1) |
| 247 | d.SetDialogDefaultItem(I_OK) |
| 248 | d.SetDialogCancelItem(I_CANCEL) |
| 249 | results = [0]*N_BUTTONS |
Jack Jansen | c70815a | 2002-06-26 22:06:08 +0000 | [diff] [blame] | 250 | for n in BUTTONS_DISABLE: |
| 251 | ctl = d.GetDialogItemAsControl(n) |
| 252 | ctl.HideControl() |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 253 | while 1: |
| 254 | n = Dlg.ModalDialog(None) |
| 255 | if n == I_OK: |
| 256 | break |
| 257 | if n == I_CANCEL: |
| 258 | return [] |
Jack Jansen | 675cda0 | 1997-09-09 13:57:15 +0000 | [diff] [blame] | 259 | if n == I_INC_BUILDNO: |
| 260 | incbuildno(filename) |
| 261 | continue |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 262 | if n < len(results): |
| 263 | results[n] = (not results[n]) |
Jack Jansen | c9b1e90 | 1999-12-24 13:39:23 +0000 | [diff] [blame] | 264 | ctl = d.GetDialogItemAsControl(n) |
| 265 | ctl.SetControlValue(results[n]) |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 266 | rv = [] |
| 267 | for i in range(len(results)): |
| 268 | if results[i]: |
| 269 | rv.append(i) |
| 270 | return rv |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 271 | |
| 272 | # |
| 273 | # The build instructions. Entries are (routine, arg, list-of-files) |
| 274 | # XXXX We could also include the builds for stdwin and such here... |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 275 | BUILD_DICT = { |
Jack Jansen | 1f5cd70 | 2001-01-21 22:25:11 +0000 | [diff] [blame] | 276 | I_GEN_PROJECTS : (buildprojectfile, 0, [ |
Jack Jansen | e56e87d | 2001-01-03 11:12:21 +0000 | [diff] [blame] | 277 | (":Mac:scripts", "genpluginprojects", "genallprojects") |
| 278 | ]), |
| 279 | |
Jack Jansen | 1f5cd70 | 2001-01-21 22:25:11 +0000 | [diff] [blame] | 280 | I_GEN_PROJECTS_FORCE : (buildprojectfile, 1, [ |
| 281 | (":Mac:scripts", "genpluginprojects", "genallprojects") |
| 282 | ]), |
| 283 | |
| 284 | I_GEN_IMGPROJECTS : (buildprojectfile, 0, [ |
Jack Jansen | e56e87d | 2001-01-03 11:12:21 +0000 | [diff] [blame] | 285 | (":Extensions:img:Mac", "genimgprojects", "genallprojects") |
| 286 | ]), |
| 287 | |
Jack Jansen | 1f5cd70 | 2001-01-21 22:25:11 +0000 | [diff] [blame] | 288 | I_GEN_IMGPROJECTS_FORCE : (buildprojectfile, 1, [ |
| 289 | (":Extensions:img:Mac", "genimgprojects", "genallprojects") |
| 290 | ]), |
| 291 | |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 292 | I_INTERPRETER : (buildcopy, None, [ |
| 293 | ("PythonInterpreterCarbon", "PythonInterpreter"), |
| 294 | ]), |
| 295 | |
Jack Jansen | 1f5cd70 | 2001-01-21 22:25:11 +0000 | [diff] [blame] | 296 | I_PPC_CORE : (buildmwproject, "CWIE", [ |
Jack Jansen | a5d384d | 2000-12-03 22:36:42 +0000 | [diff] [blame] | 297 | (":Mac:Build:PythonCore.mcp", "PythonCore"), |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 298 | (":Mac:Build:PythonInterpreter.mcp", "PythonInterpreterClassic"), |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 299 | ]), |
| 300 | |
Jack Jansen | 1f5cd70 | 2001-01-21 22:25:11 +0000 | [diff] [blame] | 301 | I_CARBON_CORE : (buildmwproject, "CWIE", [ |
| 302 | (":Mac:Build:PythonCore.mcp", "PythonCoreCarbon"), |
| 303 | (":Mac:Build:PythonInterpreter.mcp", "PythonInterpreterCarbon"), |
| 304 | ]), |
| 305 | |
Jack Jansen | e56e87d | 2001-01-03 11:12:21 +0000 | [diff] [blame] | 306 | I_PPC_EXTLIBS : (buildmwproject, "CWIE", [ |
| 307 | ## (":Mac:Build:buildlibs.mcp", "buildlibs ppc plus tcl/tk"), |
| 308 | (":Mac:Build:buildlibs.mcp", "buildlibs ppc"), |
| 309 | ]), |
| 310 | |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 311 | I_PPC_PLUGINS : (buildmwproject, "CWIE", [ |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 312 | (":Mac:Build:_weakref.mcp", "_weakref.ppc"), |
| 313 | (":Mac:Build:_symtable.mcp", "_symtable.ppc"), |
| 314 | (":Mac:Build:_testcapi.mcp", "_testcapi.ppc"), |
Jack Jansen | 6f1da00 | 2001-10-23 22:23:44 +0000 | [diff] [blame] | 315 | (":Mac:Build:_hotshot.mcp", "_hotshot.ppc"), |
Jack Jansen | 7c10008 | 2001-08-29 22:08:06 +0000 | [diff] [blame] | 316 | (":Mac:Build:xx.mcp", "xx.ppc"), |
| 317 | (":Mac:Build:xxsubtype.mcp", "xxsubtype.ppc"), |
Jack Jansen | a5d384d | 2000-12-03 22:36:42 +0000 | [diff] [blame] | 318 | (":Mac:Build:pyexpat.mcp", "pyexpat.ppc"), |
| 319 | (":Mac:Build:calldll.mcp", "calldll.ppc"), |
| 320 | (":Mac:Build:ctb.mcp", "ctb.ppc"), |
| 321 | (":Mac:Build:gdbm.mcp", "gdbm.ppc"), |
| 322 | (":Mac:Build:icglue.mcp", "icglue.ppc"), |
| 323 | (":Mac:Build:macspeech.mcp", "macspeech.ppc"), |
| 324 | (":Mac:Build:waste.mcp", "waste.ppc"), |
| 325 | (":Mac:Build:zlib.mcp", "zlib.ppc"), |
| 326 | ## (":Mac:Build:_tkinter.mcp", "_tkinter.ppc"), |
Jack Jansen | 07d69f6 | 2001-01-01 21:51:33 +0000 | [diff] [blame] | 327 | (":Extensions:Imaging:_tkinter.mcp", "_tkinter.ppc"), |
Jack Jansen | a5d384d | 2000-12-03 22:36:42 +0000 | [diff] [blame] | 328 | (":Mac:Build:ColorPicker.mcp", "ColorPicker.ppc"), |
| 329 | (":Mac:Build:Printing.mcp", "Printing.ppc"), |
Jack Jansen | 77105a9 | 2001-08-23 13:51:46 +0000 | [diff] [blame] | 330 | (":Mac:Build:_AE.mcp", "_AE.ppc"), |
| 331 | (":Mac:Build:_App.mcp", "_App.ppc"), |
| 332 | (":Mac:Build:_Cm.mcp", "_Cm.ppc"), |
| 333 | (":Mac:Build:_Ctl.mcp", "_Ctl.ppc"), |
| 334 | (":Mac:Build:_Dlg.mcp", "_Dlg.ppc"), |
| 335 | (":Mac:Build:_Drag.mcp", "_Drag.ppc"), |
| 336 | (":Mac:Build:_Evt.mcp", "_Evt.ppc"), |
| 337 | (":Mac:Build:_Fm.mcp", "_Fm.ppc"), |
| 338 | (":Mac:Build:_Help.mcp", "_Help.ppc"), |
| 339 | (":Mac:Build:_Icn.mcp", "_Icn.ppc"), |
| 340 | (":Mac:Build:_List.mcp", "_List.ppc"), |
| 341 | (":Mac:Build:_Menu.mcp", "_Menu.ppc"), |
| 342 | (":Mac:Build:_Mlte.mcp", "_Mlte.ppc"), |
| 343 | (":Mac:Build:_Qd.mcp", "_Qd.ppc"), |
| 344 | (":Mac:Build:_Qdoffs.mcp", "_Qdoffs.ppc"), |
| 345 | (":Mac:Build:_Qt.mcp", "_Qt.ppc"), |
| 346 | (":Mac:Build:_Res.mcp", "_Res.ppc"), |
| 347 | (":Mac:Build:_Scrap.mcp", "_Scrap.ppc"), |
| 348 | (":Mac:Build:_Snd.mcp", "_Snd.ppc"), |
| 349 | (":Mac:Build:_Sndihooks.mcp", "_Sndihooks.ppc"), |
| 350 | (":Mac:Build:_TE.mcp", "_TE.ppc"), |
| 351 | (":Mac:Build:_Win.mcp", "_Win.ppc"), |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 352 | ]), |
| 353 | |
Jack Jansen | 1892cf0 | 2002-06-27 22:09:19 +0000 | [diff] [blame] | 354 | I_CARBON_PLUGINS : (buildcarbonplugins, None, []), |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 355 | |
Jack Jansen | 131c288 | 2001-01-24 14:06:35 +0000 | [diff] [blame] | 356 | I_PPC_FULL : (buildmwproject, "CWIE", [ |
| 357 | (":Mac:Build:PythonStandalone.mcp", "PythonStandalone"), |
| 358 | ]), |
| 359 | |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 360 | I_PPC_SMALL : (buildmwproject, "CWIE", [ |
Jack Jansen | a5d384d | 2000-12-03 22:36:42 +0000 | [diff] [blame] | 361 | (":Mac:Build:PythonStandSmall.mcp", "PythonStandSmall"), |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 362 | ]), |
| 363 | |
Jack Jansen | 5288c47 | 2001-02-12 14:46:53 +0000 | [diff] [blame] | 364 | I_CARBON_FULL : (buildmwproject, "CWIE", [ |
| 365 | (":Mac:Build:PythonStandalone.mcp", "PythonCarbonStandalone"), |
| 366 | ]), |
| 367 | |
| 368 | I_CARBON_SMALL : (buildmwproject, "CWIE", [ |
| 369 | (":Mac:Build:PythonStandSmall.mcp", "PythonStandSmallCarbon"), |
| 370 | ]), |
| 371 | |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 372 | I_PPC_EXTENSIONS : (buildmwproject, "CWIE", [ |
Jack Jansen | a5d384d | 2000-12-03 22:36:42 +0000 | [diff] [blame] | 373 | (":Extensions:Imaging:_imaging.mcp", "_imaging.ppc"), |
| 374 | ## (":Extensions:Imaging:_tkinter.mcp", "_tkinter.ppc"), |
Jack Jansen | 7b7e713 | 2001-01-23 23:19:41 +0000 | [diff] [blame] | 375 | (":Extensions:img:Mac:imgmodules.mcp", "imgmodules.ppc"), |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 376 | ]), |
| 377 | |
Jack Jansen | 7b7e713 | 2001-01-23 23:19:41 +0000 | [diff] [blame] | 378 | I_CARBON_EXTENSIONS : (buildmwproject, "CWIE", [ |
Jack Jansen | a647807 | 2001-03-01 23:15:01 +0000 | [diff] [blame] | 379 | (":Extensions:Imaging:_imaging.mcp", "_imaging.carbon"), |
Jack Jansen | 7b7e713 | 2001-01-23 23:19:41 +0000 | [diff] [blame] | 380 | ## (":Extensions:Imaging:_tkinter.mcp", "_tkinter.carbon"), |
| 381 | (":Extensions:img:Mac:imgmodules.mcp", "imgmodules.carbon"), |
Jack Jansen | 7b7e713 | 2001-01-23 23:19:41 +0000 | [diff] [blame] | 382 | ]), |
| 383 | |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 384 | I_APPLETS : (buildapplet, None, [ |
Jack Jansen | cbb5d49 | 2001-02-17 23:31:48 +0000 | [diff] [blame] | 385 | (":Mac:scripts:EditPythonPrefs.py", "EditPythonPrefs", None), |
| 386 | (":Mac:scripts:BuildApplet.py", "BuildApplet", None), |
| 387 | (":Mac:scripts:BuildApplication.py", "BuildApplication", None), |
| 388 | (":Mac:scripts:ConfigurePython.py", "ConfigurePython", None), |
Jack Jansen | fd372aa | 2002-08-22 23:37:00 +0000 | [diff] [blame] | 389 | ## (":Mac:scripts:ConfigurePython.py", "ConfigurePythonCarbon", "PythonInterpreterCarbon"), |
| 390 | ## (":Mac:scripts:ConfigurePython.py", "ConfigurePythonClassic", "PythonInterpreterClassic"), |
Jack Jansen | cbb5d49 | 2001-02-17 23:31:48 +0000 | [diff] [blame] | 391 | (":Mac:Tools:IDE:PythonIDE.py", "Python IDE", None), |
| 392 | (":Mac:Tools:CGI:PythonCGISlave.py", ":Mac:Tools:CGI:PythonCGISlave", None), |
| 393 | (":Mac:Tools:CGI:BuildCGIApplet.py", ":Mac:Tools:CGI:BuildCGIApplet", None), |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 394 | ]), |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 395 | } |
Jack Jansen | faad995 | 1997-09-01 15:37:07 +0000 | [diff] [blame] | 396 | |
| 397 | def incbuildno(filename): |
| 398 | fp = open(filename) |
| 399 | line = fp.readline() |
| 400 | fp.close() |
| 401 | |
Jack Jansen | be614ee | 2001-01-02 22:02:02 +0000 | [diff] [blame] | 402 | pat = re.compile('#define BUILD ([0-9]+)') |
| 403 | m = pat.search(line) |
| 404 | if not m or not m.group(1): |
Jack Jansen | faad995 | 1997-09-01 15:37:07 +0000 | [diff] [blame] | 405 | raise 'Incorrect macbuildno.h line', line |
Jack Jansen | be614ee | 2001-01-02 22:02:02 +0000 | [diff] [blame] | 406 | buildno = m.group(1) |
Jack Jansen | faad995 | 1997-09-01 15:37:07 +0000 | [diff] [blame] | 407 | new = string.atoi(buildno) + 1 |
| 408 | fp = open(filename, 'w') |
| 409 | fp.write('#define BUILD %d\n'%new) |
| 410 | fp.close() |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 411 | |
| 412 | def main(): |
Jack Jansen | 3c06b9a | 2001-08-27 21:41:23 +0000 | [diff] [blame] | 413 | macresource.need('DLOG', DIALOG_ID, 'fullbuild.rsrc') |
Jack Jansen | b340acf | 2003-01-26 21:40:00 +0000 | [diff] [blame] | 414 | dir = EasyDialogs.AskFolder(message='Python source folder:') |
| 415 | if not dir: |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 416 | sys.exit(0) |
Jack Jansen | e791a64 | 2001-08-16 20:39:17 +0000 | [diff] [blame] | 417 | # Set genpluginprojects to use this folder (slight hack) |
| 418 | genpluginprojects.PYTHONDIR = dir |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 419 | |
Jack Jansen | 675cda0 | 1997-09-09 13:57:15 +0000 | [diff] [blame] | 420 | todo = handle_dialog(os.path.join(dir, MACBUILDNO)) |
| 421 | |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 422 | instructions = [] |
| 423 | for i in todo: |
| 424 | instructions.append(BUILD_DICT[i]) |
| 425 | |
| 426 | for routine, arg, list in instructions: |
Jack Jansen | 8b4c987 | 1997-05-07 15:52:12 +0000 | [diff] [blame] | 427 | routine(dir, arg, list) |
Jack Jansen | 0f00c5e | 1997-05-06 16:15:32 +0000 | [diff] [blame] | 428 | |
Jack Jansen | e56e87d | 2001-01-03 11:12:21 +0000 | [diff] [blame] | 429 | if todo: |
| 430 | print "All done!" |
Jack Jansen | 6655c4e | 1995-09-01 12:03:32 +0000 | [diff] [blame] | 431 | |
| 432 | if __name__ == '__main__': |
| 433 | main() |
| 434 | |