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
57 BASECFLAGS= @BASECFLAGS@
58 CFLAGS= $(BASECFLAGS) $(OPT) $(EXTRA_CFLAGS)
59 # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
60 # be able to build extension modules using the directories specified in the
61 # environment variables
62 CPPFLAGS= -I. -I$(srcdir)/Include @CPPFLAGS@
67 LINKFORSHARED= @LINKFORSHARED@
68 # Extra C flags added for building the interpreter object files.
69 CFLAGSFORSHARED=@CFLAGSFORSHARED@
70 # C flags used for building the interpreter object files
71 PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
74 # Machine-dependent subdirectories
77 # Install prefix for architecture-independent files
80 # Install prefix for architecture-dependent files
81 exec_prefix= @exec_prefix@
83 # Expanded directories
84 BINDIR= $(exec_prefix)/bin
85 LIBDIR= $(exec_prefix)/lib
87 INCLUDEDIR= @includedir@
88 CONFINCLUDEDIR= $(exec_prefix)/include
89 SCRIPTDIR= $(prefix)/lib
91 # Detailed destination directories
92 BINLIBDEST= $(LIBDIR)/python$(VERSION)
93 LIBDEST= $(SCRIPTDIR)/python$(VERSION)
94 INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
95 CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
96 LIBP= $(LIBDIR)/python$(VERSION)
98 # Symbols used for using shared libraries
101 BLDSHARED= @BLDSHARED@
102 DESTSHARED= $(BINLIBDEST)/lib-dynload
104 # Executable suffix (.exe on Windows and Mac OS X)
106 BUILDEXE= @BUILDEXEEXT@
108 # Short name and location for Mac OS X Python framework
109 PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
110 PYTHONFRAMEWORKDIR= @PYTHONFRAMEWORKDIR@
111 PYTHONFRAMEWORKPREFIX= @PYTHONFRAMEWORKPREFIX@
112 PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
113 # Deployment target selected during configure, to be checked
115 CONFIGURE_MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
116 # Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
117 OTHER_LIBTOOL_OPT=@OTHER_LIBTOOL_OPT@
119 # Environment to run shared python without installed libraries
120 RUNSHARED= @RUNSHARED@
122 # Modes for directories, executables and data files created by the
123 # install process. Default to user-only-writable for all file types.
128 # configure script arguments
129 CONFIG_ARGS= @CONFIG_ARGS@
132 # Subdirectories with code
135 # Other subdirectories
136 SUBDIRSTOO= Include Lib Misc Demo
138 # Files and directories to be distributed
139 CONFIGFILES= configure configure.in acconfig.h pyconfig.h.in Makefile.pre.in
140 DISTFILES= README ChangeLog $(CONFIGFILES)
141 DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
142 DIST= $(DISTFILES) $(DISTDIRS)
146 LDLIBRARY= @LDLIBRARY@
147 BLDLIBRARY= @BLDLIBRARY@
148 DLLLIBRARY= @DLLLIBRARY@
149 LDLIBRARYDIR= @LDLIBRARYDIR@
150 INSTSONAME= @INSTSONAME@
156 SYSLIBS= $(LIBM) $(LIBC)
160 THREADOBJ= @THREADOBJ@
161 DLINCLDIR= @DLINCLDIR@
162 DYNLOADFILE= @DYNLOADFILE@
163 MACHDEP_OBJS= @MACHDEP_OBJS@
164 UNICODE_OBJS= @UNICODE_OBJS@
167 BUILDPYTHON= python$(BUILDEXE)
169 # === Definitions added by makesetup ===
172 ##########################################################################
180 # Used of signalmodule.o is not available
181 SIGNAL_OBJS= @SIGNAL_OBJS@
184 ##########################################################################
186 GRAMMAR_H= $(srcdir)/Include/graminit.h
187 GRAMMAR_C= $(srcdir)/Python/graminit.c
188 GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
191 ##########################################################################
193 PGEN= Parser/pgen$(EXE)
203 Parser/metagrammar.o \
208 PARSER_OBJS= $(POBJS) Parser/myreadline.o Parser/tokenizer.o
212 Python/mysnprintf.o \
213 Parser/tokenizer_pgen.o \
214 Parser/printgrammar.o \
217 PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS)
219 ##########################################################################
221 AST_H= $(srcdir)/Include/Python-ast.h
222 AST_C= $(srcdir)/Python/Python-ast.c
223 AST_ASDL= $(srcdir)/Parser/Python.asdl
225 ASDLGEN_FILES= $(srcdir)/Parser/asdl.py $(srcdir)/Parser/asdl_c.py
226 # XXX Note that a build now requires Python exist before the build starts
227 ASDLGEN= $(srcdir)/Parser/asdl_c.py -h $(srcdir)/Include -c $(srcdir)/Python
229 ##########################################################################
232 Python/Python-ast.o \
235 Python/bltinmodule.o \
236 Python/exceptions.o \
242 Python/frozenmain.o \
245 Python/getcompiler.o \
246 Python/getcopyright.o \
248 Python/getplatform.o \
249 Python/getversion.o \
254 Python/modsupport.o \
256 Python/mysnprintf.o \
260 Python/structmember.o \
266 Python/$(DYNLOADFILE) \
271 ##########################################################################
275 Objects/boolobject.o \
276 Objects/bufferobject.o \
277 Objects/cellobject.o \
278 Objects/classobject.o \
280 Objects/codeobject.o \
281 Objects/complexobject.o \
282 Objects/descrobject.o \
283 Objects/enumobject.o \
284 Objects/genobject.o \
285 Objects/fileobject.o \
286 Objects/floatobject.o \
287 Objects/frameobject.o \
288 Objects/funcobject.o \
289 Objects/intobject.o \
290 Objects/iterobject.o \
291 Objects/listobject.o \
292 Objects/longobject.o \
293 Objects/dictobject.o \
294 Objects/methodobject.o \
295 Objects/moduleobject.o \
298 Objects/rangeobject.o \
299 Objects/setobject.o \
300 Objects/sliceobject.o \
301 Objects/stringobject.o \
302 Objects/structseq.o \
303 Objects/tupleobject.o \
304 Objects/typeobject.o \
305 Objects/weakrefobject.o \
309 ##########################################################################
310 # objects that get linked into the Python library
312 Modules/getbuildinfo.o \
320 #########################################################################
324 all: $(BUILDPYTHON) oldsharedmods sharedmods
326 # Build the interpreter
327 $(BUILDPYTHON): Modules/$(MAINOBJ) $(LIBRARY) $(LDLIBRARY)
328 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
330 $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
332 platform: $(BUILDPYTHON)
333 $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
336 # Build the shared modules
337 sharedmods: $(BUILDPYTHON)
338 case $$MAKEFLAGS in \
339 *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
340 *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
343 # buildno should really depend on something like LIBRARY_SRC
344 buildno: $(PARSER_OBJS) \
350 $(srcdir)/Modules/getbuildinfo.c
351 if test -f buildno; then \
352 expr `cat buildno` + 1 >buildno1; \
353 mv -f buildno1 buildno; \
354 else echo 1 >buildno; fi
356 # Build static library
357 # avoid long command lines, same as LIBRARY_OBJS
358 $(LIBRARY): $(LIBRARY_OBJS)
360 $(AR) cr $@ Modules/getbuildinfo.o
361 $(AR) cr $@ $(PARSER_OBJS)
362 $(AR) cr $@ $(OBJECT_OBJS)
363 $(AR) cr $@ $(PYTHON_OBJS)
364 $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
365 $(AR) cr $@ $(MODOBJS)
368 libpython$(VERSION).so: $(LIBRARY_OBJS)
369 if test $(INSTSONAME) != $(LDLIBRARY); then \
370 $(LDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
371 $(LN) -f $(INSTSONAME) $@; \
373 $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
376 libpython$(VERSION).sl: $(LIBRARY_OBJS)
377 $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(LIBC) $(LIBM)
379 # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
380 # minimal framework (not including the Lib directory and such) in the current
382 RESSRCDIR=$(srcdir)/Mac/OSXResources/framework
383 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
385 $(RESSRCDIR)/Info.plist \
386 $(RESSRCDIR)/version.plist \
387 $(RESSRCDIR)/English.lproj/InfoPlist.strings
388 $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
389 libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \
391 $(INSTALL) -d -m $(DIRMODE) \
392 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
393 $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
394 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
395 $(INSTALL_DATA) $(RESSRCDIR)/version.plist \
396 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/version.plist
397 $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
398 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj/InfoPlist.strings
399 $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
400 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
401 $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
402 $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
404 # This rule builds the Cygwin Python DLL and import library if configured
405 # for a shared core library; otherwise, this rule is a noop.
406 $(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
407 if test -n "$(DLLLIBRARY)"; then \
408 $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
409 $(LIBS) $(MODLIBS) $(SYSLIBS); \
414 oldsharedmods: $(SHAREDMODS)
417 Makefile Modules/config.c: Makefile.pre \
418 $(srcdir)/Modules/config.c.in \
420 Modules/Setup.config \
423 $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
425 Modules/Setup.config \
426 Modules/Setup.local \
429 @echo "The Makefile was updated, you may need to re-run make."
432 Modules/Setup: $(srcdir)/Modules/Setup.dist
433 @if test -f Modules/Setup; then \
434 echo "-----------------------------------------------"; \
435 echo "Modules/Setup.dist is newer than Modules/Setup;"; \
436 echo "check to make sure you have all the updates you"; \
437 echo "need in your Modules/Setup file."; \
438 echo "Usually, copying Setup.dist to Setup will work."; \
439 echo "-----------------------------------------------"; \
442 ############################################################################
443 # Special rules for object files
445 Modules/getbuildinfo.o: $(srcdir)/Modules/getbuildinfo.c buildno
446 $(CC) -c $(PY_CFLAGS) -DBUILD=`cat buildno` -o $@ $(srcdir)/Modules/getbuildinfo.c
448 Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
449 $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
450 -DPREFIX='"$(prefix)"' \
451 -DEXEC_PREFIX='"$(exec_prefix)"' \
452 -DVERSION='"$(VERSION)"' \
453 -DVPATH='"$(VPATH)"' \
454 -o $@ $(srcdir)/Modules/getpath.c
456 Modules/ccpython.o: $(srcdir)/Modules/ccpython.cc
457 $(CXX) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/ccpython.cc
460 $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
461 -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
464 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
466 Parser/grammar.o: $(srcdir)/Parser/grammar.c \
467 $(srcdir)/Include/token.h \
468 $(srcdir)/Include/grammar.h
469 Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c
471 Parser/tokenizer_pgen.o: $(srcdir)/Parser/tokenizer.c
473 $(AST_H) $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
474 $(ASDLGEN) $(AST_ASDL)
476 Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H)
478 Python/getplatform.o: $(srcdir)/Python/getplatform.c
479 $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
481 Python/importdl.o: $(srcdir)/Python/importdl.c
482 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
484 Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
485 $(srcdir)/Objects/unicodetype_db.h
487 ############################################################################
492 Include/Python-ast.h \
495 Include/boolobject.h \
496 Include/bufferobject.h \
498 Include/classobject.h \
503 Include/complexobject.h \
504 Include/descrobject.h \
505 Include/dictobject.h \
506 Include/enumobject.h \
507 Include/genobject.h \
508 Include/fileobject.h \
509 Include/floatobject.h \
510 Include/funcobject.h \
512 Include/intobject.h \
513 Include/intrcheck.h \
514 Include/iterobject.h \
515 Include/listobject.h \
516 Include/longobject.h \
517 Include/methodobject.h \
518 Include/modsupport.h \
519 Include/moduleobject.h \
522 Include/patchlevel.h \
529 Include/pythonrun.h \
530 Include/rangeobject.h \
531 Include/setobject.h \
532 Include/sliceobject.h \
533 Include/stringobject.h \
534 Include/structseq.h \
535 Include/structmember.h \
537 Include/sysmodule.h \
538 Include/traceback.h \
539 Include/tupleobject.h \
540 Include/unicodeobject.h \
541 Include/weakrefobject.h \
544 $(LIBRARY_OBJS) $(MODOBJS) Modules/$(MAINOBJ): $(PYTHON_HEADERS)
547 ######################################################################
549 # Test the interpreter (twice, once without .pyc files, once with)
550 # In the past, we've had problems where bugs in the marshalling or
551 # elsewhere caused bytecode read from .pyc files to behave differently
552 # than bytecode generated directly from a .py source file. Sometimes
553 # the bytecode read from a .pyc file had the bug, somtimes the directly
554 # generated bytecode. This is sometimes a very shy bug needing a lot of
558 TESTPROG= $(srcdir)/Lib/test/regrtest.py
559 TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -tt
561 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
562 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
563 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
565 testall: all platform
566 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
567 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
568 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
570 QUICKTESTOPTS= $(TESTOPTS) -x test_thread test_signal test_strftime \
571 test_unicodedata test_re test_sre test_select test_poll \
572 test_linuxaudiodev test_struct test_sunaudiodev test_zlib
573 quicktest: all platform
574 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
575 -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
576 $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
578 MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
580 memtest: all platform
581 -rm -f $(srcdir)/Lib/test/*.py[co]
582 -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
583 $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
586 install: altinstall bininstall maninstall
588 # Install almost everything without disturbing previous versions
589 altinstall: altbininstall libinstall inclinstall libainstall \
590 sharedinstall oldsharedinstall
592 # Install shared libraries enabled by Setup
593 DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
595 oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
596 @for i in X $(SHAREDMODS); do \
597 if test $$i != X; then \
598 echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
599 $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
604 @for i in $(DESTDIRS); \
606 if test ! -d $(DESTDIR)$$i; then \
607 echo "Creating directory $$i"; \
608 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
614 # Install the interpreter (by creating a hard link to python$(VERSION))
615 bininstall: altbininstall
616 -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON); \
617 then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
620 (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
622 # Install the interpreter with $(VERSION) affixed
623 # This goes into $(exec_prefix)
624 altbininstall: $(BUILDPYTHON)
625 @if test "$(PYTHONFRAMEWORKDIR)" != no-framework; then \
626 if test ! -f $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current/Resources/Info.plist; then \
627 echo 'Framework build: use "make frameworkinstall" in stead of "make install"'; \
631 @for i in $(BINDIR) $(LIBDIR); \
633 if test ! -d $(DESTDIR)$$i; then \
634 echo "Creating directory $$i"; \
635 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
639 $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
640 if test -f libpython$(VERSION)$(SO); then \
641 if test "$(SO)" = .dll; then \
642 $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \
644 $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
645 if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \
646 (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \
652 # Install the manual page
654 @for i in $(MANDIR) $(MANDIR)/man1; \
656 if test ! -d $(DESTDIR)$$i; then \
657 echo "Creating directory $$i"; \
658 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
662 $(INSTALL_DATA) $(srcdir)/Misc/python.man \
663 $(DESTDIR)$(MANDIR)/man1/python.1
665 # Install the library
666 PLATDIR= plat-$(MACHDEP)
667 EXTRAPLATDIR= @EXTRAPLATDIR@
668 EXTRAMACHDEPPATH=@EXTRAMACHDEPPATH@
669 MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR)
670 XMLLIBSUBDIRS= xml xml/dom xml/parsers xml/sax
671 PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
672 plat-mac/lib-scriptpackages/_builtinSuites \
673 plat-mac/lib-scriptpackages/CodeWarrior \
674 plat-mac/lib-scriptpackages/Explorer \
675 plat-mac/lib-scriptpackages/Finder \
676 plat-mac/lib-scriptpackages/Netscape \
677 plat-mac/lib-scriptpackages/StdSuites \
678 plat-mac/lib-scriptpackages/SystemEvents \
679 plat-mac/lib-scriptpackages/Terminal
680 PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
681 LIBSUBDIRS= lib-old lib-tk site-packages test test/output test/data \
682 test/decimaltestdata \
683 encodings email email/test email/test/data compiler hotshot \
684 logging bsddb bsddb/test csv idlelib idlelib/Icons \
685 distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
687 libinstall: $(BUILDPYTHON) $(srcdir)/Lib/$(PLATDIR)
688 @for i in $(SCRIPTDIR) $(LIBDEST); \
690 if test ! -d $(DESTDIR)$$i; then \
691 echo "Creating directory $$i"; \
692 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
696 @for d in $(LIBSUBDIRS); \
698 a=$(srcdir)/Lib/$$d; \
699 if test ! -d $$a; then continue; else true; fi; \
701 if test ! -d $(DESTDIR)$$b; then \
702 echo "Creating directory $$b"; \
703 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
707 @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \
709 if test -x $$i; then \
710 $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
711 echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
713 $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
714 echo $(INSTALL_DATA) $$i $(LIBDEST); \
717 @for d in $(LIBSUBDIRS); \
719 a=$(srcdir)/Lib/$$d; \
720 if test ! -d $$a; then continue; else true; fi; \
730 if test -d $$i; then continue; fi; \
731 if test -x $$i; then \
732 echo $(INSTALL_SCRIPT) $$i $$b; \
733 $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
735 echo $(INSTALL_DATA) $$i $$b; \
736 $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
741 $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
742 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
743 ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
745 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
746 PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
747 ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
749 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
750 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
751 ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
752 -d $(LIBDEST)/site-packages -f \
753 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
754 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
755 ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
756 -d $(LIBDEST)/site-packages -f \
757 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
759 # Create the PLATDIR source directory, if one wasn't distributed..
760 $(srcdir)/Lib/$(PLATDIR):
761 mkdir $(srcdir)/Lib/$(PLATDIR)
762 cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
763 export PATH; PATH="`pwd`:$$PATH"; \
764 export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
765 export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
766 export EXE; EXE="$(BUILDEXE)"; \
767 cd $(srcdir)/Lib/$(PLATDIR); ./regen
769 # Install the include files
770 INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
772 @for i in $(INCLDIRSTOMAKE); \
774 if test ! -d $(DESTDIR)$$i; then \
775 echo "Creating directory $$i"; \
776 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
780 @for i in $(srcdir)/Include/*.h; \
782 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
783 $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
785 $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
787 # Install the library and miscellaneous stuff needed for extending/embedding
788 # This goes into $(exec_prefix)
789 LIBPL= $(LIBP)/config
791 @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
793 if test ! -d $(DESTDIR)$$i; then \
794 echo "Creating directory $$i"; \
795 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
799 @if test -d $(LIBRARY); then :; else \
800 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
801 if test "$(SO)" = .dll; then \
802 $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
804 $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
805 $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
808 echo Skip install of $(LIBRARY) - use make frameworkinstall; \
811 $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
812 $(INSTALL_DATA) Modules/$(MAINOBJ) $(DESTDIR)$(LIBPL)/$(MAINOBJ)
813 $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
814 $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
815 $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
816 $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
817 $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
818 $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
819 $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
820 @if [ -s Modules/python.exp -a \
821 "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
822 echo; echo "Installing support files for building shared extension modules on AIX:"; \
823 $(INSTALL_DATA) Modules/python.exp \
824 $(DESTDIR)$(LIBPL)/python.exp; \
825 echo; echo "$(LIBPL)/python.exp"; \
826 $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \
827 $(DESTDIR)$(LIBPL)/makexp_aix; \
828 echo "$(LIBPL)/makexp_aix"; \
829 $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix \
830 $(DESTDIR)$(LIBPL)/ld_so_aix; \
831 echo "$(LIBPL)/ld_so_aix"; \
832 echo; echo "See Misc/AIX-NOTES for details."; \
835 @case "$(MACHDEP)" in beos*) \
836 echo; echo "Installing support files for building shared extension modules on BeOS:"; \
837 $(INSTALL_DATA) Misc/BeOS-NOTES $(DESTDIR)$(LIBPL)/README; \
838 echo; echo "$(LIBPL)/README"; \
839 $(INSTALL_SCRIPT) Modules/ar_beos $(DESTDIR)$(LIBPL)/ar_beos; \
840 echo "$(LIBPL)/ar_beos"; \
841 $(INSTALL_SCRIPT) Modules/ld_so_beos $(DESTDIR)$(LIBPL)/ld_so_beos; \
842 echo "$(LIBPL)/ld_so_beos"; \
843 echo; echo "See Misc/BeOS-NOTES for details."; \
847 # Install the dynamically loadable modules
848 # This goes into $(exec_prefix)
850 $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
852 --install-scripts=$(BINDIR) \
853 --install-platlib=$(DESTSHARED) \
856 # Here are a couple of targets for MacOSX again, to install a full
857 # framework-based Python. frameworkinstall installs everything, the
858 # subtargets install specific parts. Much of the actual work is offloaded to
859 # the Makefile in Mac/OSX
861 frameworkinstall: frameworkinstallframework \
862 frameworkinstallapps frameworkinstallunixtools
864 # On install, we re-make the framework
865 # structure in the install location, /Library/Frameworks/ or the argument to
866 # --enable-framework. If --enable-framework has been specified then we have
867 # automatically set prefix to the location deep down in the framework, so we
868 # only have to cater for the structural bits of the framework.
870 frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
872 frameworkinstallstructure: $(LDLIBRARY)
873 @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
874 echo Not configured with --enable-framework; \
878 @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
879 if test ! -d $(DESTDIR)$$i; then \
880 echo "Creating directory $(DESTDIR)$$i"; \
881 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
885 $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
886 $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(DESTDIR)$(prefix)/Resources/Info.plist
887 $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(DESTDIR)$(prefix)/Resources/version.plist
888 $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
889 $(DESTDIR)$(prefix)/Resources/English.lproj/InfoPlist.strings
890 $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
891 $(LN) -fsn Versions/Current/Python $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Python
892 $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
893 $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
894 $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
896 # This installs Mac/Lib into the framework
897 frameworkinstallmaclib:
898 $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installmacsubtree \
899 $(RUNSHARED) BUILDPYTHON=./$(BUILDPYTHON) DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \
900 srcdir=$(srcdir) builddir=. prefix=$(prefix) LIBDEST=$(LIBDEST) \
903 # This installs the IDE, the Launcher and other apps into /Applications
904 frameworkinstallapps:
905 $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installapps \
906 $(RUNSHARED) BUILDPYTHON=./$(BUILDPYTHON) DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \
907 srcdir=$(srcdir) builddir=. DESTDIR=$(DESTDIR) prefix=$(prefix)
909 # This install the unix python and pythonw tools in /usr/local/bin
910 frameworkinstallunixtools:
911 $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installunixtools \
912 DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \
913 srcdir=$(srcdir) builddir=. DESTDIR=$(DESTDIR) prefix=$(prefix)
915 # This installs the Demos and Tools into the applications directory.
916 # It is not part of a normal frameworkinstall
917 frameworkinstallextras:
918 $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installextras \
919 $(RUNSHARED) BUILDPYTHON=./$(BUILDPYTHON) DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \
920 srcdir=$(srcdir) builddir=. DESTDIR=$(DESTDIR)
922 # This installs a few of the useful scripts in Tools/scripts
924 SRCDIR=$(srcdir) $(RUNSHARED) \
925 ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
927 --install-scripts=$(BINDIR) \
930 # Build the toplevel Makefile
931 Makefile.pre: Makefile.pre.in config.status
932 CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
933 $(MAKE) -f Makefile.pre Makefile
935 # Run the configure script.
936 config.status: $(srcdir)/configure
937 $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
939 .PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
941 # Some make's put the object file in the current directory
943 $(CC) -c $(PY_CFLAGS) -o $@ $<
945 # Rerun configure with the same options as it was run last time,
946 # provided the config.status script exists
948 $(SHELL) config.status --recheck
949 $(SHELL) config.status
951 # Rebuild the configure script from configure.in; also rebuild pyconfig.h.in
953 (cd $(srcdir); autoconf)
954 (cd $(srcdir); autoheader)
956 # Create a tags file for vi
959 ctags -w -t Include/*.h; \
960 for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \
964 # Create a tags file for GNU Emacs
968 for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
970 # Sanitation targets -- clean leaves libraries, executables and tags
971 # files, which clobber removes those as well
974 find . -name '*.o' -exec rm -f {} ';'
975 find . -name '*.s[ol]' -exec rm -f {} ';'
976 find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
979 -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
981 config.cache config.log pyconfig.h Modules/config.c
982 -rm -rf build platform
983 -rm -rf $(PYTHONFRAMEWORKDIR)
985 # Make things extra clean, before making a distribution:
986 # remove all generated files, even Makefile[.pre]
988 -rm -f core Makefile Makefile.pre buildno config.status \
989 Modules/Setup Modules/Setup.local Modules/Setup.config
990 find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
991 -o -name '[@,#]*' -o -name '*.old' \
992 -o -name '*.orig' -o -name '*.rej' \
993 -o -name '*.bak' ')' \
996 # Check for smelly exported symbols (not starting with Py/_Py)
999 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
1001 # Find files with funny names
1003 find $(DISTDIRS) -type d \
1004 -o -name '*.[chs]' \
1014 -o -name '*,[vpt]' \
1016 -o -name 'Setup.*' \
1019 -o -name ChangeLog \
1020 -o -name Repository \
1026 -o -name .cvsignore \
1032 Python/thread.o: @THREADHEADERS@
1034 # Declare targets that aren't real files
1035 .PHONY: all sharedmods oldsharedmods test quicktest memtest
1036 .PHONY: install altinstall oldsharedinstall bininstall altbininstall
1037 .PHONY: maninstall libinstall inclinstall libainstall sharedinstall
1038 .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
1039 .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
1040 .PHONY: recheck autoconf clean clobber distclean smelly funny
1042 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY