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