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 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
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
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
37 ##CFLAGS=$(OPT) $(DEFINES) $(INCLUDES)
38 ##LDFLAGS=-F$(builddir) -framework System -framework Python -framework Carbon \
39 ## -framework Foundation
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; \
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; \
71 @for d in .
$(APPSUBDIRS
); \
73 a
=$(APPTEMPLATE
)/$$d; \
74 if
test ! -d
$$a; then continue
; else true
; fi
; \
75 b
=$(APPINSTALLDIR
)/Contents
/$$d; \
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; \
89 echo
$(INSTALL_DATA
) $$i $$b; \
90 $(INSTALL_DATA
) $$i $$b; \
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
; \
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
; \
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
143 @for i in
$(MACTOOLSDEST
); \
145 if
test ! -d
$$i; then \
146 echo
"Creating directory $$i"; \
147 $(INSTALL
) -d
-m
$(DIRMODE
) $$i; \
151 @for d in
$(MACTOOLSSUBDIRS
); \
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; \
162 @for d in
$(MACTOOLSSUBDIRS
); \
164 a
=$(MACTOOLSSRC
)/$$d; \
165 if
test ! -d
$$a; then continue
; else true
; fi
; \
166 b
=$(MACTOOLSDEST
)/$$d; \
175 echo
$(CPMAC
) $$i $$b ; \
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; \
184 echo
$(INSTALL_DATA
) $$i $$b; \
185 $(INSTALL_DATA
) $$i $$b; \
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
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