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.
|
|
|
|
|
2003-11-19 09:33:19 -04:00
|
|
|
VERSION=2.4
|
2002-08-01 18:14:06 -03:00
|
|
|
builddir = ../..
|
|
|
|
srcdir = ../..
|
2003-05-25 19:01:32 -03:00
|
|
|
prefix=/Library/Frameworks/Python.framework/Versions/$(VERSION)
|
2002-09-02 09:16:00 -03:00
|
|
|
LIBDEST=$(prefix)/lib/python$(VERSION)
|
2003-02-25 08:41:10 -04:00
|
|
|
BUILDPYTHON=$(builddir)/python.exe
|
2003-05-25 19:01:32 -03:00
|
|
|
DESTDIR=
|
2003-11-19 09:56:40 -04:00
|
|
|
# For 10.2:
|
|
|
|
#PBXBUILD=pbxbuild
|
|
|
|
# For 10.3:
|
|
|
|
PBXBUILD=xcodebuild
|
2002-08-08 21:18:21 -03:00
|
|
|
|
|
|
|
# These are normally glimpsed from the previous set
|
2003-05-25 19:01:32 -03:00
|
|
|
bindir=/usr/local/bin
|
2002-12-25 18:31:28 -04:00
|
|
|
PYTHONAPPSPATH=/Applications/MacPython-$(VERSION)
|
2003-05-25 19:01:32 -03:00
|
|
|
PYTHONAPPSDIR=$(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
|
2003-07-23 07:49:17 -03:00
|
|
|
INSTALLED_PYTHONW=$(APPINSTALLDIR)/Contents/MacOS/Python
|
2002-03-29 10:18:18 -04:00
|
|
|
|
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
|
2003-06-16 06:47:25 -03:00
|
|
|
INSTALL_SYMLINK=ln -fsn
|
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 \
|
2003-07-02 06:20:09 -03:00
|
|
|
Resources/English.lproj/Documentation/ide
|
2003-03-11 19:07:08 -04:00
|
|
|
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 ; \
|
2003-11-19 09:56:40 -04:00
|
|
|
$(PBXBUILD) -target PythonLauncher -buildstyle Deployment install \
|
2003-06-20 11:33:38 -03:00
|
|
|
DSTROOT=$(DESTDIR)/ INSTALL_PATH=$(PYTHONAPPSPATH)
|
2003-07-07 14:38:26 -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 \
|
2003-05-25 19:01:32 -03:00
|
|
|
if test ! -d $(DESTDIR)$$i; then \
|
|
|
|
echo "Creating directory $(DESTDIR)$$i"; \
|
|
|
|
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
|
2001-09-06 13:33:57 -03:00
|
|
|
fi;\
|
|
|
|
done
|
|
|
|
@for i in $(APPSUBDIRS); do \
|
2003-05-25 19:01:32 -03:00
|
|
|
if test ! -d $(DESTDIR)$(APPINSTALLDIR)/Contents/$$i; then \
|
|
|
|
echo "Creating directory $(DESTDIR)$(APPINSTALLDIR)/Contents/$$i"; \
|
|
|
|
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(APPINSTALLDIR)/Contents/$$i; \
|
2001-09-06 13:33:57 -03:00
|
|
|
else true; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
@for d in . $(APPSUBDIRS); \
|
|
|
|
do \
|
|
|
|
a=$(APPTEMPLATE)/$$d; \
|
|
|
|
if test ! -d $$a; then continue; else true; fi; \
|
2003-05-25 19:01:32 -03:00
|
|
|
b=$(DESTDIR)$(APPINSTALLDIR)/Contents/$$d; \
|
2001-09-06 13:33:57 -03:00
|
|
|
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-07-07 14:38:26 -03:00
|
|
|
$(INSTALL_PROGRAM) $(STRIPFLAG) $(BUILDPYTHON) $(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/Python
|
|
|
|
|
2003-05-25 19:01:32 -03:00
|
|
|
install_IDE:
|
|
|
|
@if ! $(BUILDPYTHON) -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-05-25 19:01:32 -03:00
|
|
|
echo $(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \
|
|
|
|
--python $(INSTALLED_PYTHONW) \
|
|
|
|
--output $(DESTDIR)$(PYTHONAPPSDIR)/PythonIDE.app --noargv \
|
2003-02-18 19:33:39 -04:00
|
|
|
$(srcdir)/Mac/Tools/IDE/PythonIDE.py ; \
|
2003-05-25 19:01:32 -03:00
|
|
|
$(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \
|
|
|
|
--python $(INSTALLED_PYTHONW) \
|
|
|
|
--output $(DESTDIR)$(PYTHONAPPSDIR)/PythonIDE.app --noargv \
|
2003-02-18 19:33:39 -04:00
|
|
|
$(srcdir)/Mac/Tools/IDE/PythonIDE.py; \
|
2003-02-12 11:42:49 -04:00
|
|
|
fi
|
|
|
|
|
2003-05-25 19:01:32 -03:00
|
|
|
install_PackageManager:
|
|
|
|
@if ! $(BUILDPYTHON) -c "import waste"; then \
|
2003-02-12 11:42:49 -04:00
|
|
|
echo PackageManager needs the \"waste\" extension module; \
|
|
|
|
echo See Mac/OSX/README for details; \
|
|
|
|
else \
|
2003-05-25 19:01:32 -03:00
|
|
|
echo $(BUILDPYTHON) $(bundlebuilder) \
|
|
|
|
--builddir $(DESTDIR)$(PYTHONAPPSDIR)/ \
|
|
|
|
--python $(INSTALLED_PYTHONW) \
|
2003-02-12 11:42:49 -04:00
|
|
|
--resource $(srcdir)/Mac/Tools/IDE/PythonIDE.rsrc \
|
|
|
|
--mainprogram $(srcdir)/Mac/Tools/IDE/PackageManager.py \
|
|
|
|
--iconfile $(srcdir)/Mac/Tools/IDE/PackageManager.icns \
|
|
|
|
--creator Pimp build; \
|
2003-05-25 19:01:32 -03:00
|
|
|
$(BUILDPYTHON) $(bundlebuilder) \
|
|
|
|
--builddir $(DESTDIR)$(PYTHONAPPSDIR)/ \
|
|
|
|
--python $(INSTALLED_PYTHONW) \
|
2003-02-12 11:42:49 -04:00
|
|
|
--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
|
|
|
|
2003-05-25 19:01:32 -03:00
|
|
|
install_IDLE:
|
|
|
|
@if ! $(BUILDPYTHON) -c "import _tkinter"; then \
|
2002-09-12 19:19:23 -03:00
|
|
|
echo IDLE needs the \"Tkinter\" extension module; \
|
|
|
|
echo See Mac/OSX/README for details; \
|
|
|
|
else \
|
2003-05-25 19:01:32 -03:00
|
|
|
echo $(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \
|
|
|
|
--python $(INSTALLED_PYTHONW) \
|
|
|
|
--output $(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app \
|
2003-06-16 06:47:25 -03:00
|
|
|
--extra $(srcdir)/Lib/idlelib \
|
|
|
|
$(srcdir)/Lib/idlelib/idle ; \
|
2003-05-25 19:01:32 -03:00
|
|
|
$(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \
|
|
|
|
--python $(INSTALLED_PYTHONW) \
|
|
|
|
--output $(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app \
|
2003-06-16 06:47:25 -03:00
|
|
|
--extra $(srcdir)/Lib/idlelib:Contents/Resources/idlelib \
|
|
|
|
$(srcdir)/Lib/idlelib/idle ; \
|
2002-09-12 19:19:23 -03:00
|
|
|
fi
|
|
|
|
|
2003-07-07 14:38:26 -03:00
|
|
|
|
2003-05-25 19:01:32 -03:00
|
|
|
install_BuildApplet:
|
|
|
|
$(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \
|
|
|
|
--python $(INSTALLED_PYTHONW) \
|
|
|
|
--output $(DESTDIR)$(PYTHONAPPSDIR)/BuildApplet.app \
|
2002-08-02 12:32:12 -03:00
|
|
|
$(srcdir)/Mac/scripts/BuildApplet.py
|
2003-07-07 14:38:26 -03:00
|
|
|
|
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 \
|
2003-05-25 19:01:32 -03:00
|
|
|
if test ! -d $(DESTDIR)$$i; then \
|
|
|
|
echo "Creating directory $(DESTDIR)$$i"; \
|
|
|
|
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
|
2001-09-06 13:33:57 -03:00
|
|
|
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; \
|
2003-05-25 19:01:32 -03:00
|
|
|
b=$(DESTDIR)$(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; \
|
2003-05-25 19:01:32 -03:00
|
|
|
b=$(DESTDIR)$(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
|
2003-07-07 14:38:26 -03:00
|
|
|
|
2002-08-09 11:15:46 -03:00
|
|
|
|
2003-05-25 19:01:32 -03:00
|
|
|
$(BUILDPYTHON) $(CACHERSRC) -v $(DESTDIR)$(MACLIBDEST) $(DESTDIR)$(MACTOOLSDEST)
|
2003-06-21 19:07:16 -03:00
|
|
|
$(BUILDPYTHON) -Wi -tt $(compileall) -d $(MACTOOLSDEST) -x badsyntax $(DESTDIR)$(MACTOOLSDEST)
|
|
|
|
$(BUILDPYTHON) -O -Wi -tt $(compileall) -d $(MACTOOLSDEST) -x badsyntax $(DESTDIR)$(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
|
2003-07-23 07:49:17 -03:00
|
|
|
$(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
|
|
|
|
2003-05-25 19:01:32 -03:00
|
|
|
installunixtools:
|
|
|
|
$(INSTALL) -d $(DESTDIR)$(bindir)
|
|
|
|
$(INSTALL_SYMLINK) $(INSTALLED_PYTHON) $(DESTDIR)$(bindir)/python$(VERSION)
|
|
|
|
$(INSTALL_SYMLINK) python$(VERSION) $(DESTDIR)$(bindir)/python
|
2002-09-02 09:29:11 -03:00
|
|
|
echo "#!/bin/sh" > pythonw.sh
|
|
|
|
echo "exec \"$(INSTALLED_PYTHONW)\" \"\$$@\"" >> pythonw.sh
|
2003-05-25 19:01:32 -03:00
|
|
|
$(INSTALL) pythonw.sh $(DESTDIR)$(bindir)/pythonw$(VERSION)
|
|
|
|
$(INSTALL_SYMLINK) pythonw$(VERSION) $(DESTDIR)$(bindir)/pythonw
|
2003-07-07 14:38:26 -03:00
|
|
|
|
2003-06-19 19:35:20 -03:00
|
|
|
installextras:
|
|
|
|
$(INSTALL) -d $(DESTDIR)$(PYTHONAPPSDIR)/Extras
|
|
|
|
$(INSTALL) $(srcdir)/Mac/OSX/Extras.ReadMe.txt $(DESTDIR)$(PYTHONAPPSDIR)/Extras/ReadMe
|
|
|
|
$(BUILDPYTHON) $(srcdir)/Mac/OSX/Extras.install.py $(srcdir)/Demo \
|
|
|
|
$(DESTDIR)$(PYTHONAPPSDIR)/Extras/Demo
|
|
|
|
$(BUILDPYTHON) $(srcdir)/Mac/OSX/Extras.install.py $(srcdir)/Tools \
|
2003-07-04 09:05:25 -03:00
|
|
|
$(DESTDIR)$(PYTHONAPPSDIR)/Extras/Tools
|