1 # Top-level Makefile for Python
3 # As distributed, this file is called Makefile.pre.in; it is processed
4 # into the real Makefile by running the script ./configure, which
5 # replaces things like @spam@ with values appropriate for your system.
6 # This means that if you edit Makefile, your changes get lost the next
7 # time you run the configure script. Ideally, you can do:
14 # If you have a previous version of Python installed that you don't
15 # want to overwrite, you can use "make altinstall" instead of "make
16 # install". Refer to the "Installing" section in the README file for
19 # See also the section "Build instructions" in the README file.
21 # === Variables set by makesetup ===
26 # === Variables set by configure
37 # Shell used by make (some versions default to the login shell, which is bad)
40 # Use this to make a link between python$(VERSION) and python in $(BINDIR)
43 # Portable install script (configure doesn't always guess right)
45 INSTALL_PROGRAM=@INSTALL_PROGRAM@
46 INSTALL_SCRIPT= @INSTALL_SCRIPT@
47 INSTALL_DATA= @INSTALL_DATA@
48 # Shared libraries must be installed with executable mode on some systems;
49 # rather than figuring out exactly which, we always give them executable mode.
50 # Also, making them read-only seems to be a good idea...
51 INSTALL_SHARED= ${INSTALL} -m 555
53 MAKESETUP= $(srcdir)/Modules/makesetup
59 CPPFLAGS= -I. -I$(srcdir)/Include $(DEFS)
64 LINKFORSHARED= @LINKFORSHARED@
65 # Extra C flags added for building the interpreter object files.
66 CFLAGSFORSHARED=@CFLAGSFORSHARED@
67 # C flags used for building the interpreter object files
68 PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
71 # Machine-dependent subdirectories
74 # Install prefix for architecture-independent files
77 # Install prefix for architecture-dependent files
78 exec_prefix= @exec_prefix@
80 # Expanded directories
81 BINDIR= $(exec_prefix)/bin
82 LIBDIR= $(exec_prefix)/lib
84 INCLUDEDIR= @includedir@
85 CONFINCLUDEDIR= $(exec_prefix)/include
86 SCRIPTDIR= $(prefix)/lib
88 # Detailed destination directories
89 BINLIBDEST= $(LIBDIR)/python$(VERSION)
90 LIBDEST= $(SCRIPTDIR)/python$(VERSION)
91 INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
92 CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
93 LIBP= $(LIBDIR)/python$(VERSION)
95 # Symbols used for using shared libraries
98 BLDSHARED= @BLDSHARED@
99 DESTSHARED= $(BINLIBDEST)/lib-dynload
101 # Executable suffix (.exe on Windows and Mac OS X)
103 BUILDEXE= @BUILDEXEEXT@
105 # Short name and location for Mac OS X Python framework
106 PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
107 PYTHONFRAMEWORKDIR= @PYTHONFRAMEWORKDIR@
108 PYTHONFRAMEWORKPREFIX= @PYTHONFRAMEWORKPREFIX@
109 PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
111 # Environment to run shared python without installed libraries
112 RUNSHARED= @RUNSHARED@
114 # Modes for directories, executables and data files created by the
115 # install process. Default to user-only-writable for all file types.
120 # configure script arguments
121 CONFIG_ARGS= @CONFIG_ARGS@
124 # Subdirectories with code
127 # Other subdirectories
128 SUBDIRSTOO= Include Lib Misc Demo
130 # Files and directories to be distributed
131 CONFIGFILES= configure configure.in acconfig.h pyconfig.h.in Makefile.pre.in
132 DISTFILES= README ChangeLog $(CONFIGFILES)
133 DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
134 DIST= $(DISTFILES) $(DISTDIRS)
138 LDLIBRARY= @LDLIBRARY@
139 BLDLIBRARY= @BLDLIBRARY@
140 DLLLIBRARY= @DLLLIBRARY@
141 LDLIBRARYDIR= @LDLIBRARYDIR@
142 INSTSONAME= @INSTSONAME@
148 SYSLIBS= $(LIBM) $(LIBC)
152 THREADOBJ= @THREADOBJ@
153 DLINCLDIR= @DLINCLDIR@
154 DYNLOADFILE= @DYNLOADFILE@
155 MACHDEP_OBJS= @MACHDEP_OBJS@
156 UNICODE_OBJS= @UNICODE_OBJS@
159 BUILDPYTHON= python$(BUILDEXE)
161 # === Definitions added by makesetup ===
164 ##########################################################################
172 # Used of signalmodule.o is not available
173 SIGNAL_OBJS= @SIGNAL_OBJS@
176 ##########################################################################
178 GRAMMAR_H= $(srcdir)/Include/graminit.h
179 GRAMMAR_C= $(srcdir)/Python/graminit.c
180 GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
183 ##########################################################################
185 PGEN= Parser/pgen$(EXE)
198 PARSER_OBJS= $(POBJS) Parser/myreadline.o
202 Python/mysnprintf.o \
206 Parser/printgrammar.o \
209 PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS)
212 ##########################################################################
215 Python/bltinmodule.o \
216 Python/exceptions.o \
222 Python/frozenmain.o \
225 Python/getcompiler.o \
226 Python/getcopyright.o \
228 Python/getplatform.o \
229 Python/getversion.o \
234 Python/modsupport.o \
236 Python/mysnprintf.o \
240 Python/structmember.o \
245 Python/$(DYNLOADFILE) \
250 ##########################################################################
254 Objects/boolobject.o \
255 Objects/bufferobject.o \
256 Objects/cellobject.o \
257 Objects/classobject.o \
259 Objects/complexobject.o \
260 Objects/descrobject.o \
261 Objects/enumobject.o \
262 Objects/fileobject.o \
263 Objects/floatobject.o \
264 Objects/frameobject.o \
265 Objects/funcobject.o \
266 Objects/intobject.o \
267 Objects/iterobject.o \
268 Objects/listobject.o \
269 Objects/longobject.o \
270 Objects/dictobject.o \
271 Objects/methodobject.o \
272 Objects/moduleobject.o \
275 Objects/rangeobject.o \
276 Objects/sliceobject.o \
277 Objects/stringobject.o \
278 Objects/structseq.o \
279 Objects/tupleobject.o \
280 Objects/typeobject.o \
281 Objects/weakrefobject.o \
285 ##########################################################################
286 # objects that get linked into the Python library
288 Modules/getbuildinfo.o \
296 #########################################################################
300 all: $(BUILDPYTHON) oldsharedmods sharedmods
302 # Build the interpreter
303 $(BUILDPYTHON): Modules/$(MAINOBJ) $(LIBRARY) $(LDLIBRARY)
304 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
306 $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
308 platform: $(BUILDPYTHON)
309 $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
312 # Build the shared modules
313 sharedmods: $(BUILDPYTHON)
314 case $$MAKEFLAGS in \
315 *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
316 *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
319 # buildno should really depend on something like LIBRARY_SRC
320 buildno: $(PARSER_OBJS) \
326 $(srcdir)/Modules/getbuildinfo.c
327 if test -f buildno; then \
328 expr `cat buildno` + 1 >buildno1; \
329 mv -f buildno1 buildno; \
330 else echo 1 >buildno; fi
332 # Build static library
333 # avoid long command lines, same as LIBRARY_OBJS
334 $(LIBRARY): $(LIBRARY_OBJS)
336 $(AR) cr $@ Modules/getbuildinfo.o
337 $(AR) cr $@ $(PARSER_OBJS)
338 $(AR) cr $@ $(OBJECT_OBJS)
339 $(AR) cr $@ $(PYTHON_OBJS)
340 $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
341 $(AR) cr $@ $(MODOBJS)
344 libpython$(VERSION).so: $(LIBRARY_OBJS)
345 $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM)
347 libpython$(VERSION).sl: $(LIBRARY_OBJS)
348 $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(LIBC) $(LIBM)
350 # This rule is here for OPENSTEP/Rhapsody/MacOSX
351 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): $(LIBRARY) $(PYTHONFRAMEWORKDIR)
352 $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
353 libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \
354 -framework System @LIBTOOL_CRUFT@
356 # This rule builds the Cygwin Python DLL
357 libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
358 $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
359 $(LIBS) $(MODLIBS) $(SYSLIBS)
362 oldsharedmods: $(SHAREDMODS)
365 Makefile Modules/config.c: Makefile.pre \
366 $(srcdir)/Modules/config.c.in \
368 Modules/Setup.config \
371 $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
373 Modules/Setup.config \
374 Modules/Setup.local \
377 @echo "The Makefile was updated, you may need to re-run make."
380 Modules/Setup: $(srcdir)/Modules/Setup.dist
381 @if test -f Modules/Setup; then \
382 echo "-----------------------------------------------"; \
383 echo "Modules/Setup.dist is newer than Modules/Setup;"; \
384 echo "check to make sure you have all the updates you"; \
385 echo "need in your Modules/Setup file."; \
386 echo "Usually, copying Setup.dist to Setup will work."; \
387 echo "-----------------------------------------------"; \
390 ############################################################################
391 # Special rules for object files
393 Modules/getbuildinfo.o: $(srcdir)/Modules/getbuildinfo.c buildno
394 $(CC) -c $(PY_CFLAGS) -DBUILD=`cat buildno` -o $@ $(srcdir)/Modules/getbuildinfo.c
396 Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
397 $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
398 -DPREFIX='"$(prefix)"' \
399 -DEXEC_PREFIX='"$(exec_prefix)"' \
400 -DVERSION='"$(VERSION)"' \
401 -DVPATH='"$(VPATH)"' \
402 -o $@ $(srcdir)/Modules/getpath.c
404 Modules/ccpython.o: $(srcdir)/Modules/ccpython.cc
405 $(CXX) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/ccpython.cc
408 $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
409 -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
412 $(CC) $(OPT) $(PGENOBJS) $(LIBS) -o $(PGEN)
414 Parser/grammar.o: $(srcdir)/Parser/grammar.c \
415 $(srcdir)/Include/token.h \
416 $(srcdir)/Include/grammar.h
417 Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c
420 Python/compile.o Python/symtable.o: $(GRAMMAR_H)
422 Python/getplatform.o: $(srcdir)/Python/getplatform.c
423 $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
425 Python/importdl.o: $(srcdir)/Python/importdl.c
426 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
428 Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
429 $(srcdir)/Objects/unicodetype_db.h
431 ############################################################################
437 Include/boolobject.h \
438 Include/bufferobject.h \
440 Include/classobject.h \
444 Include/complexobject.h \
445 Include/descrobject.h \
446 Include/dictobject.h \
447 Include/enumobject.h \
448 Include/fileobject.h \
449 Include/floatobject.h \
450 Include/funcobject.h \
452 Include/intobject.h \
453 Include/intrcheck.h \
454 Include/iterobject.h \
455 Include/listobject.h \
456 Include/longobject.h \
457 Include/methodobject.h \
458 Include/modsupport.h \
459 Include/moduleobject.h \
462 Include/patchlevel.h \
469 Include/pythonrun.h \
470 Include/rangeobject.h \
471 Include/sliceobject.h \
472 Include/stringobject.h \
473 Include/structseq.h \
474 Include/structmember.h \
476 Include/sysmodule.h \
477 Include/traceback.h \
478 Include/tupleobject.h \
479 Include/unicodeobject.h \
480 Include/weakrefobject.h \
483 $(LIBRARY_OBJS) $(MODOBJS) Modules/$(MAINOBJ): $(PYTHON_HEADERS)
486 ######################################################################
488 # Test the interpreter (twice, once without .pyc files, once with)
490 TESTPROG= $(srcdir)/Lib/test/regrtest.py
491 TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -tt
493 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
494 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
495 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
497 QUICKTESTOPTS= $(TESTOPTS) -x test_thread test_signal test_strftime \
498 test_unicodedata test_re test_sre test_select test_poll \
499 test_linuxaudiodev test_struct test_sunaudiodev test_zlib
500 quicktest: all platform
501 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
502 -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
503 $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
505 MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
507 memtest: all platform
508 -rm -f $(srcdir)/Lib/test/*.py[co]
509 -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
510 $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
513 install: altinstall bininstall maninstall
515 # Install almost everything without disturbing previous versions
516 altinstall: altbininstall libinstall inclinstall libainstall \
517 sharedinstall oldsharedinstall
519 # Install shared libraries enabled by Setup
520 DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
522 oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
523 @for i in X $(SHAREDMODS); do \
524 if test $$i != X; then \
525 echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
526 $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
531 @for i in $(DESTDIRS); \
533 if test ! -d $$i; then \
534 echo "Creating directory $$i"; \
535 $(INSTALL) -d -m $(DIRMODE) $$i; \
541 # Install the interpreter (by creating a hard link to python$(VERSION))
542 bininstall: altbininstall
543 -if test -f $(BINDIR)/$(PYTHON); \
544 then rm -f $(BINDIR)/$(PYTHON); \
547 (cd $(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
549 # Install the interpreter with $(VERSION) affixed
550 # This goes into $(exec_prefix)
551 altbininstall: $(BUILDPYTHON)
552 @for i in $(BINDIR) $(LIBDIR); \
554 if test ! -d $$i; then \
555 echo "Creating directory $$i"; \
556 $(INSTALL) -d -m $(DIRMODE) $$i; \
560 $(INSTALL_PROGRAM) $(BUILDPYTHON) $(BINDIR)/python$(VERSION)$(EXE)
561 if test -f libpython$(VERSION)$(SO); then \
562 $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(LIBDIR)/$(INSTSONAME); \
565 if test -f "$(DLLLIBRARY)"; then \
566 $(INSTALL_SHARED) $(DLLLIBRARY) $(BINDIR); \
570 # Install the manual page
572 @for i in $(MANDIR) $(MANDIR)/man1; \
574 if test ! -d $$i; then \
575 echo "Creating directory $$i"; \
576 $(INSTALL) -d -m $(DIRMODE) $$i; \
580 $(INSTALL_DATA) $(srcdir)/Misc/python.man \
581 $(MANDIR)/man1/python.1
583 # Install the library
584 PLATDIR= plat-$(MACHDEP)
586 XMLLIBSUBDIRS= xml xml/dom xml/parsers xml/sax
587 LIBSUBDIRS= lib-old lib-tk site-packages test test/output test/data \
588 encodings email compiler hotshot \
589 distutils distutils/command $(XMLLIBSUBDIRS) curses $(MACHDEPS)
590 libinstall: $(BUILDPYTHON) $(srcdir)/Lib/$(PLATDIR)
591 @for i in $(SCRIPTDIR) $(LIBDEST); \
593 if test ! -d $$i; then \
594 echo "Creating directory $$i"; \
595 $(INSTALL) -d -m $(DIRMODE) $$i; \
599 @for d in $(LIBSUBDIRS); \
601 a=$(srcdir)/Lib/$$d; \
602 if test ! -d $$a; then continue; else true; fi; \
604 if test ! -d $$b; then \
605 echo "Creating directory $$b"; \
606 $(INSTALL) -d -m $(DIRMODE) $$b; \
610 @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \
612 if test -x $$i; then \
613 $(INSTALL_SCRIPT) $$i $(LIBDEST); \
614 echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
616 $(INSTALL_DATA) $$i $(LIBDEST); \
617 echo $(INSTALL_DATA) $$i $(LIBDEST); \
620 @for d in $(LIBSUBDIRS); \
622 a=$(srcdir)/Lib/$$d; \
623 if test ! -d $$a; then continue; else true; fi; \
633 if test -d $$i; then continue; fi; \
634 if test -x $$i; then \
635 echo $(INSTALL_SCRIPT) $$i $$b; \
636 $(INSTALL_SCRIPT) $$i $$b; \
638 echo $(INSTALL_DATA) $$i $$b; \
639 $(INSTALL_DATA) $$i $$b; \
644 $(INSTALL_DATA) $(srcdir)/LICENSE $(LIBDEST)/LICENSE.txt
645 PYTHONPATH=$(LIBDEST) $(RUNSHARED) \
646 ./$(BUILDPYTHON) -tt $(LIBDEST)/compileall.py -x badsyntax \
648 PYTHONPATH=$(LIBDEST) $(RUNSHARED) \
649 ./$(BUILDPYTHON) -O $(LIBDEST)/compileall.py -x badsyntax $(LIBDEST)
651 # Create the PLATDIR source directory, if one wasn't distributed..
652 $(srcdir)/Lib/$(PLATDIR):
653 mkdir $(srcdir)/Lib/$(PLATDIR)
654 cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
655 export PATH; PATH="`pwd`:$$PATH"; \
656 export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
657 export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
658 export EXE; EXE="$(BUILDEXE)"; \
659 cd $(srcdir)/Lib/$(PLATDIR); ./regen
661 # Install the include files
662 INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
664 @for i in $(INCLDIRSTOMAKE); \
666 if test ! -d $$i; then \
667 echo "Creating directory $$i"; \
668 $(INSTALL) -d -m $(DIRMODE) $$i; \
672 @for i in $(srcdir)/Include/*.h; \
674 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
675 $(INSTALL_DATA) $$i $(INCLUDEPY); \
677 $(INSTALL_DATA) pyconfig.h $(CONFINCLUDEPY)/pyconfig.h
679 # Install the library and miscellaneous stuff needed for extending/embedding
680 # This goes into $(exec_prefix)
681 LIBPL= $(LIBP)/config
683 @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
685 if test ! -d $$i; then \
686 echo "Creating directory $$i"; \
687 $(INSTALL) -d -m $(DIRMODE) $$i; \
691 @if test -d $(LIBRARY); then :; else \
692 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
693 $(INSTALL_DATA) $(LIBRARY) $(LIBPL)/$(LIBRARY) ; \
694 $(RANLIB) $(LIBPL)/$(LIBRARY) ; \
696 echo Skip install of $(LIBRARY) - use make frameworkinstall; \
699 $(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c
700 $(INSTALL_DATA) Modules/$(MAINOBJ) $(LIBPL)/$(MAINOBJ)
701 $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in
702 $(INSTALL_DATA) Makefile $(LIBPL)/Makefile
703 $(INSTALL_DATA) Modules/Setup $(LIBPL)/Setup
704 $(INSTALL_DATA) Modules/Setup.local $(LIBPL)/Setup.local
705 $(INSTALL_DATA) Modules/Setup.config $(LIBPL)/Setup.config
706 $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup
707 $(INSTALL_SCRIPT) $(srcdir)/install-sh $(LIBPL)/install-sh
708 @if [ -s Modules/python.exp -a \
709 "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
710 echo; echo "Installing support files for building shared extension modules on AIX:"; \
711 $(INSTALL_DATA) Modules/python.exp \
712 $(LIBPL)/python.exp; \
713 echo; echo "$(LIBPL)/python.exp"; \
714 $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \
715 $(LIBPL)/makexp_aix; \
716 echo "$(LIBPL)/makexp_aix"; \
717 $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix \
718 $(LIBPL)/ld_so_aix; \
719 echo "$(LIBPL)/ld_so_aix"; \
720 echo; echo "See Misc/AIX-NOTES for details."; \
723 @case "$(MACHDEP)" in beos*) \
724 echo; echo "Installing support files for building shared extension modules on BeOS:"; \
725 $(INSTALL_DATA) Misc/BeOS-NOTES $(LIBPL)/README; \
726 echo; echo "$(LIBPL)/README"; \
727 $(INSTALL_SCRIPT) Modules/ar_beos $(LIBPL)/ar_beos; \
728 echo "$(LIBPL)/ar_beos"; \
729 $(INSTALL_SCRIPT) Modules/ld_so_beos $(LIBPL)/ld_so_beos; \
730 echo "$(LIBPL)/ld_so_beos"; \
731 echo; echo "See Misc/BeOS-NOTES for details."; \
735 # Install the dynamically loadable modules
736 # This goes into $(exec_prefix)
738 $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
740 --install-scripts=$(BINDIR) \
741 --install-platlib=$(DESTSHARED)
743 # Install a MacOSX framework During build (before
744 # setup.py), make a minimal Python.framework directory structure in the build
745 # directory. This framework is minimal, it doesn't contain the Lib directory
746 # and such, but together with some magic in Modules/getpath.c it is good enough
747 # to run python from the install dir.
749 FRAMEWORKDEST=$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
750 RESSRCDIR=$(srcdir)/Mac/OSXResources/framework
751 $(PYTHONFRAMEWORKDIR): $(RESSRCDIR)/Info.plist \
752 $(RESSRCDIR)/version.plist \
753 $(RESSRCDIR)/English.lproj/InfoPlist.strings
754 @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
755 echo Not configured with --enable-framework; \
759 $(INSTALL) -d -m $(DIRMODE) $(FRAMEWORKDEST)/Resources/English.lproj
760 $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(FRAMEWORKDEST)/Resources/Info.plist
761 $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(FRAMEWORKDEST)/Resources/version.plist
762 $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
763 $(FRAMEWORKDEST)/Resources/English.lproj/InfoPlist.strings
764 $(LN) -fsh $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
765 $(LN) -fsh Versions/Current/Python $(PYTHONFRAMEWORKDIR)/Python
766 $(LN) -fsh Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
767 $(LN) -fsh Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
769 # On install, we re-make the framework
770 # structure in the install location, /Library/Frameworks/ or the argument to
771 # --enable-framework. If --enable-framework has been specified then we have
772 # automatically set prefix to the location deep down in the framework, so we
773 # only have to cater for the structural bits of the framework.
775 frameworkinstall: install frameworkinfrastructureinstall
776 FRAMEWORKFINALDEST=$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)
777 frameworkinfrastructureinstall: $(LDLIBRARY)
778 @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
779 echo Not configured with --enable-framework; \
783 @for i in $(FRAMEWORKFINALDEST)/Resources/English.lproj $(FRAMEWORKFINALDEST)/lib; do\
784 if test ! -d $$i; then \
785 echo "Creating directory $$i"; \
786 $(INSTALL) -d -m $(DIRMODE) $$i; \
790 $(LN) -sf $(INCLUDEPY) $(FRAMEWORKFINALDEST)/Headers
791 $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(FRAMEWORKFINALDEST)/Resources/Info.plist
792 $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(FRAMEWORKFINALDEST)/Resources/version.plist
793 $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
794 $(FRAMEWORKFINALDEST)/Resources/English.lproj/InfoPlist.strings
795 $(LN) -fsh $(VERSION) $(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
796 $(LN) -fsh Versions/Current/Python $(PYTHONFRAMEWORKINSTALLDIR)/Python
797 $(LN) -fsh Versions/Current/Headers $(PYTHONFRAMEWORKINSTALLDIR)/Headers
798 $(LN) -fsh Versions/Current/Resources $(PYTHONFRAMEWORKINSTALLDIR)/Resources
799 $(INSTALL_DATA) $(LDLIBRARY) $(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
801 # Build Python executable that can run GUI code. Another MacOSX pseudo
804 $(MAKE) -f $(srcdir)/Mac/OSX/Makefile install installmacsubtree \
805 PYTHONSRCDIR=$(srcdir) PYTHONBUILDDIR=.
807 # Build the toplevel Makefile
808 Makefile.pre: Makefile.pre.in config.status
809 CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
810 $(MAKE) -f Makefile.pre Makefile
812 # Run the configure script.
813 config.status: $(srcdir)/configure
814 $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
816 .PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
818 # Some make's put the object file in the current directory
820 $(CC) -c $(PY_CFLAGS) -o $@ $<
822 # Rerun configure with the same options as it was run last time,
823 # provided the config.status script exists
825 $(SHELL) config.status --recheck
826 $(SHELL) config.status
828 # Rebuild the configure script from configure.in; also rebuild pyconfig.h.in
830 (cd $(srcdir); autoconf)
831 (cd $(srcdir); autoheader)
833 # Create a tags file for vi
836 ctags -w -t Include/*.h; \
837 for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \
841 # Create a tags file for GNU Emacs
845 for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
847 # Sanitation targets -- clean leaves libraries, executables and tags
848 # files, which clobber removes those as well
851 find . -name '*.o' -exec rm -f {} ';'
852 find . -name '*.s[ol]' -exec rm -f {} ';'
853 find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
856 -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
858 config.cache config.log pyconfig.h Modules/config.c
859 -rm -rf build platform
861 # Make things extra clean, before making a distribution:
862 # remove all generated files, even Makefile[.pre]
864 -rm -f core Makefile Makefile.pre buildno config.status \
865 Modules/Setup Modules/Setup.local Modules/Setup.config
866 find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
867 -o -name '[@,#]*' -o -name '*.old' \
868 -o -name '*.orig' -o -name '*.rej' \
869 -o -name '*.bak' ')' \
872 # Check for smelly exported symbols (not starting with Py/_Py)
875 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
877 # Find files with funny names
879 find $(DISTDIRS) -type d \
896 -o -name Repository \
902 -o -name .cvsignore \
908 Python/thread.o: @THREADHEADERS@
910 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY