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
|
|
|
dstroot=/.
|
2002-09-02 09:16:00 -03:00
|
|
|
prefix=$(dstroot)/Library/Frameworks/Python.framework/Versions/$(VERSION)
|
|
|
|
LIBDEST=$(prefix)/lib/python$(VERSION)
|
2003-02-25 08:41:10 -04:00
|
|
|
BUILDPYTHON=$(builddir)/python.exe
|
2002-08-08 21:18:21 -03:00
|
|
|
|
|
|
|
# These are normally glimpsed from the previous set
|
|
|
|
bindir=$(dstroot)/usr/local/bin
|
2002-12-25 18:31:28 -04:00
|
|
|
PYTHONAPPSPATH=/Applications/MacPython-$(VERSION)
|
2002-11-20 10:06:16 -04:00
|
|
|
PYTHONAPPSDIR=$(dstroot)$(PYTHONAPPSPATH)
|
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
|
2003-05-09 12:08:39 -03:00
|
|
|
FILEMODE=644
|
2001-09-06 13:33:57 -03:00
|
|
|
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}
|
2003-05-09 12:08:39 -03:00
|
|
|
INSTALL_DATA= ${INSTALL} -m ${FILEMODE}
|
2002-08-28 18:27:02 -03:00
|
|
|
LN=ln
|
2002-03-29 10:18:18 -04:00
|
|
|
STRIPFLAG=-s
|
2002-11-10 20:05:00 -04:00
|
|
|
##OPT=-g -O3 -Wall -Wstrict-prototypes -Wno-long-double -no-cpp-precomp \
|
|
|
|
## -fno-common -dynamic
|
|
|
|
##INCLUDES=-I$(builddir) -I$(srcdir)/Include -I$(srcdir)/Mac/Include
|
|
|
|
##DEFINES=
|
|
|
|
##
|
|
|
|
##CFLAGS=$(OPT) $(DEFINES) $(INCLUDES)
|
|
|
|
##LDFLAGS=-F$(builddir) -framework System -framework Python -framework Carbon \
|
|
|
|
## -framework Foundation
|
|
|
|
##CC=cc
|
|
|
|
##LD=cc
|
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
|
|
|
APPTEMPLATE=$(srcdir)/Mac/OSXResources/app
|
2003-03-11 19:07:08 -04:00
|
|
|
APPSUBDIRS=MacOS Resources Resources/English.lproj \
|
|
|
|
Resources/English.lproj/Documentation \
|
|
|
|
Resources/English.lproj/Documentation/doc \
|
|
|
|
Resources/English.lproj/Documentation/macpython_ide_tutorial
|
|
|
|
DOCDIR=$(srcdir)/Mac/OSXResources/app/Resources/English.lproj/Documentation
|
|
|
|
DOCINDEX=$(DOCDIR)/"Documentation idx"
|
2002-08-09 11:15:46 -03:00
|
|
|
CACHERSRC=$(srcdir)/Mac/scripts/cachersrc.py
|
2002-11-10 20:05:00 -04:00
|
|
|
compileall=$(srcdir)/Lib/compileall.py
|
2003-02-12 11:42:49 -04:00
|
|
|
bundlebuilder=$(srcdir)/Lib/plat-mac/bundlebuilder.py
|
2002-07-31 11:46:04 -03:00
|
|
|
|
2003-02-18 19:33:39 -04:00
|
|
|
installapps: install_PythonLauncher install_Python install_BuildApplet install_IDE \
|
|
|
|
install_IDLE install_PackageManager
|
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-11-20 10:06:16 -04:00
|
|
|
pbxbuild -target PythonLauncher -buildstyle Deployment \
|
|
|
|
DSTROOT=$(dstroot) INSTALL_PATH=$(PYTHONAPPSPATH) install
|
2002-07-31 11:46:04 -03:00
|
|
|
|
2003-02-25 08:41:10 -04:00
|
|
|
install_Python:
|
2003-03-11 19:07:08 -04:00
|
|
|
@if test ! -f $(DOCINDEX); then \
|
|
|
|
echo WARNING: you should run Apple Help Indexing Tool on $(DOCDIR); \
|
|
|
|
fi
|
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) ;; \
|
|
|
|
*~) ;; \
|
2003-03-11 19:07:08 -04:00
|
|
|
*idx) \
|
|
|
|
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
|
2003-03-11 19:07:08 -04:00
|
|
|
$(INSTALL_PROGRAM) $(STRIPFLAG) $(BUILDPYTHON) $(APPINSTALLDIR)/Contents/MacOS/python
|
2002-07-31 11:46:04 -03:00
|
|
|
|
|
|
|
install_IDE: $(INSTALLED_PYTHONW)
|
2002-11-10 20:05:00 -04:00
|
|
|
@if ! $(INSTALLED_PYTHONW) -c "import waste"; then \
|
2002-08-02 18:04:46 -03:00
|
|
|
echo PythonIDE needs the \"waste\" extension module; \
|
|
|
|
echo See Mac/OSX/README for details; \
|
2002-11-10 20:05:00 -04:00
|
|
|
else \
|
2003-02-18 19:33:39 -04:00
|
|
|
echo $(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \
|
|
|
|
--output $(PYTHONAPPSDIR)/PythonIDE.app --noargv \
|
|
|
|
$(srcdir)/Mac/Tools/IDE/PythonIDE.py ; \
|
|
|
|
$(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \
|
|
|
|
--output $(PYTHONAPPSDIR)/PythonIDE.app --noargv \
|
|
|
|
$(srcdir)/Mac/Tools/IDE/PythonIDE.py; \
|
2003-02-12 11:42:49 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
install_PackageManager: $(INSTALLED_PYTHONW)
|
|
|
|
@if ! $(INSTALLED_PYTHONW) -c "import waste"; then \
|
|
|
|
echo PackageManager needs the \"waste\" extension module; \
|
|
|
|
echo See Mac/OSX/README for details; \
|
|
|
|
else \
|
|
|
|
echo $(INSTALLED_PYTHONW) $(bundlebuilder) \
|
|
|
|
--builddir $(PYTHONAPPSDIR)/ \
|
|
|
|
--resource $(srcdir)/Mac/Tools/IDE/PythonIDE.rsrc \
|
|
|
|
--mainprogram $(srcdir)/Mac/Tools/IDE/PackageManager.py \
|
|
|
|
--iconfile $(srcdir)/Mac/Tools/IDE/PackageManager.icns \
|
|
|
|
--creator Pimp build; \
|
|
|
|
$(INSTALLED_PYTHONW) $(bundlebuilder) \
|
|
|
|
--builddir $(PYTHONAPPSDIR)/ \
|
|
|
|
--resource $(srcdir)/Mac/Tools/IDE/PythonIDE.rsrc \
|
|
|
|
--mainprogram $(srcdir)/Mac/Tools/IDE/PackageManager.py \
|
|
|
|
--iconfile $(srcdir)/Mac/Tools/IDE/PackageManager.icns \
|
|
|
|
--creator Pimp build; \
|
2002-08-02 18:04:46 -03:00
|
|
|
fi
|
2002-09-12 19:19:23 -03:00
|
|
|
|
|
|
|
install_IDLE: $(INSTALLED_PYTHONW)
|
|
|
|
@if ! $(INSTALLED_PYTHONW) -c "import _tkinter"; then \
|
|
|
|
echo IDLE needs the \"Tkinter\" extension module; \
|
|
|
|
echo See Mac/OSX/README for details; \
|
|
|
|
else \
|
|
|
|
echo $(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \
|
|
|
|
--output $(PYTHONAPPSDIR)/IDLE.app \
|
|
|
|
--extra $(srcdir)/Tools/idle \
|
|
|
|
$(srcdir)/Tools/idle/idle ; \
|
|
|
|
$(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \
|
|
|
|
--output $(PYTHONAPPSDIR)/IDLE.app \
|
2003-02-24 12:30:24 -04:00
|
|
|
--extra $(srcdir)/Tools/idle:Contents/Resources/idlelib \
|
2002-09-12 19:19:23 -03:00
|
|
|
$(srcdir)/Tools/idle/idle ; \
|
|
|
|
fi
|
|
|
|
|
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-12-30 18:23:40 -04:00
|
|
|
MACLIBDEST=$(LIBDEST)/plat-mac
|
2002-08-09 11:15:46 -03:00
|
|
|
MACTOOLSDEST=$(prefix)/Mac/Tools
|
|
|
|
MACTOOLSSRC=$(srcdir)/Mac/Tools
|
|
|
|
MACTOOLSSUBDIRS=IDE
|
2002-09-02 09:29:11 -03:00
|
|
|
installmacsubtree:
|
2002-12-30 18:23:40 -04:00
|
|
|
@for i in $(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 $(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
|
|
|
|
|
|
|
|
2003-02-25 08:41:10 -04:00
|
|
|
$(BUILDPYTHON) $(CACHERSRC) -v $(MACLIBDEST) $(MACTOOLSDEST)
|
|
|
|
$(BUILDPYTHON) -Wi -tt $(compileall) -x badsyntax $(MACTOOLSDEST)
|
|
|
|
$(BUILDPYTHON) -O -Wi -tt $(compileall) -x badsyntax $(MACTOOLSDEST)
|
2002-08-09 11:15:46 -03:00
|
|
|
|
2002-11-10 20:05:00 -04:00
|
|
|
#
|
|
|
|
# We use the full name here in stead of $(INSTALLED_PYTHONW), because
|
|
|
|
# the latter may be overridden by Makefile.jaguar when building for a pre-installed
|
|
|
|
# /usr/bin/python
|
|
|
|
$(APPINSTALLDIR)/Contents/MacOS/python: 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-09-02 09:29:11 -03:00
|
|
|
installunixtools: $(INSTALLED_PYTHON) $(INSTALLED_PYTHONW)
|
2002-08-08 21:18:21 -03:00
|
|
|
$(INSTALL) -d $(bindir)
|
2003-01-28 17:45:44 -04:00
|
|
|
$(INSTALL_SYMLINK) $(INSTALLED_PYTHON) $(bindir)/python$(VERSION)
|
|
|
|
$(INSTALL_SYMLINK) python$(VERSION) $(bindir)/python
|
2002-09-02 09:29:11 -03:00
|
|
|
echo "#!/bin/sh" > pythonw.sh
|
|
|
|
echo "exec \"$(INSTALLED_PYTHONW)\" \"\$$@\"" >> pythonw.sh
|
2003-01-28 17:45:44 -04:00
|
|
|
$(INSTALL) pythonw.sh $(bindir)/pythonw$(VERSION)
|
|
|
|
$(INSTALL_SYMLINK) pythonw$(VERSION) $(bindir)/pythonw
|