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 | cb4321e | 2002-08-09 00:18:21 +0000 | [diff] [blame] | 11 | |
| 12 | # These are normally glimpsed from the previous set |
| 13 | bindir=$(dstroot)/usr/local/bin |
Jack Jansen | cfe2836 | 2002-12-25 22:31:28 +0000 | [diff] [blame] | 14 | PYTHONAPPSPATH=/Applications/MacPython-$(VERSION) |
Jack Jansen | 1ebcc44 | 2002-11-20 14:06:16 +0000 | [diff] [blame] | 15 | PYTHONAPPSDIR=$(dstroot)$(PYTHONAPPSPATH) |
Jack Jansen | be3e1f7 | 2002-08-01 21:14:06 +0000 | [diff] [blame] | 16 | APPINSTALLDIR=$(prefix)/Resources/Python.app |
Jack Jansen | 7d996a2 | 2002-11-11 00:05:00 +0000 | [diff] [blame] | 17 | PTHFILE=$(srcdir)/Mac/OSX/Mac.pth |
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 | PYTHON=$(builddir)/python.exe |
| 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 | cce7e34 | 2002-07-31 14:46:04 +0000 | [diff] [blame] | 49 | |
Jack Jansen | 76a6ab6 | 2002-09-12 22:19:23 +0000 | [diff] [blame] | 50 | installapps: install_PythonLauncher install_Python install_BuildApplet install_IDE install_IDLE |
Jack Jansen | cce7e34 | 2002-07-31 14:46:04 +0000 | [diff] [blame] | 51 | |
| 52 | install_PythonLauncher: |
Jack Jansen | be3e1f7 | 2002-08-01 21:14:06 +0000 | [diff] [blame] | 53 | cd $(srcdir)/Mac/OSX/PythonLauncher/PythonLauncher.pbproj ; \ |
Jack Jansen | 1ebcc44 | 2002-11-20 14:06:16 +0000 | [diff] [blame] | 54 | pbxbuild -target PythonLauncher -buildstyle Deployment \ |
| 55 | DSTROOT=$(dstroot) INSTALL_PATH=$(PYTHONAPPSPATH) install |
Jack Jansen | cce7e34 | 2002-07-31 14:46:04 +0000 | [diff] [blame] | 56 | |
Jack Jansen | 21ed16a | 2002-08-02 14:11:24 +0000 | [diff] [blame] | 57 | install_Python: $(PYTHON) |
Jack Jansen | cce7e34 | 2002-07-31 14:46:04 +0000 | [diff] [blame] | 58 | @for i in $(PYTHONAPPSDIR) $(APPINSTALLDIR) $(APPINSTALLDIR)/Contents; do \ |
Jack Jansen | 638e5e3 | 2001-09-06 16:33:57 +0000 | [diff] [blame] | 59 | if test ! -d $$i; then \ |
| 60 | echo "Creating directory $$i"; \ |
| 61 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
| 62 | fi;\ |
| 63 | done |
| 64 | @for i in $(APPSUBDIRS); do \ |
| 65 | if test ! -d $(APPINSTALLDIR)/Contents/$$i; then \ |
| 66 | echo "Creating directory $(APPINSTALLDIR)/Contents/$$i"; \ |
| 67 | $(INSTALL) -d -m $(DIRMODE) $(APPINSTALLDIR)/Contents/$$i; \ |
| 68 | else true; \ |
| 69 | fi; \ |
| 70 | done |
| 71 | @for d in . $(APPSUBDIRS); \ |
| 72 | do \ |
| 73 | a=$(APPTEMPLATE)/$$d; \ |
| 74 | if test ! -d $$a; then continue; else true; fi; \ |
| 75 | b=$(APPINSTALLDIR)/Contents/$$d; \ |
| 76 | for i in $$a/*; \ |
| 77 | do \ |
Jack Jansen | 638e5e3 | 2001-09-06 16:33:57 +0000 | [diff] [blame] | 78 | case $$i in \ |
| 79 | *CVS) ;; \ |
| 80 | *.py[co]) ;; \ |
| 81 | *.orig) ;; \ |
| 82 | *~) ;; \ |
| 83 | *) \ |
| 84 | if test -d $$i; then continue; fi; \ |
| 85 | if test -x $$i; then \ |
| 86 | echo $(INSTALL_SCRIPT) $$i $$b; \ |
| 87 | $(INSTALL_SCRIPT) $$i $$b; \ |
| 88 | else \ |
| 89 | echo $(INSTALL_DATA) $$i $$b; \ |
| 90 | $(INSTALL_DATA) $$i $$b; \ |
| 91 | fi;; \ |
| 92 | esac; \ |
| 93 | done; \ |
| 94 | done |
Jack Jansen | 21ed16a | 2002-08-02 14:11:24 +0000 | [diff] [blame] | 95 | $(INSTALL_PROGRAM) $(STRIPFLAG) $(PYTHON) $(APPINSTALLDIR)/Contents/MacOS/python |
Jack Jansen | 4684a09 | 2002-08-28 21:27:02 +0000 | [diff] [blame] | 96 | # Finally create the documentation symlink |
| 97 | $(LN) -fsn ../../../../English.lproj/Documentation $(APPINSTALLDIR)/Contents/Resources/English.lproj/Documentation |
| 98 | |
Jack Jansen | cce7e34 | 2002-07-31 14:46:04 +0000 | [diff] [blame] | 99 | |
| 100 | install_IDE: $(INSTALLED_PYTHONW) |
Jack Jansen | 7d996a2 | 2002-11-11 00:05:00 +0000 | [diff] [blame] | 101 | @if ! $(INSTALLED_PYTHONW) -c "import waste"; then \ |
Jack Jansen | f80798b | 2002-08-02 21:04:46 +0000 | [diff] [blame] | 102 | echo PythonIDE needs the \"waste\" extension module; \ |
| 103 | echo See Mac/OSX/README for details; \ |
Jack Jansen | 7d996a2 | 2002-11-11 00:05:00 +0000 | [diff] [blame] | 104 | else \ |
| 105 | echo $(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \ |
| 106 | --output $(PYTHONAPPSDIR)/PythonIDE.app --noargv \ |
| 107 | $(srcdir)/Mac/Tools/IDE/PythonIDE.py ; \ |
| 108 | $(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \ |
| 109 | --output $(PYTHONAPPSDIR)/PythonIDE.app --noargv \ |
| 110 | $(srcdir)/Mac/Tools/IDE/PythonIDE.py; \ |
Jack Jansen | f80798b | 2002-08-02 21:04:46 +0000 | [diff] [blame] | 111 | fi |
Jack Jansen | 76a6ab6 | 2002-09-12 22:19:23 +0000 | [diff] [blame] | 112 | |
| 113 | install_IDLE: $(INSTALLED_PYTHONW) |
| 114 | @if ! $(INSTALLED_PYTHONW) -c "import _tkinter"; then \ |
| 115 | echo IDLE needs the \"Tkinter\" extension module; \ |
| 116 | echo See Mac/OSX/README for details; \ |
| 117 | else \ |
| 118 | echo $(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \ |
| 119 | --output $(PYTHONAPPSDIR)/IDLE.app \ |
| 120 | --extra $(srcdir)/Tools/idle \ |
| 121 | $(srcdir)/Tools/idle/idle ; \ |
| 122 | $(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \ |
| 123 | --output $(PYTHONAPPSDIR)/IDLE.app \ |
| 124 | --extra $(srcdir)/Tools/idle \ |
| 125 | $(srcdir)/Tools/idle/idle ; \ |
| 126 | echo mv $(PYTHONAPPSDIR)/IDLE.app/Contents/Resources/idle \ |
| 127 | $(PYTHONAPPSDIR)/IDLE.app/Contents/Resources/idlelib; \ |
| 128 | mv $(PYTHONAPPSDIR)/IDLE.app/Contents/Resources/idle \ |
| 129 | $(PYTHONAPPSDIR)/IDLE.app/Contents/Resources/idlelib; \ |
| 130 | fi |
| 131 | |
Jack Jansen | 638e5e3 | 2001-09-06 16:33:57 +0000 | [diff] [blame] | 132 | |
Jack Jansen | 940e970 | 2002-08-02 15:32:12 +0000 | [diff] [blame] | 133 | install_BuildApplet: $(INSTALLED_PYTHONW) |
| 134 | $(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \ |
| 135 | --output $(PYTHONAPPSDIR)/BuildApplet.app \ |
| 136 | $(srcdir)/Mac/scripts/BuildApplet.py |
| 137 | |
Jack Jansen | 83f898c | 2002-12-30 22:23:40 +0000 | [diff] [blame] | 138 | MACLIBDEST=$(LIBDEST)/plat-mac |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 139 | MACTOOLSDEST=$(prefix)/Mac/Tools |
| 140 | MACTOOLSSRC=$(srcdir)/Mac/Tools |
| 141 | MACTOOLSSUBDIRS=IDE |
Jack Jansen | 94fab76 | 2002-09-02 12:29:11 +0000 | [diff] [blame] | 142 | installmacsubtree: |
Jack Jansen | 83f898c | 2002-12-30 22:23:40 +0000 | [diff] [blame] | 143 | @for i in $(MACTOOLSDEST); \ |
Jack Jansen | 638e5e3 | 2001-09-06 16:33:57 +0000 | [diff] [blame] | 144 | do \ |
| 145 | if test ! -d $$i; then \ |
| 146 | echo "Creating directory $$i"; \ |
| 147 | $(INSTALL) -d -m $(DIRMODE) $$i; \ |
| 148 | else true; \ |
| 149 | fi; \ |
| 150 | done |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 151 | @for d in $(MACTOOLSSUBDIRS); \ |
Jack Jansen | c71efe0 | 2002-01-21 22:51:55 +0000 | [diff] [blame] | 152 | do \ |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 153 | a=$(MACTOOLSSRC)/$$d; \ |
Jack Jansen | c71efe0 | 2002-01-21 22:51:55 +0000 | [diff] [blame] | 154 | if test ! -d $$a; then continue; else true; fi; \ |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 155 | b=$(MACTOOLSDEST)/$$d; \ |
Jack Jansen | c71efe0 | 2002-01-21 22:51:55 +0000 | [diff] [blame] | 156 | if test ! -d $$b; then \ |
| 157 | echo "Creating directory $$b"; \ |
| 158 | $(INSTALL) -d -m $(DIRMODE) $$b; \ |
| 159 | else true; \ |
| 160 | fi; \ |
| 161 | done |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 162 | @for d in $(MACTOOLSSUBDIRS); \ |
Jack Jansen | c71efe0 | 2002-01-21 22:51:55 +0000 | [diff] [blame] | 163 | do \ |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 164 | a=$(MACTOOLSSRC)/$$d; \ |
Jack Jansen | c71efe0 | 2002-01-21 22:51:55 +0000 | [diff] [blame] | 165 | if test ! -d $$a; then continue; else true; fi; \ |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 166 | b=$(MACTOOLSDEST)/$$d; \ |
Jack Jansen | c71efe0 | 2002-01-21 22:51:55 +0000 | [diff] [blame] | 167 | for i in $$a/*; \ |
| 168 | do \ |
| 169 | case $$i in \ |
| 170 | *CVS) ;; \ |
| 171 | *.py[co]) ;; \ |
| 172 | *.orig) ;; \ |
| 173 | *~) ;; \ |
Jack Jansen | 8120415 | 2002-08-15 21:31:18 +0000 | [diff] [blame] | 174 | *.rsrc) \ |
| 175 | echo $(CPMAC) $$i $$b ; \ |
| 176 | $(CPMAC) $$i $$b ; \ |
| 177 | ;; \ |
Jack Jansen | c71efe0 | 2002-01-21 22:51:55 +0000 | [diff] [blame] | 178 | *) \ |
| 179 | if test -d $$i; then continue; fi; \ |
| 180 | if test -x $$i; then \ |
| 181 | echo $(INSTALL_SCRIPT) $$i $$b; \ |
| 182 | $(INSTALL_SCRIPT) $$i $$b; \ |
| 183 | else \ |
| 184 | echo $(INSTALL_DATA) $$i $$b; \ |
| 185 | $(INSTALL_DATA) $$i $$b; \ |
| 186 | fi;; \ |
| 187 | esac; \ |
| 188 | done; \ |
| 189 | done |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 190 | |
Jack Jansen | 7d996a2 | 2002-11-11 00:05:00 +0000 | [diff] [blame] | 191 | $(INSTALL_DATA) $(PTHFILE) $(LIBDEST)/site-packages/ |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 192 | |
| 193 | $(PYTHON) $(CACHERSRC) -v $(MACLIBDEST) $(MACTOOLSDEST) |
Jack Jansen | 83f898c | 2002-12-30 22:23:40 +0000 | [diff] [blame] | 194 | $(PYTHON) -Wi -tt $(compileall) -x badsyntax $(MACTOOLSDEST) |
| 195 | $(PYTHON) -O -Wi -tt $(compileall) -x badsyntax $(MACTOOLSDEST) |
Jack Jansen | 45c8e92 | 2002-08-09 14:15:46 +0000 | [diff] [blame] | 196 | |
Jack Jansen | 7d996a2 | 2002-11-11 00:05:00 +0000 | [diff] [blame] | 197 | # |
| 198 | # We use the full name here in stead of $(INSTALLED_PYTHONW), because |
| 199 | # the latter may be overridden by Makefile.jaguar when building for a pre-installed |
| 200 | # /usr/bin/python |
| 201 | $(APPINSTALLDIR)/Contents/MacOS/python: install_Python |
Jack Jansen | cce7e34 | 2002-07-31 14:46:04 +0000 | [diff] [blame] | 202 | |
Jack Jansen | cb4321e | 2002-08-09 00:18:21 +0000 | [diff] [blame] | 203 | # $(INSTALLED_PYTHON) has to be done by the main Makefile, we cannot do that here. |
| 204 | # At least this rule will give an error if it doesn't exist. |
| 205 | |
Jack Jansen | 94fab76 | 2002-09-02 12:29:11 +0000 | [diff] [blame] | 206 | installunixtools: $(INSTALLED_PYTHON) $(INSTALLED_PYTHONW) |
Jack Jansen | cb4321e | 2002-08-09 00:18:21 +0000 | [diff] [blame] | 207 | $(INSTALL) -d $(bindir) |
Jack Jansen | 50abec8 | 2003-01-28 21:45:44 +0000 | [diff] [blame] | 208 | $(INSTALL_SYMLINK) $(INSTALLED_PYTHON) $(bindir)/python$(VERSION) |
| 209 | $(INSTALL_SYMLINK) python$(VERSION) $(bindir)/python |
Jack Jansen | 94fab76 | 2002-09-02 12:29:11 +0000 | [diff] [blame] | 210 | echo "#!/bin/sh" > pythonw.sh |
| 211 | echo "exec \"$(INSTALLED_PYTHONW)\" \"\$$@\"" >> pythonw.sh |
Jack Jansen | 50abec8 | 2003-01-28 21:45:44 +0000 | [diff] [blame] | 212 | $(INSTALL) pythonw.sh $(bindir)/pythonw$(VERSION) |
| 213 | $(INSTALL_SYMLINK) pythonw$(VERSION) $(bindir)/pythonw |