More installation info. Bump alpha version.
[python/dscho.git] / Mac / OSX / Makefile
blob41f4acd3d3c7c2038fa36e5aa7121d0e63ec0760
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
3 # commandline in that case.
5 VERSION=2.3
6 builddir = ../..
7 srcdir = ../..
8 dstroot=/.
9 prefix=$(dstroot)/Library/Frameworks/Python.framework/Versions/$(VERSION)
10 LIBDEST=$(prefix)/lib/python$(VERSION)
12 # These are normally glimpsed from the previous set
13 bindir=$(dstroot)/usr/local/bin
14 PYTHONAPPSPATH=/Applications/MacPython-$(VERSION)
15 PYTHONAPPSDIR=$(dstroot)$(PYTHONAPPSPATH)
16 APPINSTALLDIR=$(prefix)/Resources/Python.app
17 PTHFILE=$(srcdir)/Mac/OSX/Mac.pth
19 # Variables for installing the "normal" unix binaries
20 INSTALLED_PYTHON=$(prefix)/bin/python
21 INSTALLED_PYTHONW=$(APPINSTALLDIR)/Contents/MacOS/python
23 # Items more-or-less copied from the main Makefile
24 DIRMODE=755
25 INSTALL=/usr/bin/install -c
26 INSTALL_SYMLINK=ln -fs
27 INSTALL_PROGRAM=${INSTALL}
28 INSTALL_SCRIPT= ${INSTALL_PROGRAM}
29 INSTALL_DATA= ${INSTALL} -m 644
30 LN=ln
31 STRIPFLAG=-s
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=
37 ##CFLAGS=$(OPT) $(DEFINES) $(INCLUDES)
38 ##LDFLAGS=-F$(builddir) -framework System -framework Python -framework Carbon \
39 ## -framework Foundation
40 ##CC=cc
41 ##LD=cc
42 CPMAC=/Developer/Tools/CpMac
44 PYTHON=$(builddir)/python.exe
45 APPTEMPLATE=$(srcdir)/Mac/OSXResources/app
46 APPSUBDIRS=MacOS Resources Resources/English.lproj
47 CACHERSRC=$(srcdir)/Mac/scripts/cachersrc.py
48 compileall=$(srcdir)/Lib/compileall.py
50 installapps: install_PythonLauncher install_Python install_BuildApplet install_IDE install_IDLE
52 install_PythonLauncher:
53 cd $(srcdir)/Mac/OSX/PythonLauncher/PythonLauncher.pbproj ; \
54 pbxbuild -target PythonLauncher -buildstyle Deployment \
55 DSTROOT=$(dstroot) INSTALL_PATH=$(PYTHONAPPSPATH) install
57 install_Python: $(PYTHON)
58 @for i in $(PYTHONAPPSDIR) $(APPINSTALLDIR) $(APPINSTALLDIR)/Contents; do \
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 \
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
95 $(INSTALL_PROGRAM) $(STRIPFLAG) $(PYTHON) $(APPINSTALLDIR)/Contents/MacOS/python
96 # Finally create the documentation symlink
97 $(LN) -fsn ../../../../English.lproj/Documentation $(APPINSTALLDIR)/Contents/Resources/English.lproj/Documentation
100 install_IDE: $(INSTALLED_PYTHONW)
101 @if ! $(INSTALLED_PYTHONW) -c "import waste"; then \
102 echo PythonIDE needs the \"waste\" extension module; \
103 echo See Mac/OSX/README for details; \
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; \
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; \
133 install_BuildApplet: $(INSTALLED_PYTHONW)
134 $(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \
135 --output $(PYTHONAPPSDIR)/BuildApplet.app \
136 $(srcdir)/Mac/scripts/BuildApplet.py
138 MACLIBDEST=$(LIBDEST)/plat-mac
139 MACTOOLSDEST=$(prefix)/Mac/Tools
140 MACTOOLSSRC=$(srcdir)/Mac/Tools
141 MACTOOLSSUBDIRS=IDE
142 installmacsubtree:
143 @for i in $(MACTOOLSDEST); \
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
151 @for d in $(MACTOOLSSUBDIRS); \
152 do \
153 a=$(MACTOOLSSRC)/$$d; \
154 if test ! -d $$a; then continue; else true; fi; \
155 b=$(MACTOOLSDEST)/$$d; \
156 if test ! -d $$b; then \
157 echo "Creating directory $$b"; \
158 $(INSTALL) -d -m $(DIRMODE) $$b; \
159 else true; \
160 fi; \
161 done
162 @for d in $(MACTOOLSSUBDIRS); \
163 do \
164 a=$(MACTOOLSSRC)/$$d; \
165 if test ! -d $$a; then continue; else true; fi; \
166 b=$(MACTOOLSDEST)/$$d; \
167 for i in $$a/*; \
168 do \
169 case $$i in \
170 *CVS) ;; \
171 *.py[co]) ;; \
172 *.orig) ;; \
173 *~) ;; \
174 *.rsrc) \
175 echo $(CPMAC) $$i $$b ; \
176 $(CPMAC) $$i $$b ; \
177 ;; \
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
191 $(INSTALL_DATA) $(PTHFILE) $(LIBDEST)/site-packages/
193 $(PYTHON) $(CACHERSRC) -v $(MACLIBDEST) $(MACTOOLSDEST)
194 $(PYTHON) -Wi -tt $(compileall) -x badsyntax $(MACTOOLSDEST)
195 $(PYTHON) -O -Wi -tt $(compileall) -x badsyntax $(MACTOOLSDEST)
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
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.
206 installunixtools: $(INSTALLED_PYTHON) $(INSTALLED_PYTHONW)
207 $(INSTALL) -d $(bindir)
208 $(INSTALL_SYMLINK) $(INSTALLED_PYTHON) $(bindir)/python
209 echo "#!/bin/sh" > pythonw.sh
210 echo "exec \"$(INSTALLED_PYTHONW)\" \"\$$@\"" >> pythonw.sh
211 $(INSTALL) pythonw.sh $(bindir)/pythonw