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@
18 LIPO_32BIT_FLAGS
=@LIPO_32BIT_FLAGS@
21 # These are normally glimpsed from the previous set
23 PYTHONAPPSDIR
=/Applications
/$(PYTHONFRAMEWORK
) $(VERSION
)
24 APPINSTALLDIR
=$(prefix)/Resources
/Python.app
26 # Variables for installing the "normal" unix binaries
27 INSTALLED_PYTHONAPP
=$(APPINSTALLDIR
)/Contents
/MacOS
/$(PYTHONFRAMEWORK
)
29 # Items more-or-less copied from the main Makefile
33 INSTALL_SYMLINK
=ln
-fsn
34 INSTALL_PROGRAM
=@INSTALL_PROGRAM@
35 INSTALL_SCRIPT
= @INSTALL_SCRIPT@
36 INSTALL_DATA
=@INSTALL_DATA@
39 CPMAC
=/Developer
/Tools
/CpMac
41 APPTEMPLATE
=$(srcdir)/Resources
/app
42 APPSUBDIRS
=MacOS Resources
43 CACHERSRC
=$(srcdir)/scripts
/cachersrc.py
44 compileall
=$(srcdir)/..
/Lib
/compileall.py
46 installapps
: install_Python install_pythonw install_BuildApplet install_PythonLauncher \
47 install_IDLE checkapplepython install_versionedtools
50 install_pythonw
: pythonw
51 $(INSTALL_PROGRAM
) $(STRIPFLAG
) pythonw
"$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)"
52 $(INSTALL_PROGRAM
) $(STRIPFLAG
) pythonw
"$(DESTDIR)$(prefix)/bin/python$(VERSION)"
53 ln
-sf python
$(VERSION
) "$(DESTDIR)$(prefix)/bin/python"
54 ln
-sf pythonw
$(VERSION
) "$(DESTDIR)$(prefix)/bin/pythonw"
55 ifneq ($(LIPO_32BIT_FLAGS
),)
56 lipo
$(LIPO_32BIT_FLAGS
) -output
$(DESTDIR
)$(prefix)/bin
/python
$(VERSION
)-32 pythonw
57 lipo
$(LIPO_32BIT_FLAGS
) -output
$(DESTDIR
)$(prefix)/bin
/pythonw
$(VERSION
)-32 pythonw
58 ln
-sf python
$(VERSION
)-32 "$(DESTDIR)$(prefix)/bin/python-32"
59 ln
-sf pythonw
$(VERSION
)-32 "$(DESTDIR)$(prefix)/bin/pythonw-32"
64 # Install unix tools in /usr/local/bin. These are just aliases for the
65 # actual installation inside the framework.
68 if
[ ! -d
"$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then \
69 $(INSTALL
) -d
-m
$(DIRMODE
) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\
71 for fn in python pythonw idle pydoc python-config smtpd.py \
72 python
$(VERSION
) pythonw
$(VERSION
) idle
$(VERSION
) \
73 pydoc
$(VERSION
) python
$(VERSION
)-config smtpd
$(VERSION
).py
;\
75 ln
-fs
"$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
80 # Like installunixtools, but only install links to the versioned binaries.
83 if
[ ! -d
"$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then \
84 $(INSTALL
) -d
-m
$(DIRMODE
) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\
86 for fn in python
$(VERSION
) pythonw
$(VERSION
) idle
$(VERSION
) \
87 pydoc
$(VERSION
) python
$(VERSION
)-config smtpd
$(VERSION
).py
;\
89 ln
-fs
"$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
92 # By default most tools are installed without a version in their basename, to
93 # make it easier to install (and use) several python versions side-by-side move
94 # the tools to a version-specific name and add the non-versioned name as an
96 install_versionedtools
:
97 for fn in idle pydoc
;\
99 if
[ -h
"$(DESTDIR)$(prefix)/bin/$${fn}" ]; then \
102 mv
"$(DESTDIR)$(prefix)/bin/$${fn}" "$(DESTDIR)$(prefix)/bin/$${fn}$(VERSION)" ;\
103 ln
-sf
"$${fn}$(VERSION)" "$(DESTDIR)$(prefix)/bin/$${fn}" ;\
105 if
[ ! -h
"$(DESTDIR)$(prefix)/bin/python-config" ]; then \
106 mv
"$(DESTDIR)$(prefix)/bin/python-config" "$(DESTDIR)$(prefix)/bin/python$(VERSION)-config" ;\
107 ln
-sf
"python$(VERSION)-config" "$(DESTDIR)$(prefix)/bin/python-config" ; \
109 if
[ ! -h
"$(DESTDIR)$(prefix)/bin/smtpd.py" ]; then \
110 mv
"$(DESTDIR)$(prefix)/bin/smtpd.py" "$(DESTDIR)$(prefix)/bin/smtpd$(VERSION).py" ;\
111 ln
-sf
"smtpd$(VERSION).py" "$(DESTDIR)$(prefix)/bin/smtpd.py" ;\
115 pythonw
: $(srcdir)/Tools
/pythonw.c Makefile
116 $(CC
) $(LDFLAGS
) -o
$@
$(srcdir)/Tools
/pythonw.c
-I..
-I
$(srcdir)/..
/Include ..
/$(PYTHONFRAMEWORK
).framework
/Versions
/$(VERSION
)/$(PYTHONFRAMEWORK
)
118 install_PythonLauncher
:
119 cd PythonLauncher
&& make
install DESTDIR
=$(DESTDIR
)
122 @for i in
"$(PYTHONAPPSDIR)" "$(APPINSTALLDIR)" "$(APPINSTALLDIR)/Contents"; do \
123 if
test ! -d
"$(DESTDIR)$$i"; then \
124 echo
"Creating directory $(DESTDIR)$$i"; \
125 $(INSTALL
) -d
-m
$(DIRMODE
) "$(DESTDIR)$$i"; \
128 @for i in
$(APPSUBDIRS
); do \
129 if
test ! -d
"$(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; then \
130 echo
"Creating directory $(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; \
131 $(INSTALL
) -d
-m
$(DIRMODE
) "$(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; \
135 @for d in .
$(APPSUBDIRS
); \
137 a
=$(APPTEMPLATE
)/$$d; \
138 if
test ! -d
$$a; then continue
; else true
; fi
; \
139 b
="$(DESTDIR)$(APPINSTALLDIR)/Contents/$$d"; \
149 echo
$(CPMAC
) "$$i" $$b; \
150 $(CPMAC
) "$$i" "$$b"; \
153 if
test -d
$$i; then continue
; fi
; \
154 if
test -x
$$i; then \
155 echo
$(INSTALL_SCRIPT
) "$$i" "$$b"; \
156 $(INSTALL_SCRIPT
) "$$i" "$$b"; \
158 echo
$(INSTALL_DATA
) "$$i" "$$b"; \
159 $(INSTALL_DATA
) "$$i" "$$b"; \
164 $(INSTALL_PROGRAM
) $(STRIPFLAG
) $(BUILDPYTHON
) "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"
165 sed
-e
"s!%bundleid%!$(PYTHONFRAMEWORKIDENTIFIER)!g" \
166 -e
"s!%version%!`$(RUNSHARED) $(BUILDPYTHON) \
167 -c 'import platform; print(platform.python_version())'`!g" \
168 < "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist.in" \
169 > "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist"
170 rm "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist.in"
174 cd IDLE
&& make
install
177 $(RUNSHARED
) @ARCH_RUN_32BIT@
$(BUILDPYTHON
) $(srcdir)/scripts
/BuildApplet.py \
178 --destroot
"$(DESTDIR)" \
179 --python
=$(prefix)/Resources
/Python.app
/Contents
/MacOS
/Python \
180 --output
"$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app" \
181 $(srcdir)/scripts
/BuildApplet.py
182 ifneq ($(LIPO_32BIT_FLAGS
),)
183 rm "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app/Contents/MacOS/Python"
184 lipo
$(LIPO_32BIT_FLAGS
) -output
"$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app/Contents/MacOS/Python" $(BUILDPYTHON
)
187 MACLIBDEST
=$(LIBDEST
)/plat-mac
188 MACTOOLSDEST
=$(prefix)/Mac
/Tools
189 MACTOOLSSRC
=$(srcdir)/Mac
/Tools
193 @for i in
$(MACTOOLSDEST
); \
195 if
test ! -d
$(DESTDIR
)$$i; then \
196 echo
"Creating directory $(DESTDIR)$$i"; \
197 $(INSTALL
) -d
-m
$(DIRMODE
) $(DESTDIR
)$$i; \
201 @for d in
$(MACTOOLSSUBDIRS
); \
203 a
=$(MACTOOLSSRC
)/$$d; \
204 if
test ! -d
$$a; then continue
; else true
; fi
; \
205 b
=$(DESTDIR
)$(MACTOOLSDEST
)/$$d; \
206 if
test ! -d
$$b; then \
207 echo
"Creating directory $$b"; \
208 $(INSTALL
) -d
-m
$(DIRMODE
) $$b; \
212 @for d in
$(MACTOOLSSUBDIRS
); \
214 a
=$(MACTOOLSSRC
)/$$d; \
215 if
test ! -d
$$a; then continue
; else true
; fi
; \
216 b
=$(DESTDIR
)$(MACTOOLSDEST
)/$$d; \
226 echo
$(CPMAC
) $$i $$b ; \
230 if
test -d
$$i; then continue
; fi
; \
231 if
test -x
$$i; then \
232 echo
$(INSTALL_SCRIPT
) $$i $$b; \
233 $(INSTALL_SCRIPT
) $$i $$b; \
235 echo
$(INSTALL_DATA
) $$i $$b; \
236 $(INSTALL_DATA
) $$i $$b; \
243 $(RUNSHARED
) @ARCH_RUN_32BIT@
$(BUILDPYTHON
) $(CACHERSRC
) -v
$(DESTDIR
)$(MACLIBDEST
) $(DESTDIR
)$(MACTOOLSDEST
)
244 $(RUNSHARED
) $(BUILDPYTHON
) -Wi
-tt
$(compileall
) -d
$(MACTOOLSDEST
) -x badsyntax
$(DESTDIR
)$(MACTOOLSDEST
)
245 $(RUNSHARED
) $(BUILDPYTHON
) -O
-Wi
-tt
$(compileall
) -d
$(MACTOOLSDEST
) -x badsyntax
$(DESTDIR
)$(MACTOOLSDEST
)
247 $(INSTALLED_PYTHONAPP
): install_Python
249 installextras
: $(srcdir)/Extras.ReadMe.txt
$(srcdir)/Extras.
install.py
250 $(INSTALL
) -d
"$(DESTDIR)$(PYTHONAPPSDIR)/Extras"
251 $(INSTALL
) $(srcdir)/Extras.ReadMe.txt
"$(DESTDIR)$(PYTHONAPPSDIR)/Extras/ReadMe.txt"
252 $(RUNSHARED
) $(BUILDPYTHON
) $(srcdir)/Extras.
install.py
$(srcdir)/..
/Demo \
253 "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/Demo"
254 $(RUNSHARED
) $(BUILDPYTHON
) $(srcdir)/Extras.
install.py
$(srcdir)/Demo \
255 "$(DESTDIR)$(PYTHONAPPSDIR)/Extras/Demo.Mac"
258 checkapplepython
: $(srcdir)/Tools
/fixapplepython23.py
259 @if
! $(RUNSHARED
) $(BUILDPYTHON
) $(srcdir)/Tools
/fixapplepython23.py
-n
; then \
260 echo
"* WARNING: Apple-installed Python 2.3 will have trouble building extensions from now on."; \
261 echo
"* WARNING: Run $(srcdir)/Tools/fixapplepython23.py with \"sudo\" to fix this."; \
267 cd PythonLauncher
&& make
clean
268 cd IDLE
&& make
clean
270 Makefile
: $(srcdir)/Makefile.in ..
/config.status
271 cd ..
&& CONFIG_FILES
=Mac
/Makefile CONFIG_HEADERS
= $(SHELL
) .
/config.status