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.
9 LIBDEST
=$(prefix)/lib
/python
$(VERSION
)
11 BUILDEXE
=@BUILDEXEEXT@
12 BUILDPYTHON
=$(builddir
)/python
$(BUILDEXE
)
15 FRAMEWORKUNIXTOOLSPREFIX
=@FRAMEWORKUNIXTOOLSPREFIX@
16 PYTHONFRAMEWORK
=@PYTHONFRAMEWORK@
17 PYTHONFRAMEWORKIDENTIFIER
=@PYTHONFRAMEWORKIDENTIFIER@
20 # These are normally glimpsed from the previous set
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
32 INSTALL_SYMLINK
=ln
-fsn
33 INSTALL_PROGRAM
=@INSTALL_PROGRAM@
34 INSTALL_SCRIPT
= @INSTALL_SCRIPT@
35 INSTALL_DATA
=@INSTALL_DATA@
38 CPMAC
=/Developer
/Tools
/CpMac
40 APPTEMPLATE
=$(srcdir)/Resources
/app
41 APPSUBDIRS
=MacOS Resources
42 CACHERSRC
=$(srcdir)/scripts
/cachersrc.py
43 compileall
=$(srcdir)/..
/Lib
/compileall.py
45 installapps
: install_Python install_BuildApplet install_PythonLauncher \
46 install_IDLE checkapplepython install_pythonw install_versionedtools
48 installapps4way
: install_Python4way install_BuildApplet install_PythonLauncher install_IDLE install_pythonw4way install_versionedtools
51 install_pythonw
: pythonw
52 $(INSTALL_PROGRAM
) $(STRIPFLAG
) pythonw
"$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)"
53 $(INSTALL_PROGRAM
) $(STRIPFLAG
) pythonw
"$(DESTDIR)$(prefix)/bin/python$(VERSION)"
54 ln
-sf python
$(VERSION
) "$(DESTDIR)$(prefix)/bin/python"
55 ln
-sf pythonw
$(VERSION
) "$(DESTDIR)$(prefix)/bin/pythonw"
58 # Install 3 variants of python/pythonw:
59 # - 32-bit (i386 and ppc)
60 # - 64-bit (x86_64 and ppc64)
61 # - all (all four architectures)
62 # - Make 'python' and 'pythonw' aliases for the 32-bit variant
63 install_pythonw4way
: pythonw-32 pythonw-64 pythonw
64 $(INSTALL_PROGRAM
) $(STRIPFLAG
) pythonw-64
"$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-64"
65 $(INSTALL_PROGRAM
) $(STRIPFLAG
) pythonw-64
"$(DESTDIR)$(prefix)/bin/python$(VERSION)-64"
66 ln
-sf python
$(VERSION
)-64 "$(DESTDIR)$(prefix)/bin/python-64"
67 ln
-sf pythonw
$(VERSION
)-64 "$(DESTDIR)$(prefix)/bin/pythonw-64"
69 $(INSTALL_PROGRAM
) $(STRIPFLAG
) pythonw-32
"$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-32"
70 $(INSTALL_PROGRAM
) $(STRIPFLAG
) pythonw-32
"$(DESTDIR)$(prefix)/bin/python$(VERSION)-32"
71 ln
-sf python
$(VERSION
)-32 "$(DESTDIR)$(prefix)/bin/python-32"
72 ln
-sf pythonw
$(VERSION
)-32 "$(DESTDIR)$(prefix)/bin/pythonw-32"
74 $(INSTALL_PROGRAM
) $(STRIPFLAG
) pythonw
"$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-all"
75 $(INSTALL_PROGRAM
) $(STRIPFLAG
) pythonw
"$(DESTDIR)$(prefix)/bin/python$(VERSION)-all"
76 ln
-sf python
$(VERSION
)-all "$(DESTDIR)$(prefix)/bin/python-all"
77 ln
-sf pythonw
$(VERSION
)-all "$(DESTDIR)$(prefix)/bin/pythonw-all"
79 ln
-sf pythonw
$(VERSION
)-32 "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)"
80 ln
-sf python
$(VERSION
)-32 "$(DESTDIR)$(prefix)/bin/python$(VERSION)"
81 ln
-sf pythonw
$(VERSION
)-32 "$(DESTDIR)$(prefix)/bin/pythonw"
82 ln
-sf python
$(VERSION
)-32 "$(DESTDIR)$(prefix)/bin/python"
85 # Install unix tools in /usr/local/bin. These are just aliases for the
86 # actual installation inside the framework.
89 if
[ ! -d
"$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then \
90 $(INSTALL
) -d
-m
$(DIRMODE
) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\
92 for fn in python pythonw idle pydoc python-config smtpd.py \
93 python
$(VERSION
) pythonw
$(VERSION
) idle
$(VERSION
) \
94 pydoc
$(VERSION
) python
$(VERSION
)-config smtpd
$(VERSION
).py
;\
96 ln
-fs
"$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
100 # TODO: install symlinks for -32, -64 and -all as well
101 installunixtools4way
: installunixtools
105 # Like installunixtools, but only install links to the versioned binaries.
108 if
[ ! -d
"$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then \
109 $(INSTALL
) -d
-m
$(DIRMODE
) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\
111 for fn in python
$(VERSION
) pythonw
$(VERSION
) idle
$(VERSION
) \
112 pydoc
$(VERSION
) python
$(VERSION
)-config smtpd
$(VERSION
).py
;\
114 ln
-fs
"$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
117 # TODO: -32, -64 and -all variants
118 altinstallunixtools4way
: altinstallunixtools
120 # By default most tools are installed without a version in their basename, to
121 # make it easier to install (and use) several python versions side-by-side move
122 # the tools to a version-specific name and add the non-versioned name as an
124 install_versionedtools
:
125 for fn in idle pydoc
;\
127 if
[ -h
"$(DESTDIR)$(prefix)/bin/$${fn}" ]; then \
130 mv
"$(DESTDIR)$(prefix)/bin/$${fn}" "$(DESTDIR)$(prefix)/bin/$${fn}$(VERSION)" ;\
131 ln
-sf
"$${fn}$(VERSION)" "$(DESTDIR)$(prefix)/bin/$${fn}" ;\
133 if
[ ! -h
"$(DESTDIR)$(prefix)/bin/python-config" ]; then \
134 mv
"$(DESTDIR)$(prefix)/bin/python-config" "$(DESTDIR)$(prefix)/bin/python$(VERSION)-config" ;\
135 ln
-sf
"python$(VERSION)-config" "$(DESTDIR)$(prefix)/bin/python-config" ; \
137 if
[ ! -h
"$(DESTDIR)$(prefix)/bin/smtpd.py" ]; then \
138 mv
"$(DESTDIR)$(prefix)/bin/smtpd.py" "$(DESTDIR)$(prefix)/bin/smtpd$(VERSION).py" ;\
139 ln
-sf
"smtpd$(VERSION).py" "$(DESTDIR)$(prefix)/bin/smtpd.py" ;\
143 pythonw
: $(srcdir)/Tools
/pythonw.c Makefile
144 $(CC
) $(LDFLAGS
) -o
$@
$(srcdir)/Tools
/pythonw.c \
145 -DPYTHONWEXECUTABLE
='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"'
147 pythonw-32
: $(srcdir)/Tools
/pythonw.c Makefile
148 $(CC
) $(LDFLAGS
) -o
$@
-arch i386
-arch ppc
$(srcdir)/Tools
/pythonw.c \
149 -DPYTHONWEXECUTABLE
='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-32"'
151 pythonw-64
: $(srcdir)/Tools
/pythonw.c Makefile
152 $(CC
) $(LDFLAGS
) -o
$@
-arch x86_64
-arch ppc64
$(srcdir)/Tools
/pythonw.c \
153 -DPYTHONWEXECUTABLE
='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-64"'
155 install_PythonLauncher
:
156 cd PythonLauncher
&& make
install DESTDIR
=$(DESTDIR
)
159 @for i in
"$(PYTHONAPPSDIR)" "$(APPINSTALLDIR)" "$(APPINSTALLDIR)/Contents"; do \
160 if
test ! -d
"$(DESTDIR)$$i"; then \
161 echo
"Creating directory $(DESTDIR)$$i"; \
162 $(INSTALL
) -d
-m
$(DIRMODE
) "$(DESTDIR)$$i"; \
165 @for i in
$(APPSUBDIRS
); do \
166 if
test ! -d
"$(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; then \
167 echo
"Creating directory $(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; \
168 $(INSTALL
) -d
-m
$(DIRMODE
) "$(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; \
172 @for d in .
$(APPSUBDIRS
); \
174 a
=$(APPTEMPLATE
)/$$d; \
175 if
test ! -d
$$a; then continue
; else true
; fi
; \
176 b
="$(DESTDIR)$(APPINSTALLDIR)/Contents/$$d"; \
186 echo
$(CPMAC
) "$$i" $$b; \
187 $(CPMAC
) "$$i" "$$b"; \
190 if
test -d
$$i; then continue
; fi
; \
191 if
test -x
$$i; then \
192 echo
$(INSTALL_SCRIPT
) "$$i" "$$b"; \
193 $(INSTALL_SCRIPT
) "$$i" "$$b"; \
195 echo
$(INSTALL_DATA
) "$$i" "$$b"; \
196 $(INSTALL_DATA
) "$$i" "$$b"; \
201 $(INSTALL_PROGRAM
) $(STRIPFLAG
) $(BUILDPYTHON
) "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"
202 sed
-e
"s!%bundleid%!$(PYTHONFRAMEWORKIDENTIFIER)!g" \
203 -e
"s!%version%!`$(RUNSHARED) $(BUILDPYTHON) \
204 -c 'import platform; print(platform.python_version())'`!g" \
205 < "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist.in" \
206 > "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist"
207 rm "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist.in"
209 install_Python4way
: install_Python
210 lipo
-extract i386
-extract ppc7400
-output
"$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-32" "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"
211 lipo
-extract x86_64
-extract ppc64
-output
"$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-64" "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"
216 cd IDLE
&& make
install
219 $(RUNSHARED
) @ARCH_RUN_32BIT@
$(BUILDPYTHON
) $(srcdir)/scripts
/BuildApplet.py \
220 --destroot
"$(DESTDIR)" \
221 --python
=$(prefix)/Resources
/Python.app
/Contents
/MacOS
/$(PYTHONFRAMEWORK
)`test -f "$(DESTDIR)$(prefix)/Resources/Python.app/Contents/MacOS/$(PYTHONFRAMEWORK)-32" && echo "-32"` \
222 --output
"$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app" \
223 $(srcdir)/scripts
/BuildApplet.py
225 MACLIBDEST
=$(LIBDEST
)/plat-mac
226 MACTOOLSDEST
=$(prefix)/Mac
/Tools
227 MACTOOLSSRC
=$(srcdir)/Mac
/Tools
231 @for i in
$(MACTOOLSDEST
); \
233 if
test ! -d
$(DESTDIR
)$$i; then \
234 echo
"Creating directory $(DESTDIR)$$i"; \
235 $(INSTALL
) -d
-m
$(DIRMODE
) $(DESTDIR
)$$i; \
239 @for d in
$(MACTOOLSSUBDIRS
); \
241 a
=$(MACTOOLSSRC
)/$$d; \
242 if
test ! -d
$$a; then continue
; else true
; fi
; \
243 b
=$(DESTDIR
)$(MACTOOLSDEST
)/$$d; \
244 if
test ! -d
$$b; then \
245 echo
"Creating directory $$b"; \
246 $(INSTALL
) -d
-m
$(DIRMODE
) $$b; \
250 @for d in
$(MACTOOLSSUBDIRS
); \
252 a
=$(MACTOOLSSRC
)/$$d; \
253 if
test ! -d
$$a; then continue
; else true
; fi
; \
254 b
=$(DESTDIR
)$(MACTOOLSDEST
)/$$d; \
264 echo
$(CPMAC
) $$i $$b ; \
268 if
test -d
$$i; then continue
; fi
; \
269 if
test -x
$$i; then \
270 echo
$(INSTALL_SCRIPT
) $$i $$b; \
271 $(INSTALL_SCRIPT
) $$i $$b; \
273 echo
$(INSTALL_DATA
) $$i $$b; \
274 $(INSTALL_DATA
) $$i $$b; \
281 $(RUNSHARED
) @ARCH_RUN_32BIT@
$(BUILDPYTHON
) $(CACHERSRC
) -v
$(DESTDIR
)$(MACLIBDEST
) $(DESTDIR
)$(MACTOOLSDEST
)
282 $(RUNSHARED
) $(BUILDPYTHON
) -Wi
-tt
$(compileall
) -d
$(MACTOOLSDEST
) -x badsyntax
$(DESTDIR
)$(MACTOOLSDEST
)
283 $(RUNSHARED
) $(BUILDPYTHON
) -O
-Wi
-tt
$(compileall
) -d
$(MACTOOLSDEST
) -x badsyntax
$(DESTDIR
)$(MACTOOLSDEST
)
285 $(INSTALLED_PYTHONAPP
): install_Python
287 installextras
: $(srcdir)/Extras.ReadMe.txt
$(srcdir)/Extras.
install.py
288 $(INSTALL
) -d
"$(DESTDIR)$(PYTHONAPPSDIR)/Extras"
289 $(INSTALL
) $(srcdir)/Extras.ReadMe.txt
"$(DESTDIR)$(PYTHONAPPSDIR)/Extras/ReadMe.txt"
290 $(RUNSHARED
) $(BUILDPYTHON
) $(srcdir)/Extras.
install.py
$(srcdir)/..
/Demo \
291 "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/Demo"
292 $(RUNSHARED
) $(BUILDPYTHON
) $(srcdir)/Extras.
install.py
$(srcdir)/Demo \
293 "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/Demo.Mac"
296 checkapplepython
: $(srcdir)/Tools
/fixapplepython23.py
297 @if
! $(RUNSHARED
) $(BUILDPYTHON
) $(srcdir)/Tools
/fixapplepython23.py
-n
; then \
298 echo
"* WARNING: Apple-installed Python 2.3 will have trouble building extensions from now on."; \
299 echo
"* WARNING: Run $(srcdir)/Tools/fixapplepython23.py with \"sudo\" to fix this."; \
305 cd PythonLauncher
&& make
clean
306 cd IDLE
&& make
clean
308 Makefile
: $(srcdir)/Makefile.in ..
/config.status
309 cd ..
&& CONFIG_FILES
=Mac
/Makefile CONFIG_HEADERS
= $(SHELL
) .
/config.status