2002-08-08 21:18:21 -03:00
|
|
|
# This file can be invoked from the various frameworkinstall... targets in the
|
|
|
|
# main Makefile. The next couple of variables are overridden on the
|
2002-06-21 11:48:38 -03:00
|
|
|
# commandline in that case.
|
|
|
|
|
2002-08-08 21:18:21 -03:00
|
|
|
VERSION=2.3
|
2002-08-01 18:14:06 -03:00
|
|
|
builddir = ../..
|
|
|
|
srcdir = ../..
|
2002-08-08 21:18:21 -03:00
|
|
|
LIBDEST=$(prefix)/lib/python$(VERSION)
|
2002-08-01 18:14:06 -03:00
|
|
|
prefix=/Library/Frameworks/Python.framework/Versions/$(VERSION)
|
2002-08-08 21:18:21 -03:00
|
|
|
dstroot=/.
|
|
|
|
|
|
|
|
# These are normally glimpsed from the previous set
|
|
|
|
bindir=$(dstroot)/usr/local/bin
|
|
|
|
PYTHONAPPSDIR=$(dstroot)/Applications/Python
|
2002-08-01 18:14:06 -03:00
|
|
|
APPINSTALLDIR=$(prefix)/Resources/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
|
2002-08-01 18:14:06 -03:00
|
|
|
INSTALLED_PYTHON=$(prefix)/bin/python
|
2002-03-29 10:18:18 -04:00
|
|
|
INSTALLED_PYTHONW=$(APPINSTALLDIR)/Contents/MacOS/python
|
|
|
|
|
2001-09-06 13:33:57 -03:00
|
|
|
# Items more-or-less copied from the main Makefile
|
|
|
|
DIRMODE=755
|
|
|
|
INSTALL=/usr/bin/install -c
|
2002-08-30 12:14:02 -03:00
|
|
|
INSTALL_SYMLINK=ln -fs
|
2001-09-06 13:33:57 -03:00
|
|
|
INSTALL_PROGRAM=${INSTALL}
|
|
|
|
INSTALL_SCRIPT= ${INSTALL_PROGRAM}
|
|
|
|
INSTALL_DATA= ${INSTALL} -m 644
|
2002-08-28 18:27:02 -03:00
|
|
|
LN=ln
|
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-08-01 18:14:06 -03:00
|
|
|
INCLUDES=-I$(builddir) -I$(srcdir)/Include -I$(srcdir)/Mac/Include
|
2002-08-08 21:18:21 -03:00
|
|
|
DEFINES=
|
2001-09-05 19:09:50 -03:00
|
|
|
|
|
|
|
CFLAGS=$(OPT) $(DEFINES) $(INCLUDES)
|
2002-08-01 18:14:06 -03:00
|
|
|
LDFLAGS=-F$(builddir) -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
|
2002-08-15 18:31:18 -03:00
|
|
|
CPMAC=/Developer/Tools/CpMac
|
2001-09-05 19:09:50 -03:00
|
|
|
|
2002-08-01 18:14:06 -03:00
|
|
|
PYTHON=$(builddir)/python.exe
|
|
|
|
APPTEMPLATE=$(srcdir)/Mac/OSXResources/app
|
2001-09-06 13:33:57 -03:00
|
|
|
APPSUBDIRS=MacOS Resources Resources/English.lproj
|
2002-08-01 18:14:06 -03:00
|
|
|
RESOURCEDIR=$(srcdir)/Mac/Resources
|
2001-09-08 21:36:52 -03:00
|
|
|
RESOURCEFILE=python.rsrc
|
2002-08-01 18:14:06 -03:00
|
|
|
RFCONVERTER=$(srcdir)/Mac/Lib/applesingle.py
|
2002-08-09 11:15:46 -03:00
|
|
|
CACHERSRC=$(srcdir)/Mac/scripts/cachersrc.py
|
2002-07-31 11:46:04 -03:00
|
|
|
|
2002-08-08 21:18:21 -03:00
|
|
|
installapps: install_PythonLauncher install_Python install_BuildApplet install_IDE
|
2002-07-31 11:46:04 -03:00
|
|
|
|
|
|
|
install_PythonLauncher:
|
2002-08-01 18:14:06 -03:00
|
|
|
cd $(srcdir)/Mac/OSX/PythonLauncher/PythonLauncher.pbproj ; \
|
2002-08-08 21:18:21 -03:00
|
|
|
pbxbuild -target PythonLauncher -buildstyle Deployment DSTROOT=$(dstroot) install
|
2002-07-31 11:46:04 -03:00
|
|
|
|
2002-08-02 11:11:24 -03:00
|
|
|
install_Python: $(PYTHON)
|
2002-07-31 11:46:04 -03:00
|
|
|
@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-08-02 11:11:24 -03:00
|
|
|
$(INSTALL_PROGRAM) $(STRIPFLAG) $(PYTHON) $(APPINSTALLDIR)/Contents/MacOS/python
|
2002-08-15 18:31:18 -03:00
|
|
|
# Create a temporary version of the resources here
|
|
|
|
# Note that the resource files can either be real 2-fork resource files
|
|
|
|
# or AppleSingle encoded files.
|
|
|
|
@if test -s $(RESOURCEDIR)/dialogs.rsrc; then \
|
|
|
|
echo $(PYTHON) $(RFCONVERTER) -r $(RESOURCEDIR)/dialogs.rsrc dialogs.rsrc ;\
|
|
|
|
$(PYTHON) $(RFCONVERTER) -r $(RESOURCEDIR)/dialogs.rsrc dialogs.rsrc ; \
|
|
|
|
echo $(DEREZ) -useDF -skip ckid dialogs.rsrc > dialogs.r ; \
|
|
|
|
$(DEREZ) -useDF -skip ckid dialogs.rsrc > dialogs.r ; \
|
|
|
|
else \
|
|
|
|
echo $(DEREZ) -skip ckid $(RESOURCEDIR)/dialogs.rsrc > dialogs.r ; \
|
|
|
|
$(DEREZ) -skip ckid $(RESOURCEDIR)/dialogs.rsrc > dialogs.r ; \
|
|
|
|
fi
|
|
|
|
@if test -s $(RESOURCEDIR)/errors.rsrc; then \
|
|
|
|
echo $(PYTHON) $(RFCONVERTER) -r $(RESOURCEDIR)/errors.rsrc errors.rsrc ;\
|
|
|
|
$(PYTHON) $(RFCONVERTER) -r $(RESOURCEDIR)/errors.rsrc errors.rsrc ; \
|
|
|
|
echo $(DEREZ) -useDF -skip ckid errors.rsrc > errors.r ; \
|
|
|
|
$(DEREZ) -useDF -skip ckid errors.rsrc > errors.r ; \
|
|
|
|
else \
|
|
|
|
echo $(DEREZ) -skip ckid $(RESOURCEDIR)/errors.rsrc > errors.r ; \
|
|
|
|
$(DEREZ) -skip ckid $(RESOURCEDIR)/errors.rsrc > errors.r ; \
|
|
|
|
fi
|
2002-01-27 16:05:20 -04:00
|
|
|
$(REZ) -useDF -o $(RESOURCEFILE) dialogs.r errors.r
|
2001-09-08 21:36:52 -03:00
|
|
|
$(INSTALL_DATA) $(RESOURCEFILE) $(APPINSTALLDIR)/Contents/Resources/$(RESOURCEFILE)
|
2002-08-28 18:27:02 -03:00
|
|
|
# Finally create the documentation symlink
|
|
|
|
$(LN) -fsn ../../../../English.lproj/Documentation $(APPINSTALLDIR)/Contents/Resources/English.lproj/Documentation
|
|
|
|
|
2002-07-31 11:46:04 -03:00
|
|
|
|
|
|
|
install_IDE: $(INSTALLED_PYTHONW)
|
2002-08-30 12:14:02 -03:00
|
|
|
@if $(INSTALLED_PYTHONW) -c "import waste"; then : ; else \
|
2002-08-02 18:04:46 -03:00
|
|
|
echo PythonIDE needs the \"waste\" extension module; \
|
|
|
|
echo See Mac/OSX/README for details; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2002-08-01 18:14:06 -03:00
|
|
|
$(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \
|
2002-07-31 11:46:04 -03:00
|
|
|
--output $(PYTHONAPPSDIR)/PythonIDE.app --noargv \
|
2002-08-01 18:14:06 -03:00
|
|
|
$(srcdir)/Mac/Tools/IDE/PythonIDE.py
|
2001-09-06 13:33:57 -03:00
|
|
|
|
2002-08-02 12:32:12 -03:00
|
|
|
install_BuildApplet: $(INSTALLED_PYTHONW)
|
|
|
|
$(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \
|
|
|
|
--output $(PYTHONAPPSDIR)/BuildApplet.app \
|
|
|
|
$(srcdir)/Mac/scripts/BuildApplet.py
|
|
|
|
|
2002-08-09 11:15:46 -03:00
|
|
|
MACLIBDEST=$(prefix)/Mac/Lib
|
|
|
|
MACLIBSRC=$(srcdir)/Mac/Lib
|
|
|
|
MACLIBSUBDIRS= \
|
2002-05-23 19:18:13 -03:00
|
|
|
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-08-09 11:15:46 -03:00
|
|
|
MACTOOLSDEST=$(prefix)/Mac/Tools
|
|
|
|
MACTOOLSSRC=$(srcdir)/Mac/Tools
|
|
|
|
MACTOOLSSUBDIRS=IDE
|
|
|
|
installmacsubtree: $(INSTALLED_PYTHON)
|
|
|
|
@for i in $(MACLIBDEST) $(MACTOOLSDEST); \
|
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
|
2002-08-09 11:15:46 -03:00
|
|
|
@for d in $(MACLIBSUBDIRS); \
|
2001-09-06 13:33:57 -03:00
|
|
|
do \
|
2002-08-09 11:15:46 -03:00
|
|
|
a=$(MACLIBSRC)/$$d; \
|
2001-09-06 13:33:57 -03:00
|
|
|
if test ! -d $$a; then continue; else true; fi; \
|
2002-08-09 11:15:46 -03:00
|
|
|
b=$(MACLIBDEST)/$$d; \
|
2001-09-06 13:33:57 -03:00
|
|
|
if test ! -d $$b; then \
|
|
|
|
echo "Creating directory $$b"; \
|
|
|
|
$(INSTALL) -d -m $(DIRMODE) $$b; \
|
|
|
|
else true; \
|
|
|
|
fi; \
|
|
|
|
done
|
2002-08-15 18:31:18 -03:00
|
|
|
@for i in $(MACLIBSRC)/*.py; \
|
2001-09-06 13:33:57 -03:00
|
|
|
do \
|
|
|
|
if test -x $$i; then \
|
2002-08-09 11:15:46 -03:00
|
|
|
$(INSTALL_SCRIPT) $$i $(MACLIBDEST); \
|
|
|
|
echo $(INSTALL_SCRIPT) $$i $(MACLIBDEST); \
|
2001-09-06 13:33:57 -03:00
|
|
|
else \
|
2002-08-09 11:15:46 -03:00
|
|
|
$(INSTALL_DATA) $$i $(MACLIBDEST); \
|
|
|
|
echo $(INSTALL_DATA) $$i $(MACLIBDEST); \
|
2001-09-06 13:33:57 -03:00
|
|
|
fi; \
|
|
|
|
done
|
2002-08-15 18:31:18 -03:00
|
|
|
## @for i in $(MACLIBSRC)/*.rsrc; \
|
|
|
|
## do \
|
|
|
|
## echo $(CPMAC) $$i $$b ; \
|
|
|
|
## $(CPMAC) $$i $$b ; \
|
|
|
|
## done
|
2002-08-09 11:15:46 -03:00
|
|
|
@for d in $(MACLIBSUBDIRS); \
|
2001-09-06 13:33:57 -03:00
|
|
|
do \
|
2002-08-09 11:15:46 -03:00
|
|
|
a=$(MACLIBSRC)/$$d; \
|
2001-09-06 13:33:57 -03:00
|
|
|
if test ! -d $$a; then continue; else true; fi; \
|
2002-08-09 11:15:46 -03:00
|
|
|
b=$(MACLIBDEST)/$$d; \
|
2001-09-06 13:33:57 -03:00
|
|
|
for i in $$a/*; \
|
|
|
|
do \
|
|
|
|
case $$i in \
|
|
|
|
*CVS) ;; \
|
|
|
|
*.py[co]) ;; \
|
|
|
|
*.orig) ;; \
|
|
|
|
*~) ;; \
|
2002-08-15 18:31:18 -03:00
|
|
|
*.rsrc) \
|
|
|
|
echo $(CPMAC) $$i $$b ; \
|
|
|
|
$(CPMAC) $$i $$b ; \
|
|
|
|
;; \
|
2001-09-06 13:33:57 -03:00
|
|
|
*) \
|
|
|
|
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-08-09 11:15:46 -03:00
|
|
|
@for d in $(MACTOOLSSUBDIRS); \
|
2002-01-21 18:51:55 -04:00
|
|
|
do \
|
2002-08-09 11:15:46 -03:00
|
|
|
a=$(MACTOOLSSRC)/$$d; \
|
2002-01-21 18:51:55 -04:00
|
|
|
if test ! -d $$a; then continue; else true; fi; \
|
2002-08-09 11:15:46 -03:00
|
|
|
b=$(MACTOOLSDEST)/$$d; \
|
2002-01-21 18:51:55 -04:00
|
|
|
if test ! -d $$b; then \
|
|
|
|
echo "Creating directory $$b"; \
|
|
|
|
$(INSTALL) -d -m $(DIRMODE) $$b; \
|
|
|
|
else true; \
|
|
|
|
fi; \
|
|
|
|
done
|
2002-08-09 11:15:46 -03:00
|
|
|
@for d in $(MACTOOLSSUBDIRS); \
|
2002-01-21 18:51:55 -04:00
|
|
|
do \
|
2002-08-09 11:15:46 -03:00
|
|
|
a=$(MACTOOLSSRC)/$$d; \
|
2002-01-21 18:51:55 -04:00
|
|
|
if test ! -d $$a; then continue; else true; fi; \
|
2002-08-09 11:15:46 -03:00
|
|
|
b=$(MACTOOLSDEST)/$$d; \
|
2002-01-21 18:51:55 -04:00
|
|
|
for i in $$a/*; \
|
|
|
|
do \
|
|
|
|
case $$i in \
|
|
|
|
*CVS) ;; \
|
|
|
|
*.py[co]) ;; \
|
|
|
|
*.orig) ;; \
|
|
|
|
*~) ;; \
|
2002-08-15 18:31:18 -03:00
|
|
|
*.rsrc) \
|
|
|
|
echo $(CPMAC) $$i $$b ; \
|
|
|
|
$(CPMAC) $$i $$b ; \
|
|
|
|
;; \
|
2002-01-21 18:51:55 -04:00
|
|
|
*) \
|
|
|
|
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-08-09 11:15:46 -03:00
|
|
|
|
2002-08-08 21:18:21 -03:00
|
|
|
$(INSTALL_DATA) $(srcdir)/Mac/OSX/Mac.pth $(LIBDEST)/site-packages/
|
2002-08-09 11:15:46 -03:00
|
|
|
|
|
|
|
$(PYTHON) $(CACHERSRC) -v $(MACLIBDEST) $(MACTOOLSDEST)
|
|
|
|
$(INSTALLED_PYTHON) $(srcdir)/Lib/compileall.py $(MACLIBDEST) $(MACTOOLSDEST)
|
|
|
|
$(INSTALLED_PYTHON) -O $(srcdir)/Lib/compileall.py $(MACLIBDEST) $(MACTOOLSDEST)
|
|
|
|
|
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
|
2002-08-08 21:18:21 -03:00
|
|
|
|
2002-07-31 11:46:04 -03:00
|
|
|
# $(INSTALLED_PYTHON) has to be done by the main Makefile, we cannot do that here.
|
2002-08-08 21:18:21 -03:00
|
|
|
# At least this rule will give an error if it doesn't exist.
|
2002-07-31 11:46:04 -03:00
|
|
|
|
2002-08-08 21:18:21 -03:00
|
|
|
installunixtools: $(INSTALLED_PYTHON) $(INSTALLED_PYTHONW) $(srcdir)/Mac/OSX/pythonw.sh
|
|
|
|
$(INSTALL) -d $(bindir)
|
|
|
|
$(INSTALL_SYMLINK) $(INSTALLED_PYTHON) $(bindir)/python
|
|
|
|
$(INSTALL) $(srcdir)/Mac/OSX/pythonw.sh $(bindir)/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:
|
2002-08-01 18:14:06 -03:00
|
|
|
l=`cd $(srcdir)/Mac/Lib; pwd`; \
|
2002-08-09 11:15:46 -03:00
|
|
|
echo $$l > $(MACLIBDEST)/site-packages/Mac.pth ; \
|
|
|
|
echo $$l/lib-scriptpackages >> $(MACLIBDEST)/site-packages/Mac.pth
|