Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cce7e34

Browse files
committed
- Install into /Applications/Python in stead of into /Applications.
- Build PythonLauncher.app and PythonIDE.app as well as Python.app.
1 parent 40e2e51 commit cce7e34

1 file changed

Lines changed: 23 additions & 8 deletions

File tree

Mac/OSX/Makefile

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ PYTHONBUILDDIR = ../..
77
PYTHONSRCDIR = ../..
88

99
INSTALLDIR=/Library/Frameworks/Python.framework/Versions/Current
10-
APPINSTALLDIR=/Applications/Python.app
10+
PYTHONAPPSDIR=/Applications/Python
11+
APPINSTALLDIR=$(PYTHONAPPSDIR)/Python.app
1112

1213
# Variables for installing the "normal" unix binaries
1314
UNIXBINDIR=/usr/local/bin
@@ -30,7 +31,7 @@ INCLUDES=-I$(PYTHONBUILDDIR) -I$(PYTHONSRCDIR)/Include \
3031
DEFINES=-DHAVE_CONFIG_H
3132

3233
CFLAGS=$(OPT) $(DEFINES) $(INCLUDES)
33-
LDFLAGS=-framework System -framework Python -framework Carbon \
34+
LDFLAGS=-F$(PYTHONBUILDDIR) -framework System -framework Python -framework Carbon \
3435
-framework Foundation
3536
CC=cc
3637
LD=cc
@@ -40,17 +41,21 @@ DEREZ=/Developer/Tools/DeRez
4041
OBJECTS=$(PYTHONBUILDDIR)/Mac/Python/macmain.o \
4142
$(PYTHONBUILDDIR)/Mac/Python/macgetargv.o
4243

43-
pythonforbundle: $(OBJECTS)
44-
$(LD) $(LDFLAGS) $(OBJECTS) -o pythonforbundle
45-
4644
PYTHON=$(PYTHONBUILDDIR)/python.exe
4745
APPTEMPLATE=$(PYTHONSRCDIR)/Mac/OSXResources/app
4846
APPSUBDIRS=MacOS Resources Resources/English.lproj
4947
RESOURCEDIR=$(PYTHONSRCDIR)/Mac/Resources
5048
RESOURCEFILE=python.rsrc
5149
RFCONVERTER=$(PYTHONSRCDIR)/Mac/Lib/applesingle.py
52-
install: pythonforbundle
53-
@for i in $(APPINSTALLDIR) $(APPINSTALLDIR)/Contents; do \
50+
51+
install_all: install_PythonLauncher install_Python install_IDE
52+
53+
install_PythonLauncher:
54+
cd $(PYTHONSRCDIR)/Mac/OSX/PythonLauncher/PythonLauncher.pbproj ; \
55+
pbxbuild -target PythonLauncher -buildstyle Deployment DSTROOT=/ install
56+
57+
install_Python: pythonforbundle
58+
@for i in $(PYTHONAPPSDIR) $(APPINSTALLDIR) $(APPINSTALLDIR)/Contents; do \
5459
if test ! -d $$i; then \
5560
echo "Creating directory $$i"; \
5661
$(INSTALL) -d -m $(DIRMODE) $$i; \
@@ -95,6 +100,11 @@ install: pythonforbundle
95100
$(DEREZ) -useDF -skip ckid errors.rsrc > errors.r
96101
$(REZ) -useDF -o $(RESOURCEFILE) dialogs.r errors.r
97102
$(INSTALL_DATA) $(RESOURCEFILE) $(APPINSTALLDIR)/Contents/Resources/$(RESOURCEFILE)
103+
104+
install_IDE: $(INSTALLED_PYTHONW)
105+
$(INSTALLED_PYTHONW) $(PYTHONSRCDIR)/Mac/scripts/BuildApplet.py \
106+
--output $(PYTHONAPPSDIR)/PythonIDE.app --noargv \
107+
$(PYTHONSRCDIR)/Mac/Tools/IDE/PythonIDE.py
98108

99109
LIBDEST=$(INSTALLDIR)/Mac/Lib
100110
LIBSRC=$(PYTHONSRCDIR)/Mac/Lib
@@ -208,7 +218,10 @@ installmacsubtree:
208218
$(INSTALL_DATA) $(PYTHONSRCDIR)/Mac/OSX/Mac.pth $(INSTALLDIR)/lib/python$(VERSION)/site-packages/
209219

210220
# Put symlinks "python" and "pythonw" in the standard place
211-
installunixprograms: $(INSTALLED_PYTHON) pythonw.sh
221+
$(INSTALLED_PYTHONW): install_Python
222+
# $(INSTALLED_PYTHON) has to be done by the main Makefile, we cannot do that here.
223+
224+
installunixprograms: $(INSTALLED_PYTHON) $(INSTALLED_PYTHONW) pythonw.sh
212225
$(INSTALL) -d $(UNIXBINDIR)
213226
$(INSTALL_SYMLINK) $(INSTALLED_PYTHON) $(UNIXBINDIR)/python
214227
$(INSTALL) pythonw.sh $(UNIXBINDIR)/pythonw
@@ -220,6 +233,8 @@ dontinstallmacsubtree:
220233
echo $$l > $(INSTALLDIR)/lib/python$(VERSION)/site-packages/Mac.pth ; \
221234
echo $$l/lib-scriptpackages >> $(INSTALLDIR)/lib/python$(VERSION)/site-packages/Mac.pth
222235

236+
pythonforbundle: $(OBJECTS)
237+
$(LD) $(LDFLAGS) $(OBJECTS) -o pythonforbundle
223238

224239
# Rules to build each file in OBJECTS - is there a better way?
225240
$(PYTHONBUILDDIR)/Mac/Python/macmain.o: $(PYTHONSRCDIR)/Mac/Python/macmain.c

0 commit comments

Comments
 (0)