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 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.
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
;\
101 ln
-fs
"$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
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.
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
;\
119 ln
-fs
"$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
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
129 install_versionedtools
:
130 for fn in idle pydoc
;\
132 if
[ -h
"$(DESTDIR)$(prefix)/bin/$${fn}" ]; then \
135 mv
"$(DESTDIR)$(prefix)/bin/$${fn}" "$(DESTDIR)$(prefix)/bin/$${fn}$(VERSION)" ;\
136 ln
-sf
"$${fn}$(VERSION)" "$(DESTDIR)$(prefix)/bin/$${fn}" ;\
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
)
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"; \
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"; \
180 @for d in .
$(APPSUBDIRS
); \
182 a
=$(APPTEMPLATE
)/$$d; \
183 if
test ! -d
$$a; then continue
; else true
; fi
; \
184 b
="$(DESTDIR)$(APPINSTALLDIR)/Contents/$$d"; \
194 echo
$(CPMAC
) "$$i" $$b; \
195 $(CPMAC
) "$$i" "$$b"; \
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"; \
203 echo
$(INSTALL_DATA
) "$$i" "$$b"; \
204 $(INSTALL_DATA
) "$$i" "$$b"; \
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)"
224 cd IDLE
&& make
install
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
239 @for i in
$(MACTOOLSDEST
); \
241 if
test ! -d
$(DESTDIR
)$$i; then \
242 echo
"Creating directory $(DESTDIR)$$i"; \
243 $(INSTALL
) -d
-m
$(DIRMODE
) $(DESTDIR
)$$i; \
247 @for d in
$(MACTOOLSSUBDIRS
); \
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; \
258 @for d in
$(MACTOOLSSUBDIRS
); \
260 a
=$(MACTOOLSSRC
)/$$d; \
261 if
test ! -d
$$a; then continue
; else true
; fi
; \
262 b
=$(DESTDIR
)$(MACTOOLSDEST
)/$$d; \
272 echo
$(CPMAC
) $$i $$b ; \
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; \
281 echo
$(INSTALL_DATA
) $$i $$b; \
282 $(INSTALL_DATA
) $$i $$b; \
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."; \
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