2002-06-21 11:48:38 -03:00
|
|
|
# This file can be invoked from the "python.app" target in the
|
|
|
|
# main Makefile. The next two variables are overridden on the
|
|
|
|
# commandline in that case.
|
|
|
|
|
|
|
|
# assume user was invoking from Mac/OSX directory and building in source tree
|
|
|
|
PYTHONBUILDDIR = ../..
|
|
|
|
PYTHONSRCDIR = ../..
|
|
|
|
|
2001-09-06 13:33:57 -03:00
|
|
|
INSTALLDIR=/Library/Frameworks/Python.framework/Versions/Current
|
2002-07-31 11:46:04 -03:00
|
|
|
PYTHONAPPSDIR=/Applications/Python
|
|
|
|
APPINSTALLDIR=$(PYTHONAPPSDIR)/Python.app
|
2001-09-05 19:09:50 -03:00
|
|
|
|
2002-03-29 10:18:18 -04:00
|
|
|
# Variables for installing the "normal" unix binaries
|
|
|
|
UNIXBINDIR=/usr/local/bin
|
|
|
|
INSTALLED_PYTHON=$(INSTALLDIR)/bin/python
|
|
|
|
INSTALLED_PYTHONW=$(APPINSTALLDIR)/Contents/MacOS/python
|
|
|
|
|
2001-09-06 13:33:57 -03:00
|
|
|
# Items more-or-less copied from the main Makefile
|
2002-07-08 10:34:23 -03:00
|
|
|
VERSION=2.3
|
2001-09-06 13:33:57 -03:00
|
|
|
DIRMODE=755
|
|
|
|
INSTALL=/usr/bin/install -c
|
2002-03-29 10:18:18 -04:00
|
|
|
INSTALL_SYMLINK=/usr/bin/install -l as
|
2001-09-06 13:33:57 -03:00
|
|
|
INSTALL_PROGRAM=${INSTALL}
|
|
|
|
INSTALL_SCRIPT= ${INSTALL_PROGRAM}
|
|
|
|
INSTALL_DATA= ${INSTALL} -m 644
|
2002-03-29 10:18:18 -04:00
|
|
|
STRIPFLAG=-s
|
2002-03-29 17:17:14 -04:00
|
|
|
OPT=-g -O3 -Wall -Wstrict-prototypes -Wno-long-double -no-cpp-precomp \
|
|
|
|
-fno-common -dynamic
|
2002-06-21 11:48:38 -03:00
|
|
|
INCLUDES=-I$(PYTHONBUILDDIR) -I$(PYTHONSRCDIR)/Include \
|
|
|
|
-I$(PYTHONSRCDIR)/Mac/Include
|
2001-09-05 19:09:50 -03:00
|
|
|
DEFINES=-DHAVE_CONFIG_H
|
|
|
|
|
|
|
|
CFLAGS=$(OPT) $(DEFINES) $(INCLUDES)
|
2002-07-31 11:46:04 -03:00
|
|
|
LDFLAGS=-F$(PYTHONBUILDDIR) -framework System -framework Python -framework Carbon \
|
2001-09-05 19:09:50 -03:00
|
|
|
-framework Foundation
|
|
|
|
CC=cc
|
|
|
|
LD=cc
|
2002-01-27 16:05:20 -04:00
|
|
|
REZ=/Developer/Tools/Rez
|
|
|
|
DEREZ=/Developer/Tools/DeRez
|
2001-09-05 19:09:50 -03:00
|
|
|
|
|
|
|
OBJECTS=$(PYTHONBUILDDIR)/Mac/Python/macmain.o \
|
|
|
|
$(PYTHONBUILDDIR)/Mac/Python/macgetargv.o
|
|
|
|
|
2001-09-08 21:36:52 -03:00
|
|
|
PYTHON=$(PYTHONBUILDDIR)/python.exe
|
2002-06-21 11:48:38 -03:00
|
|
|
APPTEMPLATE=$(PYTHONSRCDIR)/Mac/OSXResources/app
|
2001-09-06 13:33:57 -03:00
|
|
|
APPSUBDIRS=MacOS Resources Resources/English.lproj
|
2002-06-21 11:48:38 -03:00
|
|
|
RESOURCEDIR=$(PYTHONSRCDIR)/Mac/Resources
|
2001-09-08 21:36:52 -03:00
|
|
|
RESOURCEFILE=python.rsrc
|
2002-06-21 11:48:38 -03:00
|
|
|
RFCONVERTER=$(PYTHONSRCDIR)/Mac/Lib/applesingle.py
|
2002-07-31 11:46:04 -03:00
|
|
|
|
|
|
|
install_all: install_PythonLauncher install_Python install_IDE
|
|
|
|
|
|
|
|
install_PythonLauncher:
|
|
|
|
cd $(PYTHONSRCDIR)/Mac/OSX/PythonLauncher/PythonLauncher.pbproj ; \
|
|
|
|
pbxbuild -target PythonLauncher -buildstyle Deployment DSTROOT=/ install
|
|
|
|
|
|
|
|
install_Python: pythonforbundle
|
|
|
|
@for i in $(PYTHONAPPSDIR) $(APPINSTALLDIR) $(APPINSTALLDIR)/Contents; do \
|
2001-09-06 13:33:57 -03:00
|
|
|
if test ! -d $$i; then \
|
|
|
|
echo "Creating directory $$i"; \
|
|
|
|
$(INSTALL) -d -m $(DIRMODE) $$i; \
|
|
|
|
fi;\
|
|
|
|
done
|
|
|
|
@for i in $(APPSUBDIRS); do \
|
|
|
|
if test ! -d $(APPINSTALLDIR)/Contents/$$i; then \
|
|
|
|
echo "Creating directory $(APPINSTALLDIR)/Contents/$$i"; \
|
|
|
|
$(INSTALL) -d -m $(DIRMODE) $(APPINSTALLDIR)/Contents/$$i; \
|
|
|
|
else true; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
@for d in . $(APPSUBDIRS); \
|
|
|
|
do \
|
|
|
|
a=$(APPTEMPLATE)/$$d; \
|
|
|
|
if test ! -d $$a; then continue; else true; fi; \
|
|
|
|
b=$(APPINSTALLDIR)/Contents/$$d; \
|
|
|
|
for i in $$a/*; \
|
|
|
|
do \
|
|
|
|
case $$i in \
|
|
|
|
*CVS) ;; \
|
|
|
|
*.py[co]) ;; \
|
|
|
|
*.orig) ;; \
|
|
|
|
*~) ;; \
|
|
|
|
*) \
|
|
|
|
if test -d $$i; then continue; fi; \
|
|
|
|
if test -x $$i; then \
|
|
|
|
echo $(INSTALL_SCRIPT) $$i $$b; \
|
|
|
|
$(INSTALL_SCRIPT) $$i $$b; \
|
|
|
|
else \
|
|
|
|
echo $(INSTALL_DATA) $$i $$b; \
|
|
|
|
$(INSTALL_DATA) $$i $$b; \
|
|
|
|
fi;; \
|
|
|
|
esac; \
|
|
|
|
done; \
|
|
|
|
done
|
2002-03-29 10:18:18 -04:00
|
|
|
$(INSTALL_PROGRAM) $(STRIPFLAG) pythonforbundle $(APPINSTALLDIR)/Contents/MacOS/python
|
2001-09-08 21:36:52 -03:00
|
|
|
# Create a temporary version of the resources here
|
2002-01-15 19:20:40 -04:00
|
|
|
$(PYTHON) $(RFCONVERTER) -r $(RESOURCEDIR)/dialogs.rsrc dialogs.rsrc
|
|
|
|
$(PYTHON) $(RFCONVERTER) -r $(RESOURCEDIR)/errors.rsrc errors.rsrc
|
2002-01-27 16:05:20 -04:00
|
|
|
$(DEREZ) -useDF -skip ckid dialogs.rsrc > dialogs.r
|
|
|
|
$(DEREZ) -useDF -skip ckid errors.rsrc > errors.r
|
|
|
|
$(REZ) -useDF -o $(RESOURCEFILE) dialogs.r errors.r
|
2001-09-08 21:36:52 -03:00
|
|
|
$(INSTALL_DATA) $(RESOURCEFILE) $(APPINSTALLDIR)/Contents/Resources/$(RESOURCEFILE)
|
2002-07-31 11:46:04 -03:00
|
|
|
|
|
|
|
install_IDE: $(INSTALLED_PYTHONW)
|
|
|
|
$(INSTALLED_PYTHONW) $(PYTHONSRCDIR)/Mac/scripts/BuildApplet.py \
|
|
|
|
--output $(PYTHONAPPSDIR)/PythonIDE.app --noargv \
|
|
|
|
$(PYTHONSRCDIR)/Mac/Tools/IDE/PythonIDE.py
|
2001-09-06 13:33:57 -03:00
|
|
|
|
|
|
|
LIBDEST=$(INSTALLDIR)/Mac/Lib
|
2002-06-21 11:48:38 -03:00
|
|
|
LIBSRC=$(PYTHONSRCDIR)/Mac/Lib
|
2002-05-23 19:18:13 -03:00
|
|
|
LIBSUBDIRS= \
|
|
|
|
Carbon \
|
|
|
|
lib-scriptpackages \
|
|
|
|
lib-scriptpackages/_builtinSuites \
|
|
|
|
lib-scriptpackages/CodeWarrior \
|
|
|
|
lib-scriptpackages/Explorer \
|
|
|
|
lib-scriptpackages/Finder \
|
|
|
|
lib-scriptpackages/Netscape \
|
|
|
|
lib-scriptpackages/StdSuites \
|
|
|
|
lib-scriptpackages/Terminal \
|
|
|
|
mkcwproject \
|
|
|
|
mkcwproject/template \
|
|
|
|
mkcwproject/template-carbon \
|
|
|
|
mkcwproject/template-ppc
|
2002-01-21 18:51:55 -04:00
|
|
|
TOOLSDEST=$(INSTALLDIR)/Mac/Tools
|
2002-06-21 11:48:38 -03:00
|
|
|
TOOLSSRC=$(PYTHONSRCDIR)/Mac/Tools
|
2002-01-21 18:51:55 -04:00
|
|
|
TOOLSSUBDIRS=IDE
|
2001-09-06 13:33:57 -03:00
|
|
|
installmacsubtree:
|
2002-01-21 18:51:55 -04:00
|
|
|
@for i in $(LIBDEST) $(TOOLSDEST); \
|
2001-09-06 13:33:57 -03:00
|
|
|
do \
|
|
|
|
if test ! -d $$i; then \
|
|
|
|
echo "Creating directory $$i"; \
|
|
|
|
$(INSTALL) -d -m $(DIRMODE) $$i; \
|
|
|
|
else true; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
@for d in $(LIBSUBDIRS); \
|
|
|
|
do \
|
|
|
|
a=$(LIBSRC)/$$d; \
|
|
|
|
if test ! -d $$a; then continue; else true; fi; \
|
|
|
|
b=$(LIBDEST)/$$d; \
|
|
|
|
if test ! -d $$b; then \
|
|
|
|
echo "Creating directory $$b"; \
|
|
|
|
$(INSTALL) -d -m $(DIRMODE) $$b; \
|
|
|
|
else true; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
@for i in $(LIBSRC)/*.py $(LIBSRC)/*.rsrc; \
|
|
|
|
do \
|
|
|
|
if test -x $$i; then \
|
|
|
|
$(INSTALL_SCRIPT) $$i $(LIBDEST); \
|
|
|
|
echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
|
|
|
|
else \
|
|
|
|
$(INSTALL_DATA) $$i $(LIBDEST); \
|
|
|
|
echo $(INSTALL_DATA) $$i $(LIBDEST); \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
@for d in $(LIBSUBDIRS); \
|
|
|
|
do \
|
|
|
|
a=$(LIBSRC)/$$d; \
|
|
|
|
if test ! -d $$a; then continue; else true; fi; \
|
|
|
|
b=$(LIBDEST)/$$d; \
|
|
|
|
for i in $$a/*; \
|
|
|
|
do \
|
|
|
|
case $$i in \
|
|
|
|
*CVS) ;; \
|
|
|
|
*.py[co]) ;; \
|
|
|
|
*.orig) ;; \
|
|
|
|
*~) ;; \
|
|
|
|
*) \
|
|
|
|
if test -d $$i; then continue; fi; \
|
|
|
|
if test -x $$i; then \
|
|
|
|
echo $(INSTALL_SCRIPT) $$i $$b; \
|
|
|
|
$(INSTALL_SCRIPT) $$i $$b; \
|
|
|
|
else \
|
|
|
|
echo $(INSTALL_DATA) $$i $$b; \
|
|
|
|
$(INSTALL_DATA) $$i $$b; \
|
|
|
|
fi;; \
|
|
|
|
esac; \
|
|
|
|
done; \
|
|
|
|
done
|
2002-01-21 18:51:55 -04:00
|
|
|
@for d in $(TOOLSSUBDIRS); \
|
|
|
|
do \
|
|
|
|
a=$(TOOLSSRC)/$$d; \
|
|
|
|
if test ! -d $$a; then continue; else true; fi; \
|
|
|
|
b=$(TOOLSDEST)/$$d; \
|
|
|
|
if test ! -d $$b; then \
|
|
|
|
echo "Creating directory $$b"; \
|
|
|
|
$(INSTALL) -d -m $(DIRMODE) $$b; \
|
|
|
|
else true; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
@for d in $(TOOLSSUBDIRS); \
|
|
|
|
do \
|
|
|
|
a=$(TOOLSSRC)/$$d; \
|
|
|
|
if test ! -d $$a; then continue; else true; fi; \
|
|
|
|
b=$(TOOLSDEST)/$$d; \
|
|
|
|
for i in $$a/*; \
|
|
|
|
do \
|
|
|
|
case $$i in \
|
|
|
|
*CVS) ;; \
|
|
|
|
*.py[co]) ;; \
|
|
|
|
*.orig) ;; \
|
|
|
|
*~) ;; \
|
|
|
|
*) \
|
|
|
|
if test -d $$i; then continue; fi; \
|
|
|
|
if test -x $$i; then \
|
|
|
|
echo $(INSTALL_SCRIPT) $$i $$b; \
|
|
|
|
$(INSTALL_SCRIPT) $$i $$b; \
|
|
|
|
else \
|
|
|
|
echo $(INSTALL_DATA) $$i $$b; \
|
|
|
|
$(INSTALL_DATA) $$i $$b; \
|
|
|
|
fi;; \
|
|
|
|
esac; \
|
|
|
|
done; \
|
|
|
|
done
|
|
|
|
|
2002-07-08 10:34:23 -03:00
|
|
|
$(INSTALL_DATA) $(PYTHONSRCDIR)/Mac/OSX/Mac.pth $(INSTALLDIR)/lib/python$(VERSION)/site-packages/
|
2002-03-29 10:18:18 -04:00
|
|
|
|
|
|
|
# Put symlinks "python" and "pythonw" in the standard place
|
2002-07-31 11:46:04 -03:00
|
|
|
$(INSTALLED_PYTHONW): install_Python
|
|
|
|
# $(INSTALLED_PYTHON) has to be done by the main Makefile, we cannot do that here.
|
|
|
|
|
|
|
|
installunixprograms: $(INSTALLED_PYTHON) $(INSTALLED_PYTHONW) pythonw.sh
|
2002-03-29 10:18:18 -04:00
|
|
|
$(INSTALL) -d $(UNIXBINDIR)
|
|
|
|
$(INSTALL_SYMLINK) $(INSTALLED_PYTHON) $(UNIXBINDIR)/python
|
|
|
|
$(INSTALL) pythonw.sh $(UNIXBINDIR)/pythonw
|
2002-01-18 12:12:27 -04:00
|
|
|
|
2002-07-08 10:34:23 -03:00
|
|
|
# This is for development purposes: create a Mac.pth that refers to the source
|
|
|
|
# directories
|
|
|
|
dontinstallmacsubtree:
|
|
|
|
l=`cd $(PYTHONSRCDIR)/Mac/Lib; pwd`; \
|
|
|
|
echo $$l > $(INSTALLDIR)/lib/python$(VERSION)/site-packages/Mac.pth ; \
|
|
|
|
echo $$l/lib-scriptpackages >> $(INSTALLDIR)/lib/python$(VERSION)/site-packages/Mac.pth
|
2002-06-21 11:48:38 -03:00
|
|
|
|
2002-07-31 11:46:04 -03:00
|
|
|
pythonforbundle: $(OBJECTS)
|
|
|
|
$(LD) $(LDFLAGS) $(OBJECTS) -o pythonforbundle
|
2002-06-21 11:48:38 -03:00
|
|
|
|
|
|
|
# Rules to build each file in OBJECTS - is there a better way?
|
|
|
|
$(PYTHONBUILDDIR)/Mac/Python/macmain.o: $(PYTHONSRCDIR)/Mac/Python/macmain.c
|
|
|
|
$(CC) $(CFLAGS) -c $(PYTHONSRCDIR)/Mac/Python/macmain.c -o $@
|
|
|
|
|
|
|
|
$(PYTHONBUILDDIR)/Mac/Python/macgetargv.o: $(PYTHONSRCDIR)/Mac/Python/macgetargv.c
|
|
|
|
$(CC) $(CFLAGS) -c $(PYTHONSRCDIR)/Mac/Python/macgetargv.c -o $@
|
|
|
|
|