Remove the regrtest check that turns any ImportError into a skipped test.
[python.git] / Mac / Makefile.in
blob3981a96f007b95e670a6febc319f51d68c8a1796
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=@VERSION@
6 builddir = ..
7 srcdir=@srcdir@
8 prefix=@prefix@
9 LIBDEST=$(prefix)/lib/python$(VERSION)
10 RUNSHARED=@RUNSHARED@
11 BUILDEXE=@BUILDEXEEXT@
12 BUILDPYTHON=$(builddir)/python$(BUILDEXE)
13 DESTDIR=
14 LDFLAGS=@LDFLAGS@
15 FRAMEWORKUNIXTOOLSPREFIX=@FRAMEWORKUNIXTOOLSPREFIX@
16 PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
17 PYTHONFRAMEWORKIDENTIFIER=@PYTHONFRAMEWORKIDENTIFIER@
20 # These are normally glimpsed from the previous set
21 bindir=$(prefix)/bin
22 PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
23 APPINSTALLDIR=$(prefix)/Resources/Python.app
25 # Variables for installing the "normal" unix binaries
26 INSTALLED_PYTHONAPP=$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)
28 # Items more-or-less copied from the main Makefile
29 DIRMODE=755
30 FILEMODE=644
31 INSTALL=@INSTALL@
32 INSTALL_SYMLINK=ln -fsn
33 INSTALL_PROGRAM=@INSTALL_PROGRAM@
34 INSTALL_SCRIPT= @INSTALL_SCRIPT@
35 INSTALL_DATA=@INSTALL_DATA@
36 LN=@LN@
37 STRIPFLAG=-s
38 CPMAC=/Developer/Tools/CpMac
40 APPTEMPLATE=$(srcdir)/Resources/app
41 APPSUBDIRS=MacOS Resources Resources/English.lproj \
42 Resources/English.lproj/Documentation \
43 Resources/English.lproj/Documentation/doc \
44 Resources/English.lproj/Documentation/ide
45 DOCDIR=$(srcdir)/Resources/app/Resources/English.lproj/Documentation
46 DOCINDEX=$(DOCDIR)/"Documentation idx"
47 CACHERSRC=$(srcdir)/scripts/cachersrc.py
48 compileall=$(srcdir)/../Lib/compileall.py
50 installapps: install_Python install_BuildApplet install_PythonLauncher \
51 install_IDLE checkapplepython install_pythonw install_versionedtools
53 installapps4way: install_Python4way install_BuildApplet install_PythonLauncher install_IDLE install_pythonw4way install_versionedtools
56 install_pythonw: pythonw
57 $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)"
58 $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/python$(VERSION)"
59 ln -sf python$(VERSION) "$(DESTDIR)$(prefix)/bin/python"
60 ln -sf pythonw$(VERSION) "$(DESTDIR)$(prefix)/bin/pythonw"
63 # Install 3 variants of python/pythonw:
64 # - 32-bit (i386 and ppc)
65 # - 64-bit (x86_64 and ppc64)
66 # - all (all four architectures)
67 # - Make 'python' and 'pythonw' aliases for the 32-bit variant
68 install_pythonw4way: pythonw-32 pythonw-64 pythonw
69 $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-64 "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-64"
70 $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-64 "$(DESTDIR)$(prefix)/bin/python$(VERSION)-64"
71 ln -sf python$(VERSION)-64 "$(DESTDIR)$(prefix)/bin/python-64"
72 ln -sf pythonw$(VERSION)-64 "$(DESTDIR)$(prefix)/bin/pythonw-64"
74 $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-32 "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-32"
75 $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-32 "$(DESTDIR)$(prefix)/bin/python$(VERSION)-32"
76 ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python-32"
77 ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw-32"
79 $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-all"
80 $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/python$(VERSION)-all"
81 ln -sf python$(VERSION)-all "$(DESTDIR)$(prefix)/bin/python-all"
82 ln -sf pythonw$(VERSION)-all "$(DESTDIR)$(prefix)/bin/pythonw-all"
84 ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)"
85 ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python$(VERSION)"
86 ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw"
87 ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python"
90 # Install unix tools in /usr/local/bin. These are just aliases for the
91 # actual installation inside the framework.
93 installunixtools:
94 if [ ! -d "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then \
95 $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\
97 for fn in python pythonw idle pydoc python-config smtpd.py \
98 python$(VERSION) pythonw$(VERSION) idle$(VERSION) \
99 pydoc$(VERSION) python$(VERSION)-config smtpd$(VERSION).py ;\
100 do \
101 ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
102 done
105 # TODO: install symlinks for -32, -64 and -all as well
106 installunixtools4way: installunixtools
110 # Like installunixtools, but only install links to the versioned binaries.
112 altinstallunixtools:
113 if [ ! -d "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then \
114 $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\
116 for fn in python$(VERSION) pythonw$(VERSION) idle$(VERSION) \
117 pydoc$(VERSION) python$(VERSION)-config smtpd$(VERSION).py ;\
118 do \
119 ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
120 done
122 # TODO: -32, -64 and -all variants
123 altinstallunixtools4way: altinstallunixtools
125 # By default most tools are installed without a version in their basename, to
126 # make it easier to install (and use) several python versions side-by-side move
127 # the tools to a version-specific name and add the non-versioned name as an
128 # alias.
129 install_versionedtools:
130 for fn in idle pydoc ;\
131 do \
132 if [ -h "$(DESTDIR)$(prefix)/bin/$${fn}" ]; then \
133 continue ;\
134 fi ;\
135 mv "$(DESTDIR)$(prefix)/bin/$${fn}" "$(DESTDIR)$(prefix)/bin/$${fn}$(VERSION)" ;\
136 ln -sf "$${fn}$(VERSION)" "$(DESTDIR)$(prefix)/bin/$${fn}" ;\
137 done
138 if [ ! -h "$(DESTDIR)$(prefix)/bin/python-config" ]; then \
139 mv "$(DESTDIR)$(prefix)/bin/python-config" "$(DESTDIR)$(prefix)/bin/python$(VERSION)-config" ;\
140 ln -sf "python$(VERSION)-config" "$(DESTDIR)$(prefix)/bin/python-config" ; \
142 if [ ! -h "$(DESTDIR)$(prefix)/bin/smtpd.py" ]; then \
143 mv "$(DESTDIR)$(prefix)/bin/smtpd.py" "$(DESTDIR)$(prefix)/bin/smtpd$(VERSION).py" ;\
144 ln -sf "smtpd$(VERSION).py" "$(DESTDIR)$(prefix)/bin/smtpd.py" ;\
148 pythonw: $(srcdir)/Tools/pythonw.c Makefile
149 $(CC) $(LDFLAGS) -o $@ $(srcdir)/Tools/pythonw.c \
150 -DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"'
152 pythonw-32: $(srcdir)/Tools/pythonw.c Makefile
153 $(CC) $(LDFLAGS) -o $@ -arch i386 -arch ppc $(srcdir)/Tools/pythonw.c \
154 -DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-32"'
156 pythonw-64: $(srcdir)/Tools/pythonw.c Makefile
157 $(CC) $(LDFLAGS) -o $@ -arch x86_64 -arch ppc64 $(srcdir)/Tools/pythonw.c \
158 -DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-64"'
160 install_PythonLauncher:
161 cd PythonLauncher && make install DESTDIR=$(DESTDIR)
163 install_Python:
164 @if test ! -f $(DOCINDEX); then \
165 echo WARNING: you should run Apple Help Indexing Tool on $(DOCDIR); \
167 @for i in "$(PYTHONAPPSDIR)" "$(APPINSTALLDIR)" "$(APPINSTALLDIR)/Contents"; do \
168 if test ! -d "$(DESTDIR)$$i"; then \
169 echo "Creating directory $(DESTDIR)$$i"; \
170 $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$$i"; \
171 fi;\
172 done
173 @for i in $(APPSUBDIRS); do \
174 if test ! -d "$(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; then \
175 echo "Creating directory $(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; \
176 $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; \
177 else true; \
178 fi; \
179 done
180 @for d in . $(APPSUBDIRS); \
181 do \
182 a=$(APPTEMPLATE)/$$d; \
183 if test ! -d $$a; then continue; else true; fi; \
184 b="$(DESTDIR)$(APPINSTALLDIR)/Contents/$$d"; \
185 for i in $$a/*; \
186 do \
187 case $$i in \
188 *CVS) ;; \
189 *.svn) ;; \
190 *.py[co]) ;; \
191 *.orig) ;; \
192 *~) ;; \
193 *idx) \
194 echo $(CPMAC) "$$i" $$b; \
195 $(CPMAC) "$$i" "$$b"; \
196 ;; \
197 *) \
198 if test -d $$i; then continue; fi; \
199 if test -x $$i; then \
200 echo $(INSTALL_SCRIPT) "$$i" "$$b"; \
201 $(INSTALL_SCRIPT) "$$i" "$$b"; \
202 else \
203 echo $(INSTALL_DATA) "$$i" "$$b"; \
204 $(INSTALL_DATA) "$$i" "$$b"; \
205 fi;; \
206 esac; \
207 done; \
208 done
209 $(INSTALL_PROGRAM) $(STRIPFLAG) $(BUILDPYTHON) "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"
210 sed -e "s!%bundleid%!$(PYTHONFRAMEWORKIDENTIFIER)!g" \
211 -e "s!%version%!`$(RUNSHARED) $(BUILDPYTHON) \
212 -c 'import platform; print(platform.python_version())'`!g" \
213 < "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist.in" \
214 > "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist"
215 rm "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist.in"
217 install_Python4way: install_Python
218 lipo -extract i386 -extract ppc7400 -output "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-32" "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"
219 lipo -extract x86_64 -extract ppc64 -output "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-64" "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"
223 install_IDLE:
224 cd IDLE && make install
226 install_BuildApplet:
227 $(RUNSHARED) @ARCH_RUN_32BIT@ $(BUILDPYTHON) $(srcdir)/scripts/BuildApplet.py \
228 --destroot "$(DESTDIR)" \
229 --python=$(prefix)/Resources/Python.app/Contents/MacOS/$(PYTHONFRAMEWORK)`test -f "$(DESTDIR)$(prefix)/Resources/Python.app/Contents/MacOS/$(PYTHONFRAMEWORK)-32" && echo "-32"` \
230 --output "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app" \
231 $(srcdir)/scripts/BuildApplet.py
233 MACLIBDEST=$(LIBDEST)/plat-mac
234 MACTOOLSDEST=$(prefix)/Mac/Tools
235 MACTOOLSSRC=$(srcdir)/Mac/Tools
236 MACTOOLSSUBDIRS=IDE
238 installmacsubtree:
239 @for i in $(MACTOOLSDEST); \
240 do \
241 if test ! -d $(DESTDIR)$$i; then \
242 echo "Creating directory $(DESTDIR)$$i"; \
243 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
244 else true; \
245 fi; \
246 done
247 @for d in $(MACTOOLSSUBDIRS); \
248 do \
249 a=$(MACTOOLSSRC)/$$d; \
250 if test ! -d $$a; then continue; else true; fi; \
251 b=$(DESTDIR)$(MACTOOLSDEST)/$$d; \
252 if test ! -d $$b; then \
253 echo "Creating directory $$b"; \
254 $(INSTALL) -d -m $(DIRMODE) $$b; \
255 else true; \
256 fi; \
257 done
258 @for d in $(MACTOOLSSUBDIRS); \
259 do \
260 a=$(MACTOOLSSRC)/$$d; \
261 if test ! -d $$a; then continue; else true; fi; \
262 b=$(DESTDIR)$(MACTOOLSDEST)/$$d; \
263 for i in $$a/*; \
264 do \
265 case $$i in \
266 *CVS) ;; \
267 *.svn) ;; \
268 *.py[co]) ;; \
269 *.orig) ;; \
270 *~) ;; \
271 *.rsrc) \
272 echo $(CPMAC) $$i $$b ; \
273 $(CPMAC) $$i $$b ; \
274 ;; \
275 *) \
276 if test -d $$i; then continue; fi; \
277 if test -x $$i; then \
278 echo $(INSTALL_SCRIPT) $$i $$b; \
279 $(INSTALL_SCRIPT) $$i $$b; \
280 else \
281 echo $(INSTALL_DATA) $$i $$b; \
282 $(INSTALL_DATA) $$i $$b; \
283 fi;; \
284 esac; \
285 done; \
286 done
289 $(RUNSHARED) @ARCH_RUN_32BIT@ $(BUILDPYTHON) $(CACHERSRC) -v $(DESTDIR)$(MACLIBDEST) $(DESTDIR)$(MACTOOLSDEST)
290 $(RUNSHARED) $(BUILDPYTHON) -Wi -tt $(compileall) -d $(MACTOOLSDEST) -x badsyntax $(DESTDIR)$(MACTOOLSDEST)
291 $(RUNSHARED) $(BUILDPYTHON) -O -Wi -tt $(compileall) -d $(MACTOOLSDEST) -x badsyntax $(DESTDIR)$(MACTOOLSDEST)
293 $(INSTALLED_PYTHONAPP): install_Python
295 installextras: $(srcdir)/Extras.ReadMe.txt $(srcdir)/Extras.install.py
296 $(INSTALL) -d "$(DESTDIR)$(PYTHONAPPSDIR)/Extras"
297 $(INSTALL) $(srcdir)/Extras.ReadMe.txt "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/ReadMe.txt"
298 $(RUNSHARED) $(BUILDPYTHON) $(srcdir)/Extras.install.py $(srcdir)/../Demo \
299 "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/Demo"
300 $(RUNSHARED) $(BUILDPYTHON) $(srcdir)/Extras.install.py $(srcdir)/Demo \
301 "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/Demo.Mac"
304 checkapplepython: $(srcdir)/Tools/fixapplepython23.py
305 @if ! $(RUNSHARED) $(BUILDPYTHON) $(srcdir)/Tools/fixapplepython23.py -n; then \
306 echo "* WARNING: Apple-installed Python 2.3 will have trouble building extensions from now on."; \
307 echo "* WARNING: Run $(srcdir)/Tools/fixapplepython23.py with \"sudo\" to fix this."; \
311 clean:
312 rm pythonw
313 cd PythonLauncher && make clean
314 cd IDLE && make clean
316 Makefile: $(srcdir)/Makefile.in ../config.status
317 cd .. && CONFIG_FILES=Mac/Makefile CONFIG_HEADERS= $(SHELL) ./config.status