• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1prefix=@prefix@
2CC=@CC@
3LD=@CC@
4BASECFLAGS=@BASECFLAGS@
5OPT=@OPT@
6CFLAGS=$(BASECFLAGS) $(OPT)
7LDFLAGS=@LDFLAGS@
8srcdir=         @srcdir@
9VERSION=	@VERSION@
10LIBDEST=$(prefix)/lib/python$(VERSION)
11UNIVERSALSDK=@UNIVERSALSDK@
12builddir=	../..
13PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
14LIPO_32BIT_FLAGS=@LIPO_32BIT_FLAGS@
15
16
17RUNSHARED=      @RUNSHARED@
18BUILDEXE=       @BUILDEXEEXT@
19BUILDPYTHON=    $(builddir)/python$(BUILDEXE)
20
21# Deployment target selected during configure, to be checked
22# by distutils
23MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
24@EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
25
26BUNDLEBULDER=$(srcdir)/../../Lib/plat-mac/bundlebuilder.py
27
28PYTHONAPPSDIR=@FRAMEWORKINSTALLAPPSPREFIX@/$(PYTHONFRAMEWORK) $(VERSION)
29
30all: IDLE.app
31
32install: IDLE.app
33	test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)"
34	-test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app"
35	/bin/cp -PR IDLE.app "$(DESTDIR)$(PYTHONAPPSDIR)"
36	touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app"
37	if [ -f "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" ]; then \
38		/bin/cp -p "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" \
39			"$(DESTDIR)$(LIBDEST)/idlelib/config-main.def~" ; \
40		sed -e 's!name= IDLE Classic Windows!name= IDLE Classic OSX!g' \
41			< "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def~" \
42			> "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def" ; \
43		rm "$(DESTDIR)$(LIBDEST)/idlelib/config-main.def~" ; \
44	fi
45	if [ -f "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def" ]; then \
46		/bin/cp -p "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def" \
47			"$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def~" ; \
48		sed -e 's!zoom-height=<Alt-Key-2>!zoom-height=<Option-Key-0>!g' \
49			-e 's!<Alt-Key-!<Option-Key-!g' \
50			< "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def~" \
51			> "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def" ; \
52		rm "$(DESTDIR)$(LIBDEST)/idlelib/config-extensions.def~" ; \
53	fi
54
55clean:
56	rm -rf IDLE.app
57
58IDLE.app:  \
59		$(srcdir)/../Icons/IDLE.icns $(srcdir)/idlemain.py \
60		$(srcdir)/../Icons/PythonSource.icns \
61		$(srcdir)/../Icons/PythonCompiled.icns Info.plist
62	rm -fr IDLE.app
63	$(RUNSHARED) @ARCH_RUN_32BIT@ $(BUILDPYTHON) $(BUNDLEBULDER) \
64		--builddir=. \
65		--name=IDLE \
66		--link-exec \
67		--plist=Info.plist \
68		--mainprogram=$(srcdir)/idlemain.py \
69		--iconfile=$(srcdir)/../Icons/IDLE.icns \
70		--resource=$(srcdir)/../Icons/PythonSource.icns \
71		--resource=$(srcdir)/../Icons/PythonCompiled.icns \
72		--python=$(prefix)/Resources/Python.app/Contents/MacOS/Python \
73		build
74ifneq ($(LIPO_32BIT_FLAGS),)
75	rm "IDLE.app/Contents/MacOS/Python"
76	lipo $(LIPO_32BIT_FLAGS) -output "IDLE.app/Contents/MacOS/Python" "$(BUILDPYTHON)"
77endif
78
79Info.plist: $(srcdir)/Info.plist.in
80	sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(srcdir)/Info.plist.in > Info.plist
81
82