Jack Jansen | cb4321e | 2002-08-09 00:18:21 +0000 | [diff] [blame] | 1 | # This file can be invoked from the various frameworkinstall... targets in the |
| 2 | # main Makefile. The next couple of variables are overridden on the |
Jack Jansen | 0b06be7 | 2002-06-21 14:48:38 +0000 | [diff] [blame] | 3 | # commandline in that case. |
| 4 | |
Jack Jansen | cb4321e | 2002-08-09 00:18:21 +0000 | [diff] [blame] | 5 | VERSION=2.3 |
Jack Jansen | be3e1f7 | 2002-08-01 21:14:06 +0000 | [diff] [blame] | 6 | builddir = ../.. |
| 7 | srcdir = ../.. |
Jack Jansen | cb4321e | 2002-08-09 00:18:21 +0000 | [diff] [blame] | 8 | dstroot=/. |
Jack Jansen | e3d9f40 | 2002-09-02 12:16:00 +0000 | [diff] [blame] | 9 | prefix=$(dstroot)/Library/Frameworks/Python.framework/Versions/$(VERSION) |
| 10 | LIBDEST=$(prefix)/lib/python$(VERSION) |
Jack Jansen | 04087b5 | 2003-02-25 12:41:10 +0000 | [diff] [blame] | 11 | BUILDPYTHON=$(builddir)/python.exe |
Jack Jansen | cb4321e | 2002-08-09 00:18:21 +0000 | [diff] [blame] | 12 | |
| 13 | # These are normally glimpsed from the previous set |
| 14 | bindir=$(dstroot)/usr/local/bin |
Jack Jansen | cfe2836 | 2002-12-25 22:31:28 +0000 | [diff] [blame] | 15 | PYTHONAPPSPATH=/Applications/MacPython-$(VERSION) |
Jack Jansen | 1ebcc44 | 2002-11-20 14:06:16 +0000 | [diff] [blame] | 16 | PYTHONAPPSDIR=$(dstroot)$(PYTHONAPPSPATH) |
Jack Jansen | be3e1f7 | 2002-08-01 21:14:06 +0000 | [diff] [blame] | 17 | APPINSTALLDIR=$(prefix)/Resources/Python.app |
Jack Jansen | 75ed167 | 2001-09-05 22:09:50 +0000 | [diff] [blame] | 18 | |
Jack Jansen | 0cd0e65 | 2002-03-29 14:18:18 +0000 | [diff] [blame] | 19 | # Variables for installing the "normal" unix binaries |
Jack Jansen | be3e1f7 | 2002-08-01 21:14:06 +0000 | [diff] [blame] | 20 | INSTALLED_PYTHON=$(prefix)/bin/python |
Jack Jansen | 0cd0e65 | 2002-03-29 14:18:18 +0000 | [diff] [blame] | 21 | INSTALLED_PYTHONW=$(APPINSTALLDIR)/Contents/MacOS/python |
| 22 | |
Jack Jansen | 638e5e3 | 2001-09-06 16:33:57 +0000 | [diff] [blame] | 23 | # Items more-or-less copied from the main Makefile |
| 24 | DIRMODE=755 |
| 25 | INSTALL=/usr/bin/install -c |
Jack Jansen | bdbff73 | 2002-08-30 15:14:02 +0000 | [diff] [blame] | 26 | INSTALL_SYMLINK=ln -fs |
Jack Jansen | 638e5e3 | 2001-09-06 16:33:57 +0000 | [diff] [blame] | 27 | INSTALL_PROGRAM=${INSTALL} |
| 28 | INSTALL_SCRIPT= ${INSTALL_PROGRAM} |
| 29 | INSTALL_DATA= ${INSTALL} -m 644 |
Jack Jansen | 4684a09 | 2002-08-28 21:27:02 +0000 | [diff] [blame] | 30 | LN=ln |
Jack Jansen | 0cd0e65 | 2002-03-29 14:18:18 +0000 | [diff] [blame] | 31 | STRIPFLAG=-s |
Jack Jansen | 7d996a2 | 2002-11-11 00:05:00 +0000 | [diff] [blame] | 32 | ##OPT=-g -O3 -Wall -Wstrict-prototypes -Wno-long-double -no-cpp-precomp \ |
| 33 | ## -fno-common -dynamic |
| 34 | ##INCLUDES=-I$(builddir) -I$(srcdir)/Include -I$(srcdir)/Mac/Include |
| 35 | ##DEFINES= |
| 36 | ## |
| 37 | ##CFLAGS=$(OPT) $(DEFINES) $(INCLUDES) |
| 38 | ##LDFLAGS=-F$(builddir) -framework System -framework Python -framework Carbon \ |
| 39 | ## -framework Foundation |
| 40 | ##CC=cc |
| 41 | ##LD=cc |
Jack Jansen | 8120415 | 2002-08-15 21:31:18 +0000 | [diff] [blame] | 42 | CPMAC=/Developer/Tools/CpMac |
Jack Jansen | 75ed167 | 2001-09-05 22:09:50 +0000 | [diff] [blame] | 43 | |
Jack Jansen | be3e1f7 | 2002-08-01 21:14:06 +0000 | [diff] [blame] | 44 | APPTEMPLATE=$(srcdir)/Mac/OSXResources/app |
Jack Jansen | 82f1d2c | 2003-03-11 23:07:08 +0000 | [diff] [blame] | 45 | APPSUBDIRS=MacOS Resources Resources/English.lproj \ |
| 46 | Resources/English.lproj/Documentation \ |
| 47 | Resources/English.lproj/Documentation/doc \ |
| 48 | Resources/English.lproj/Documentation/macpython_ide_tutorial |
| 49 | DOCDIR=$(srcdir)/Mac/OSXResources/app/Resources/English.lproj/Documentation |
| 50 | DOCINDEX=$(DOCDIR)/"Documentation idx" |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 51 | CACHERSRC=$(srcdir)/Mac/scripts/cachersrc.py |
Jack Jansen | 7d996a2 | 2002-11-11 00:05:00 +0000 | [diff] [blame] | 52 | compileall=$(srcdir)/Lib/compileall.py |
Jack Jansen | d780036 | 2003-02-12 15:42:49 +0000 | [diff] [blame] | 53 | bundlebuilder=$(srcdir)/Lib/plat-mac/bundlebuilder.py |
Jack Jansen | cce7e34 | 2002-07-31 14:46:04 +0000 | [diff] [blame] | 54 | |
Jack Jansen | 4ccf3e1 | 2003-02-18 23:33:39 +0000 | [diff] [blame] | 55 | installapps: install_PythonLauncher install_Python install_BuildApplet install_IDE \ |
| 56 | install_IDLE install_PackageManager |
Jack Jansen | cce7e34 | 2002-07-31 14:46:04 +0000 | [diff] [blame] | 57 | |
| 58 | install_PythonLauncher: |
Jack Jansen | be3e1f7 | 2002-08-01 21:14:06 +0000 | [diff] [blame] | 59 | cd $(srcdir)/Mac/OSX/PythonLauncher/PythonLauncher.pbproj ; \ |
Jack Jansen | 1ebcc44 | 2002-11-20 14:06:16 +0000 | [diff] [blame] | 60 | pbxbuild -target PythonLauncher -buildstyle Deployment \ |
| 61 | DSTROOT=$(dstroot) INSTALL_PATH=$(PYTHONAPPSPATH) install |
Jack Jansen | cce7e34 | 2002-07-31 14:46:04 +0000 | [diff] [blame] | 62 | |
Jack Jansen | 04087b5 | 2003-02-25 12:41:10 +0000 | [diff] [blame] | 63 | install_Python: |
Jack Jansen | 82f1d2c | 2003-03-11 23:07:08 +0000 | [diff] [blame] | 64 | @if test ! -f $(DOCINDEX); then \ |
| 65 | echo WARNING: you should run Apple Help Indexing Tool on $(DOCDIR); \ |
| 66 | fi |
Jack Jansen | cce7e34 | 2002-07-31 14:46:04 +0000 | [diff] [blame] | 67 | @for i in $(PYTHONAPPSDIR) $(APPINSTALLDIR) $(APPINSTALLDIR)/Contents; do \ |
Jack Jansen | 638e5e3 | 2001-09-06 16:33:57 +0000 | [diff] [blame] | 68 | if test ! -d $$i; then \ |
| 69 | echo "Creating directory $$i"; \ |
| 70 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
| 71 | fi;\ |
| 72 | done |
| 73 | @for i in $(APPSUBDIRS); do \ |
| 74 | if test ! -d $(APPINSTALLDIR)/Contents/$$i; then \ |
| 75 | echo "Creating directory $(APPINSTALLDIR)/Contents/$$i"; \ |
| 76 | $(INSTALL) -d -m $(DIRMODE) $(APPINSTALLDIR)/Contents/$$i; \ |
| 77 | else true; \ |
| 78 | fi; \ |
| 79 | done |
| 80 | @for d in . $(APPSUBDIRS); \ |
| 81 | do \ |
| 82 | a=$(APPTEMPLATE)/$$d; \ |
| 83 | if test ! -d $$a; then continue; else true; fi; \ |
| 84 | b=$(APPINSTALLDIR)/Contents/$$d; \ |
| 85 | for i in $$a/*; \ |
| 86 | do \ |
Jack Jansen | 638e5e3 | 2001-09-06 16:33:57 +0000 | [diff] [blame] | 87 | case $$i in \ |
| 88 | *CVS) ;; \ |
| 89 | *.py[co]) ;; \ |
| 90 | *.orig) ;; \ |
| 91 | *~) ;; \ |
Jack Jansen | 82f1d2c | 2003-03-11 23:07:08 +0000 | [diff] [blame] | 92 | *idx) \ |
| 93 | echo $(CPMAC) "$$i" $$b; \ |
| 94 | $(CPMAC) "$$i" $$b; \ |
| 95 | ;; \ |
Jack Jansen | 638e5e3 | 2001-09-06 16:33:57 +0000 | [diff] [blame] | 96 | *) \ |
| 97 | if test -d $$i; then continue; fi; \ |
| 98 | if test -x $$i; then \ |
| 99 | echo $(INSTALL_SCRIPT) $$i $$b; \ |
| 100 | $(INSTALL_SCRIPT) $$i $$b; \ |
| 101 | else \ |
| 102 | echo $(INSTALL_DATA) $$i $$b; \ |
| 103 | $(INSTALL_DATA) $$i $$b; \ |
| 104 | fi;; \ |
| 105 | esac; \ |
| 106 | done; \ |
| 107 | done |
Jack Jansen | 82f1d2c | 2003-03-11 23:07:08 +0000 | [diff] [blame] | 108 | $(INSTALL_PROGRAM) $(STRIPFLAG) $(BUILDPYTHON) $(APPINSTALLDIR)/Contents/MacOS/python |
Jack Jansen | cce7e34 | 2002-07-31 14:46:04 +0000 | [diff] [blame] | 109 | |
| 110 | install_IDE: $(INSTALLED_PYTHONW) |
Jack Jansen | 7d996a2 | 2002-11-11 00:05:00 +0000 | [diff] [blame] | 111 | @if ! $(INSTALLED_PYTHONW) -c "import waste"; then \ |
Jack Jansen | f80798b | 2002-08-02 21:04:46 +0000 | [diff] [blame] | 112 | echo PythonIDE needs the \"waste\" extension module; \ |
| 113 | echo See Mac/OSX/README for details; \ |
Jack Jansen | 7d996a2 | 2002-11-11 00:05:00 +0000 | [diff] [blame] | 114 | else \ |
Jack Jansen | 4ccf3e1 | 2003-02-18 23:33:39 +0000 | [diff] [blame] | 115 | echo $(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \ |
| 116 | --output $(PYTHONAPPSDIR)/PythonIDE.app --noargv \ |
| 117 | $(srcdir)/Mac/Tools/IDE/PythonIDE.py ; \ |
| 118 | $(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \ |
| 119 | --output $(PYTHONAPPSDIR)/PythonIDE.app --noargv \ |
| 120 | $(srcdir)/Mac/Tools/IDE/PythonIDE.py; \ |
Jack Jansen | d780036 | 2003-02-12 15:42:49 +0000 | [diff] [blame] | 121 | fi |
| 122 | |
| 123 | install_PackageManager: $(INSTALLED_PYTHONW) |
| 124 | @if ! $(INSTALLED_PYTHONW) -c "import waste"; then \ |
| 125 | echo PackageManager needs the \"waste\" extension module; \ |
| 126 | echo See Mac/OSX/README for details; \ |
| 127 | else \ |
| 128 | echo $(INSTALLED_PYTHONW) $(bundlebuilder) \ |
| 129 | --builddir $(PYTHONAPPSDIR)/ \ |
| 130 | --resource $(srcdir)/Mac/Tools/IDE/PythonIDE.rsrc \ |
| 131 | --mainprogram $(srcdir)/Mac/Tools/IDE/PackageManager.py \ |
| 132 | --iconfile $(srcdir)/Mac/Tools/IDE/PackageManager.icns \ |
| 133 | --creator Pimp build; \ |
| 134 | $(INSTALLED_PYTHONW) $(bundlebuilder) \ |
| 135 | --builddir $(PYTHONAPPSDIR)/ \ |
| 136 | --resource $(srcdir)/Mac/Tools/IDE/PythonIDE.rsrc \ |
| 137 | --mainprogram $(srcdir)/Mac/Tools/IDE/PackageManager.py \ |
| 138 | --iconfile $(srcdir)/Mac/Tools/IDE/PackageManager.icns \ |
| 139 | --creator Pimp build; \ |
Jack Jansen | f80798b | 2002-08-02 21:04:46 +0000 | [diff] [blame] | 140 | fi |
Jack Jansen | 76a6ab6 | 2002-09-12 22:19:23 +0000 | [diff] [blame] | 141 | |
| 142 | install_IDLE: $(INSTALLED_PYTHONW) |
| 143 | @if ! $(INSTALLED_PYTHONW) -c "import _tkinter"; then \ |
| 144 | echo IDLE needs the \"Tkinter\" extension module; \ |
| 145 | echo See Mac/OSX/README for details; \ |
| 146 | else \ |
| 147 | echo $(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \ |
| 148 | --output $(PYTHONAPPSDIR)/IDLE.app \ |
| 149 | --extra $(srcdir)/Tools/idle \ |
| 150 | $(srcdir)/Tools/idle/idle ; \ |
| 151 | $(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \ |
| 152 | --output $(PYTHONAPPSDIR)/IDLE.app \ |
Jack Jansen | ec43f64 | 2003-02-24 16:30:24 +0000 | [diff] [blame] | 153 | --extra $(srcdir)/Tools/idle:Contents/Resources/idlelib \ |
Jack Jansen | 76a6ab6 | 2002-09-12 22:19:23 +0000 | [diff] [blame] | 154 | $(srcdir)/Tools/idle/idle ; \ |
Jack Jansen | 76a6ab6 | 2002-09-12 22:19:23 +0000 | [diff] [blame] | 155 | fi |
| 156 | |
Jack Jansen | 638e5e3 | 2001-09-06 16:33:57 +0000 | [diff] [blame] | 157 | |
Jack Jansen | 940e970 | 2002-08-02 15:32:12 +0000 | [diff] [blame] | 158 | install_BuildApplet: $(INSTALLED_PYTHONW) |
| 159 | $(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \ |
| 160 | --output $(PYTHONAPPSDIR)/BuildApplet.app \ |
| 161 | $(srcdir)/Mac/scripts/BuildApplet.py |
| 162 | |
Jack Jansen | 83f898c | 2002-12-30 22:23:40 +0000 | [diff] [blame] | 163 | MACLIBDEST=$(LIBDEST)/plat-mac |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 164 | MACTOOLSDEST=$(prefix)/Mac/Tools |
| 165 | MACTOOLSSRC=$(srcdir)/Mac/Tools |
| 166 | MACTOOLSSUBDIRS=IDE |
Jack Jansen | 94fab76 | 2002-09-02 12:29:11 +0000 | [diff] [blame] | 167 | installmacsubtree: |
Jack Jansen | 83f898c | 2002-12-30 22:23:40 +0000 | [diff] [blame] | 168 | @for i in $(MACTOOLSDEST); \ |
Jack Jansen | 638e5e3 | 2001-09-06 16:33:57 +0000 | [diff] [blame] | 169 | do \ |
| 170 | if test ! -d $$i; then \ |
| 171 | echo "Creating directory $$i"; \ |
| 172 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
| 173 | else true; \ |
| 174 | fi; \ |
| 175 | done |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 176 | @for d in $(MACTOOLSSUBDIRS); \ |
Jack Jansen | c71efe0 | 2002-01-21 22:51:55 +0000 | [diff] [blame] | 177 | do \ |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 178 | a=$(MACTOOLSSRC)/$$d; \ |
Jack Jansen | c71efe0 | 2002-01-21 22:51:55 +0000 | [diff] [blame] | 179 | if test ! -d $$a; then continue; else true; fi; \ |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 180 | b=$(MACTOOLSDEST)/$$d; \ |
Jack Jansen | c71efe0 | 2002-01-21 22:51:55 +0000 | [diff] [blame] | 181 | if test ! -d $$b; then \ |
| 182 | echo "Creating directory $$b"; \ |
| 183 | $(INSTALL) -d -m $(DIRMODE) $$b; \ |
| 184 | else true; \ |
| 185 | fi; \ |
| 186 | done |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 187 | @for d in $(MACTOOLSSUBDIRS); \ |
Jack Jansen | c71efe0 | 2002-01-21 22:51:55 +0000 | [diff] [blame] | 188 | do \ |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 189 | a=$(MACTOOLSSRC)/$$d; \ |
Jack Jansen | c71efe0 | 2002-01-21 22:51:55 +0000 | [diff] [blame] | 190 | if test ! -d $$a; then continue; else true; fi; \ |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 191 | b=$(MACTOOLSDEST)/$$d; \ |
Jack Jansen | c71efe0 | 2002-01-21 22:51:55 +0000 | [diff] [blame] | 192 | for i in $$a/*; \ |
| 193 | do \ |
| 194 | case $$i in \ |
| 195 | *CVS) ;; \ |
| 196 | *.py[co]) ;; \ |
| 197 | *.orig) ;; \ |
| 198 | *~) ;; \ |
Jack Jansen | 8120415 | 2002-08-15 21:31:18 +0000 | [diff] [blame] | 199 | *.rsrc) \ |
| 200 | echo $(CPMAC) $$i $$b ; \ |
| 201 | $(CPMAC) $$i $$b ; \ |
| 202 | ;; \ |
Jack Jansen | c71efe0 | 2002-01-21 22:51:55 +0000 | [diff] [blame] | 203 | *) \ |
| 204 | if test -d $$i; then continue; fi; \ |
| 205 | if test -x $$i; then \ |
| 206 | echo $(INSTALL_SCRIPT) $$i $$b; \ |
| 207 | $(INSTALL_SCRIPT) $$i $$b; \ |
| 208 | else \ |
| 209 | echo $(INSTALL_DATA) $$i $$b; \ |
| 210 | $(INSTALL_DATA) $$i $$b; \ |
| 211 | fi;; \ |
| 212 | esac; \ |
| 213 | done; \ |
| 214 | done |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 215 | |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 216 | |
Jack Jansen | 04087b5 | 2003-02-25 12:41:10 +0000 | [diff] [blame] | 217 | $(BUILDPYTHON) $(CACHERSRC) -v $(MACLIBDEST) $(MACTOOLSDEST) |
| 218 | $(BUILDPYTHON) -Wi -tt $(compileall) -x badsyntax $(MACTOOLSDEST) |
| 219 | $(BUILDPYTHON) -O -Wi -tt $(compileall) -x badsyntax $(MACTOOLSDEST) |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 220 | |
Jack Jansen | 7d996a2 | 2002-11-11 00:05:00 +0000 | [diff] [blame] | 221 | # |
| 222 | # We use the full name here in stead of $(INSTALLED_PYTHONW), because |
| 223 | # the latter may be overridden by Makefile.jaguar when building for a pre-installed |
| 224 | # /usr/bin/python |
| 225 | $(APPINSTALLDIR)/Contents/MacOS/python: install_Python |
Jack Jansen | cce7e34 | 2002-07-31 14:46:04 +0000 | [diff] [blame] | 226 | |
Jack Jansen | cb4321e | 2002-08-09 00:18:21 +0000 | [diff] [blame] | 227 | # $(INSTALLED_PYTHON) has to be done by the main Makefile, we cannot do that here. |
| 228 | # At least this rule will give an error if it doesn't exist. |
| 229 | |
Jack Jansen | 94fab76 | 2002-09-02 12:29:11 +0000 | [diff] [blame] | 230 | installunixtools: $(INSTALLED_PYTHON) $(INSTALLED_PYTHONW) |
Jack Jansen | cb4321e | 2002-08-09 00:18:21 +0000 | [diff] [blame] | 231 | $(INSTALL) -d $(bindir) |
Jack Jansen | 50abec8 | 2003-01-28 21:45:44 +0000 | [diff] [blame] | 232 | $(INSTALL_SYMLINK) $(INSTALLED_PYTHON) $(bindir)/python$(VERSION) |
| 233 | $(INSTALL_SYMLINK) python$(VERSION) $(bindir)/python |
Jack Jansen | 94fab76 | 2002-09-02 12:29:11 +0000 | [diff] [blame] | 234 | echo "#!/bin/sh" > pythonw.sh |
| 235 | echo "exec \"$(INSTALLED_PYTHONW)\" \"\$$@\"" >> pythonw.sh |
Jack Jansen | 50abec8 | 2003-01-28 21:45:44 +0000 | [diff] [blame] | 236 | $(INSTALL) pythonw.sh $(bindir)/pythonw$(VERSION) |
| 237 | $(INSTALL_SYMLINK) pythonw$(VERSION) $(bindir)/pythonw |