home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / lib / python2.4 / config / Makefile
Encoding:
Makefile  |  2006-08-25  |  35.1 KB  |  1,065 lines

  1. # Generated automatically from Makefile.pre by makesetup.
  2. # Top-level Makefile for Python
  3. #
  4. # As distributed, this file is called Makefile.pre.in; it is processed
  5. # into the real Makefile by running the script ./configure, which
  6. # replaces things like @spam@ with values appropriate for your system.
  7. # This means that if you edit Makefile, your changes get lost the next
  8. # time you run the configure script.  Ideally, you can do:
  9. #
  10. #    ./configure
  11. #    make
  12. #    make test
  13. #    make install
  14. #
  15. # If you have a previous version of Python installed that you don't
  16. # want to overwrite, you can use "make altinstall" instead of "make
  17. # install".  Refer to the "Installing" section in the README file for
  18. # additional details.
  19. #
  20. # See also the section "Build instructions" in the README file.
  21.  
  22. # === Variables set by makesetup ===
  23.  
  24. MODOBJS=          Modules/threadmodule.o  Modules/signalmodule.o  Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/zipimport.o  Modules/symtablemodule.o  Modules/xxsubtype.o
  25. MODLIBS=        $(LOCALMODLIBS) $(BASEMODLIBS)
  26.  
  27. # === Variables set by configure
  28. VERSION=    2.4
  29. srcdir=        ..
  30. VPATH=        ..
  31.  
  32. CC=        gcc -pthread
  33. CXX=        g++ -pthread        
  34. LINKCC=        $(PURIFY) $(CC)
  35. AR=        ar
  36. RANLIB=        ranlib
  37.  
  38. # Shell used by make (some versions default to the login shell, which is bad)
  39. SHELL=        /bin/sh
  40.  
  41. # Use this to make a link between python$(VERSION) and python in $(BINDIR)
  42. LN=        ln
  43.  
  44. # Portable install script (configure doesn't always guess right)
  45. INSTALL=    /usr/bin/install -c
  46. INSTALL_PROGRAM=${INSTALL}
  47. INSTALL_SCRIPT= ${INSTALL}
  48. INSTALL_DATA=    ${INSTALL} -m 644
  49. # Shared libraries must be installed with executable mode on some systems;
  50. # rather than figuring out exactly which, we always give them executable mode.
  51. # Also, making them read-only seems to be a good idea...
  52. INSTALL_SHARED= ${INSTALL} -m 555
  53.  
  54. MAKESETUP=      $(srcdir)/Modules/makesetup
  55.  
  56. # Compiler options
  57. OPT=        -DNDEBUG -g -O2 -Wall -Wstrict-prototypes
  58. BASECFLAGS=     -fno-strict-aliasing
  59. CFLAGS=        $(BASECFLAGS) $(OPT)
  60. CPPFLAGS=    -I. -I$(srcdir)/Include
  61. LDFLAGS=    
  62. LDLAST=        
  63. SGI_ABI=    
  64. CCSHARED=    -fPIC
  65. LINKFORSHARED=    -Xlinker -export-dynamic
  66. # Extra C flags added for building the interpreter object files.
  67. CFLAGSFORSHARED=$(CCSHARED)
  68. # C flags used for building the interpreter object files
  69. PY_CFLAGS=    $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
  70.  
  71.  
  72. # Machine-dependent subdirectories
  73. MACHDEP=    linux2
  74.  
  75. # Install prefix for architecture-independent files
  76. prefix=        /usr
  77.  
  78. # Install prefix for architecture-dependent files
  79. exec_prefix=    ${prefix}
  80.  
  81. # Expanded directories
  82. BINDIR=        $(exec_prefix)/bin
  83. LIBDIR=        $(exec_prefix)/lib
  84. MANDIR=        ${prefix}/man
  85. INCLUDEDIR=    ${prefix}/include
  86. CONFINCLUDEDIR=    $(exec_prefix)/include
  87. SCRIPTDIR=    $(prefix)/lib
  88.  
  89. # Detailed destination directories
  90. BINLIBDEST=    $(LIBDIR)/python$(VERSION)
  91. LIBDEST=    $(SCRIPTDIR)/python$(VERSION)
  92. INCLUDEPY=    $(INCLUDEDIR)/python$(VERSION)
  93. CONFINCLUDEPY=    $(CONFINCLUDEDIR)/python$(VERSION)
  94. LIBP=        $(LIBDIR)/python$(VERSION)
  95.  
  96. # Symbols used for using shared libraries
  97. SO=        .so
  98. LDSHARED=    $(CC) -shared
  99. BLDSHARED=    $(CC) -shared
  100. DESTSHARED=    $(BINLIBDEST)/lib-dynload
  101.  
  102. # Executable suffix (.exe on Windows and Mac OS X)
  103. EXE=        
  104. BUILDEXE=    
  105.  
  106. # Short name and location for Mac OS X Python framework
  107. PYTHONFRAMEWORK=    
  108. PYTHONFRAMEWORKDIR=    no-framework
  109. PYTHONFRAMEWORKPREFIX=    
  110. PYTHONFRAMEWORKINSTALLDIR= 
  111. # Deployment target selected during configure, to be checked
  112. # by distutils
  113. CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
  114. # Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
  115. OTHER_LIBTOOL_OPT=
  116.  
  117. # Environment to run shared python without installed libraries
  118. RUNSHARED=
  119.  
  120. # Modes for directories, executables and data files created by the
  121. # install process.  Default to user-only-writable for all file types.
  122. DIRMODE=    755
  123. EXEMODE=    755
  124. FILEMODE=    644
  125.  
  126. # configure script arguments
  127. CONFIG_ARGS=    '--enable-shared' '--prefix=/usr' '--enable-ipv6' '--enable-unicode=ucs4' '--without-cxx' '--with-fpectl' 'CC=gcc'
  128.  
  129.  
  130. # Subdirectories with code
  131. SRCDIRS=     Parser Grammar Objects Python Modules Mac Mac/Python
  132.  
  133. # Other subdirectories
  134. SUBDIRSTOO=    Include Lib Misc Demo
  135.  
  136. # Files and directories to be distributed
  137. CONFIGFILES=    configure configure.in acconfig.h pyconfig.h.in Makefile.pre.in
  138. DISTFILES=    README ChangeLog $(CONFIGFILES)
  139. DISTDIRS=    $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
  140. DIST=        $(DISTFILES) $(DISTDIRS)
  141.  
  142.  
  143. LIBRARY=    libpython$(VERSION).a
  144. LDLIBRARY=      libpython$(VERSION).so
  145. BLDLIBRARY=     -L. -lpython$(VERSION)
  146. DLLLIBRARY=    
  147. LDLIBRARYDIR=   
  148. INSTSONAME=    libpython$(VERSION).so.1.0
  149.  
  150.  
  151. LIBS=        -lpthread -ldl  -lutil
  152. LIBM=        -lm
  153. LIBC=        
  154. SYSLIBS=    $(LIBM) $(LIBC)
  155. SHLIBS=        $(LIBS)
  156.  
  157. MAINOBJ=    python.o
  158. THREADOBJ=    Python/thread.o
  159. DLINCLDIR=    .
  160. DYNLOADFILE=    dynload_shlib.o
  161. MACHDEP_OBJS=    
  162. UNICODE_OBJS=   Objects/unicodeobject.o Objects/unicodectype.o
  163.  
  164. PYTHON=        python$(EXE)
  165. BUILDPYTHON=    python$(BUILDEXE)
  166.  
  167. # === Definitions added by makesetup ===
  168.  
  169. LOCALMODLIBS=          
  170. BASEMODLIBS=
  171. GLHACK=-Dclear=__GLclear
  172. PYTHONPATH=$(COREPYTHONPATH)
  173. COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)$(MACHDEPPATH)$(EXTRAMACHDEPPATH)$(TKPATH)
  174. TKPATH=:lib-tk
  175. EXTRAMACHDEPPATH=
  176. MACHDEPPATH=:plat-$(MACHDEP)
  177. TESTPATH=
  178. SITEPATH=
  179. DESTPATH=
  180. MACHDESTLIB=$(BINLIBDEST)
  181. DESTLIB=$(LIBDEST)
  182.  
  183.  
  184.  
  185. ##########################################################################
  186. # Modules
  187. MODULE_OBJS=    \
  188.         Modules/config.o \
  189.         Modules/getpath.o \
  190.         Modules/main.o \
  191.         Modules/gcmodule.o
  192.  
  193. # Used of signalmodule.o is not available
  194. SIGNAL_OBJS=    
  195.  
  196.  
  197. ##########################################################################
  198. # Grammar
  199. GRAMMAR_H=    $(srcdir)/Include/graminit.h
  200. GRAMMAR_C=    $(srcdir)/Python/graminit.c
  201. GRAMMAR_INPUT=    $(srcdir)/Grammar/Grammar
  202.  
  203.  
  204. ##########################################################################
  205. # Parser
  206. PGEN=        Parser/pgen$(EXE)
  207.  
  208. POBJS=        \
  209.         Parser/acceler.o \
  210.         Parser/grammar1.o \
  211.         Parser/listnode.o \
  212.         Parser/node.o \
  213.         Parser/parser.o \
  214.         Parser/parsetok.o \
  215.         Parser/bitset.o \
  216.         Parser/metagrammar.o \
  217.         Parser/firstsets.o \
  218.         Parser/grammar.o \
  219.         Parser/pgen.o
  220.  
  221. PARSER_OBJS=    $(POBJS) Parser/myreadline.o Parser/tokenizer.o
  222.  
  223. PGOBJS=        \
  224.         Objects/obmalloc.o \
  225.         Python/mysnprintf.o \
  226.         Parser/tokenizer_pgen.o \
  227.         Parser/printgrammar.o \
  228.         Parser/pgenmain.o
  229.  
  230. PGENOBJS=    $(PGENMAIN) $(POBJS) $(PGOBJS)
  231.  
  232.  
  233. ##########################################################################
  234. # Python
  235. PYTHON_OBJS=    \
  236.         Python/bltinmodule.o \
  237.         Python/exceptions.o \
  238.         Python/ceval.o \
  239.         Python/compile.o \
  240.         Python/codecs.o \
  241.         Python/errors.o \
  242.         Python/frozen.o \
  243.         Python/frozenmain.o \
  244.         Python/future.o \
  245.         Python/getargs.o \
  246.         Python/getcompiler.o \
  247.         Python/getcopyright.o \
  248.         Python/getmtime.o \
  249.         Python/getplatform.o \
  250.         Python/getversion.o \
  251.         Python/graminit.o \
  252.         Python/import.o \
  253.         Python/importdl.o \
  254.         Python/marshal.o \
  255.         Python/modsupport.o \
  256.         Python/mystrtoul.o \
  257.         Python/mysnprintf.o \
  258.         Python/pyfpe.o \
  259.         Python/pystate.o \
  260.         Python/pythonrun.o \
  261.         Python/structmember.o \
  262.         Python/symtable.o \
  263.         Python/sysmodule.o \
  264.         Python/traceback.o \
  265.         Python/getopt.o \
  266.         Python/pystrtod.o \
  267.         Python/$(DYNLOADFILE) \
  268.         $(MACHDEP_OBJS) \
  269.         $(THREADOBJ)
  270.  
  271.  
  272. ##########################################################################
  273. # Objects
  274. OBJECT_OBJS=    \
  275.         Objects/abstract.o \
  276.         Objects/boolobject.o \
  277.         Objects/bufferobject.o \
  278.         Objects/cellobject.o \
  279.         Objects/classobject.o \
  280.         Objects/cobject.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 \
  296.         Objects/object.o \
  297.         Objects/obmalloc.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 \
  306.         $(UNICODE_OBJS)
  307.  
  308.  
  309. ##########################################################################
  310. # objects that get linked into the Python library
  311. LIBRARY_OBJS=    \
  312.         Modules/getbuildinfo.o \
  313.         $(PARSER_OBJS) \
  314.         $(OBJECT_OBJS) \
  315.         $(PYTHON_OBJS) \
  316.         $(MODULE_OBJS) \
  317.         $(SIGNAL_OBJS) \
  318.         $(MODOBJS)
  319.  
  320. #########################################################################
  321. # Rules
  322.  
  323. # Default target
  324. all:        $(BUILDPYTHON) oldsharedmods sharedmods
  325.  
  326. # Build the interpreter
  327. $(BUILDPYTHON):    Modules/$(MAINOBJ) $(LIBRARY) $(LDLIBRARY)
  328.         $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
  329.             Modules/$(MAINOBJ) \
  330.             $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
  331.  
  332. platform: $(BUILDPYTHON)
  333.     $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
  334.  
  335.  
  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;; \
  341.     esac
  342.  
  343. # buildno should really depend on something like LIBRARY_SRC
  344. buildno: $(PARSER_OBJS) \
  345.         $(OBJECT_OBJS) \
  346.         $(PYTHON_OBJS) \
  347.         $(MODULE_OBJS) \
  348.         $(SIGNAL_OBJS) \
  349.         $(MODOBJS) \
  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
  355.  
  356. # Build static library
  357. # avoid long command lines, same as LIBRARY_OBJS
  358. $(LIBRARY): $(LIBRARY_OBJS)
  359.     -rm -f $@
  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)
  366.     $(RANLIB) $@
  367.  
  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) $@; \
  372.     else\
  373.         $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
  374.     fi
  375.  
  376. libpython$(VERSION).sl: $(LIBRARY_OBJS)
  377.     $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(LIBC) $(LIBM)
  378.  
  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
  381. # directory.
  382. RESSRCDIR=$(srcdir)/Mac/OSXResources/framework
  383. $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
  384.         $(LIBRARY) \
  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) \
  390.         
  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
  403.  
  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); \
  410.     else true; \
  411.     fi
  412.  
  413.  
  414. oldsharedmods: $(SHAREDMODS)
  415.  
  416.  
  417. Makefile Modules/config.c: Makefile.pre \
  418.                 $(srcdir)/Modules/config.c.in \
  419.                 $(MAKESETUP) \
  420.                 Modules/Setup.config \
  421.                 Modules/Setup \
  422.                 Modules/Setup.local
  423.     $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
  424.                 -s Modules \
  425.                 Modules/Setup.config \
  426.                 Modules/Setup.local \
  427.                 Modules/Setup
  428.     @mv config.c Modules
  429.     @echo "The Makefile was updated, you may need to re-run make."
  430.  
  431.  
  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 "-----------------------------------------------"; \
  440.     fi
  441.  
  442. ############################################################################
  443. # Special rules for object files
  444.  
  445. Modules/getbuildinfo.o: $(srcdir)/Modules/getbuildinfo.c buildno
  446.     $(CC) -c $(PY_CFLAGS) -DBUILD=`cat buildno` -o $@ $(srcdir)/Modules/getbuildinfo.c
  447.  
  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
  455.  
  456. Modules/ccpython.o: $(srcdir)/Modules/ccpython.cc
  457.     $(CXX) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/ccpython.cc
  458.  
  459.  
  460. $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
  461.         -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
  462.  
  463. $(PGEN):    $(PGENOBJS)
  464.         $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
  465.  
  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
  470.  
  471. Parser/tokenizer_pgen.o:    $(srcdir)/Parser/tokenizer.c
  472.  
  473.  
  474. Python/compile.o Python/symtable.o: $(GRAMMAR_H)
  475.  
  476. Python/getplatform.o: $(srcdir)/Python/getplatform.c
  477.         $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
  478.  
  479. Python/importdl.o: $(srcdir)/Python/importdl.c
  480.         $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
  481.  
  482. Objects/unicodectype.o:    $(srcdir)/Objects/unicodectype.c \
  483.                 $(srcdir)/Objects/unicodetype_db.h
  484.  
  485. ############################################################################
  486. # Header files
  487.  
  488. PYTHON_HEADERS= \
  489.         Include/Python.h \
  490.         Include/abstract.h \
  491.         Include/boolobject.h \
  492.         Include/bufferobject.h \
  493.         Include/ceval.h \
  494.         Include/classobject.h \
  495.         Include/cobject.h \
  496.         Include/codecs.h \
  497.         Include/compile.h \
  498.         Include/complexobject.h \
  499.         Include/descrobject.h \
  500.         Include/dictobject.h \
  501.         Include/enumobject.h \
  502.         Include/genobject.h \
  503.         Include/fileobject.h \
  504.         Include/floatobject.h \
  505.         Include/funcobject.h \
  506.         Include/import.h \
  507.         Include/intobject.h \
  508.         Include/intrcheck.h \
  509.         Include/iterobject.h \
  510.         Include/listobject.h \
  511.         Include/longobject.h \
  512.         Include/methodobject.h \
  513.         Include/modsupport.h \
  514.         Include/moduleobject.h \
  515.         Include/object.h \
  516.         Include/objimpl.h \
  517.         Include/patchlevel.h \
  518.         Include/pydebug.h \
  519.         Include/pyerrors.h \
  520.         Include/pyfpe.h \
  521.         Include/pymem.h \
  522.         Include/pyport.h \
  523.         Include/pystate.h \
  524.         Include/pythonrun.h \
  525.         Include/rangeobject.h \
  526.                 Include/setobject.h \
  527.         Include/sliceobject.h \
  528.         Include/stringobject.h \
  529.         Include/structseq.h \
  530.         Include/structmember.h \
  531.         Include/symtable.h \
  532.         Include/sysmodule.h \
  533.         Include/traceback.h \
  534.         Include/tupleobject.h \
  535.         Include/unicodeobject.h \
  536.         Include/weakrefobject.h \
  537.         pyconfig.h
  538.  
  539. $(LIBRARY_OBJS) $(MODOBJS) Modules/$(MAINOBJ): $(PYTHON_HEADERS)
  540.  
  541.  
  542. ######################################################################
  543.  
  544. # Test the interpreter (twice, once without .pyc files, once with)
  545. # In the past, we've had problems where bugs in the marshalling or
  546. # elsewhere caused bytecode read from .pyc files to behave differently
  547. # than bytecode generated directly from a .py source file.  Sometimes
  548. # the bytecode read from a .pyc file had the bug, somtimes the directly
  549. # generated bytecode.  This is sometimes a very shy bug needing a lot of
  550. # sample data.
  551.  
  552. TESTOPTS=    -l $(EXTRATESTOPTS)
  553. TESTPROG=    $(srcdir)/Lib/test/regrtest.py
  554. TESTPYTHON=    $(RUNSHARED) ./$(BUILDPYTHON) -E -tt
  555. test:        all platform
  556.         -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
  557.         -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
  558.         $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
  559.  
  560. testall:    all platform
  561.         -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
  562.         -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
  563.         $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
  564.  
  565. # Like testall, but with a single pass only
  566. buildbottest:    all platform
  567.         $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall -rw
  568.  
  569. QUICKTESTOPTS=    $(TESTOPTS) -x test_thread test_signal test_strftime \
  570.         test_unicodedata test_re test_sre test_select test_poll \
  571.         test_linuxaudiodev test_struct test_sunaudiodev test_zlib
  572. quicktest:    all platform
  573.         -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
  574.         -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
  575.         $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
  576.  
  577. MEMTESTOPTS=    $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
  578.         test_longexp
  579. memtest:    all platform
  580.         -rm -f $(srcdir)/Lib/test/*.py[co]
  581.         -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
  582.         $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
  583.  
  584. # Install everything
  585. install:    altinstall bininstall maninstall
  586.  
  587. # Install almost everything without disturbing previous versions
  588. altinstall:    altbininstall libinstall inclinstall libainstall \
  589.                 sharedinstall oldsharedinstall
  590.  
  591. # Install shared libraries enabled by Setup
  592. DESTDIRS=    $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
  593.  
  594. oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
  595.         @for i in X $(SHAREDMODS); do \
  596.           if test $$i != X; then \
  597.             echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
  598.             $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
  599.           fi; \
  600.         done
  601.  
  602. $(DESTSHARED):
  603.         @for i in $(DESTDIRS); \
  604.         do \
  605.             if test ! -d $(DESTDIR)$$i; then \
  606.                 echo "Creating directory $$i"; \
  607.                 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
  608.             else    true; \
  609.             fi; \
  610.         done
  611.  
  612.  
  613. # Install the interpreter (by creating a hard link to python$(VERSION))
  614. bininstall:    altbininstall
  615.     -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON); \
  616.     then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
  617.     else true; \
  618.     fi
  619.     (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
  620.  
  621. # Install the interpreter with $(VERSION) affixed
  622. # This goes into $(exec_prefix)
  623. altbininstall:    $(BUILDPYTHON)
  624.     @if test "$(PYTHONFRAMEWORKDIR)" != no-framework; then \
  625.         if test ! -f $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current/Resources/Info.plist; then \
  626.             echo 'Framework build: use "make frameworkinstall" in stead of "make install"'; \
  627.             exit 1; \
  628.         fi; \
  629.     fi
  630.     @for i in $(BINDIR) $(LIBDIR); \
  631.     do \
  632.         if test ! -d $(DESTDIR)$$i; then \
  633.             echo "Creating directory $$i"; \
  634.             $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
  635.         else    true; \
  636.         fi; \
  637.     done
  638.     $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
  639.     if test -f libpython$(VERSION)$(SO); then \
  640.         if test "$(SO)" = .dll; then \
  641.             $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \
  642.         else \
  643.             $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
  644.             if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \
  645.                 (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \
  646.             fi \
  647.         fi; \
  648.     else    true; \
  649.     fi
  650.  
  651. # Install the manual page
  652. maninstall:
  653.     @for i in $(MANDIR) $(MANDIR)/man1; \
  654.     do \
  655.         if test ! -d $(DESTDIR)$$i; then \
  656.             echo "Creating directory $$i"; \
  657.             $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
  658.         else    true; \
  659.         fi; \
  660.     done
  661.     $(INSTALL_DATA) $(srcdir)/Misc/python.man \
  662.         $(DESTDIR)$(MANDIR)/man1/python.1
  663.  
  664. # Install the library
  665. PLATDIR=    plat-$(MACHDEP)
  666. EXTRAPLATDIR= 
  667. EXTRAMACHDEPPATH=
  668. MACHDEPS=    $(PLATDIR) $(EXTRAPLATDIR)
  669. XMLLIBSUBDIRS=  xml xml/dom xml/parsers xml/sax
  670. PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
  671.     plat-mac/lib-scriptpackages/_builtinSuites \
  672.     plat-mac/lib-scriptpackages/CodeWarrior \
  673.     plat-mac/lib-scriptpackages/Explorer \
  674.     plat-mac/lib-scriptpackages/Finder \
  675.     plat-mac/lib-scriptpackages/Netscape \
  676.     plat-mac/lib-scriptpackages/StdSuites \
  677.     plat-mac/lib-scriptpackages/SystemEvents \
  678.     plat-mac/lib-scriptpackages/Terminal
  679. PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
  680. LIBSUBDIRS=    lib-old lib-tk site-packages test test/output test/data \
  681.         test/decimaltestdata \
  682.         encodings email email/test email/test/data compiler hotshot \
  683.         logging bsddb bsddb/test csv idlelib idlelib/Icons \
  684.         distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
  685.         curses $(MACHDEPS)
  686. libinstall:    $(BUILDPYTHON) $(srcdir)/Lib/$(PLATDIR)
  687.     @for i in $(SCRIPTDIR) $(LIBDEST); \
  688.     do \
  689.         if test ! -d $(DESTDIR)$$i; then \
  690.             echo "Creating directory $$i"; \
  691.             $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
  692.         else    true; \
  693.         fi; \
  694.     done
  695.     @for d in $(LIBSUBDIRS); \
  696.     do \
  697.         a=$(srcdir)/Lib/$$d; \
  698.         if test ! -d $$a; then continue; else true; fi; \
  699.         b=$(LIBDEST)/$$d; \
  700.         if test ! -d $(DESTDIR)$$b; then \
  701.             echo "Creating directory $$b"; \
  702.             $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
  703.         else    true; \
  704.         fi; \
  705.     done
  706.     @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc; \
  707.     do \
  708.         if test -x $$i; then \
  709.             $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
  710.             echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
  711.         else \
  712.             $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
  713.             echo $(INSTALL_DATA) $$i $(LIBDEST); \
  714.         fi; \
  715.     done
  716.     @for d in $(LIBSUBDIRS); \
  717.     do \
  718.         a=$(srcdir)/Lib/$$d; \
  719.         if test ! -d $$a; then continue; else true; fi; \
  720.         b=$(LIBDEST)/$$d; \
  721.         for i in $$a/*; \
  722.         do \
  723.             case $$i in \
  724.             *CVS) ;; \
  725.             *.py[co]) ;; \
  726.             *.orig) ;; \
  727.             *~) ;; \
  728.             *) \
  729.                 if test -d $$i; then continue; fi; \
  730.                 if test -x $$i; then \
  731.                     echo $(INSTALL_SCRIPT) $$i $$b; \
  732.                     $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
  733.                 else \
  734.                     echo $(INSTALL_DATA) $$i $$b; \
  735.                     $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
  736.                 fi;; \
  737.             esac; \
  738.         done; \
  739.     done
  740.     $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
  741.     PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
  742.         ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
  743.         -d $(LIBDEST) -f \
  744.         -x 'badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
  745.     PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  746.         ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
  747.         -d $(LIBDEST) -f \
  748.         -x 'badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
  749.     -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
  750.         ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
  751.         -d $(LIBDEST)/site-packages -f \
  752.         -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
  753.     -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  754.         ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
  755.         -d $(LIBDEST)/site-packages -f \
  756.         -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
  757.  
  758. # Create the PLATDIR source directory, if one wasn't distributed..
  759. $(srcdir)/Lib/$(PLATDIR):
  760.     mkdir $(srcdir)/Lib/$(PLATDIR)
  761.     cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
  762.     export PATH; PATH="`pwd`:$$PATH"; \
  763.     export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
  764.     export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
  765.     export EXE; EXE="$(BUILDEXE)"; \
  766.     cd $(srcdir)/Lib/$(PLATDIR); ./regen
  767.  
  768. # Install the include files
  769. INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
  770. inclinstall:
  771.     @for i in $(INCLDIRSTOMAKE); \
  772.     do \
  773.         if test ! -d $(DESTDIR)$$i; then \
  774.             echo "Creating directory $$i"; \
  775.             $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
  776.         else    true; \
  777.         fi; \
  778.     done
  779.     @for i in $(srcdir)/Include/*.h; \
  780.     do \
  781.         echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
  782.         $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
  783.     done
  784.     $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
  785.  
  786. # Install the library and miscellaneous stuff needed for extending/embedding
  787. # This goes into $(exec_prefix)
  788. LIBPL=        $(LIBP)/config
  789. libainstall:    all
  790.     @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
  791.     do \
  792.         if test ! -d $(DESTDIR)$$i; then \
  793.             echo "Creating directory $$i"; \
  794.             $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
  795.         else    true; \
  796.         fi; \
  797.     done
  798.     @if test -d $(LIBRARY); then :; else \
  799.         if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
  800.             if test "$(SO)" = .dll; then \
  801.                 $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
  802.             else \
  803.                 $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
  804.                 $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
  805.             fi; \
  806.         else \
  807.             echo Skip install of $(LIBRARY) - use make frameworkinstall; \
  808.         fi; \
  809.     fi
  810.     $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
  811.     $(INSTALL_DATA) Modules/$(MAINOBJ) $(DESTDIR)$(LIBPL)/$(MAINOBJ)
  812.     $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
  813.     $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
  814.     $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
  815.     $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
  816.     $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
  817.     $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
  818.     $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
  819.     @if [ -s Modules/python.exp -a \
  820.         "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
  821.         echo; echo "Installing support files for building shared extension modules on AIX:"; \
  822.         $(INSTALL_DATA) Modules/python.exp        \
  823.                 $(DESTDIR)$(LIBPL)/python.exp;        \
  824.         echo; echo "$(LIBPL)/python.exp";        \
  825.         $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix    \
  826.                 $(DESTDIR)$(LIBPL)/makexp_aix;        \
  827.         echo "$(LIBPL)/makexp_aix";            \
  828.         $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix    \
  829.                 $(DESTDIR)$(LIBPL)/ld_so_aix;        \
  830.         echo "$(LIBPL)/ld_so_aix";            \
  831.         echo; echo "See Misc/AIX-NOTES for details.";    \
  832.     else true; \
  833.     fi
  834.     @case "$(MACHDEP)" in beos*) \
  835.         echo; echo "Installing support files for building shared extension modules on BeOS:"; \
  836.         $(INSTALL_DATA) Misc/BeOS-NOTES $(DESTDIR)$(LIBPL)/README;    \
  837.         echo; echo "$(LIBPL)/README";            \
  838.         $(INSTALL_SCRIPT) Modules/ar_beos $(DESTDIR)$(LIBPL)/ar_beos; \
  839.         echo "$(LIBPL)/ar_beos";            \
  840.         $(INSTALL_SCRIPT) Modules/ld_so_beos $(DESTDIR)$(LIBPL)/ld_so_beos; \
  841.         echo "$(LIBPL)/ld_so_beos";            \
  842.         echo; echo "See Misc/BeOS-NOTES for details.";    \
  843.         ;; \
  844.     esac
  845.  
  846. # Install the dynamically loadable modules
  847. # This goes into $(exec_prefix)
  848. sharedinstall:
  849.     $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
  850.            --prefix=$(prefix) \
  851.         --install-scripts=$(BINDIR) \
  852.         --install-platlib=$(DESTSHARED) \
  853.         --root=/$(DESTDIR)
  854.  
  855. # Here are a couple of targets for MacOSX again, to install a full
  856. # framework-based Python. frameworkinstall installs everything, the
  857. # subtargets install specific parts. Much of the actual work is offloaded to
  858. # the Makefile in Mac/OSX
  859. #
  860. frameworkinstall: frameworkinstallframework \
  861.     frameworkinstallapps frameworkinstallunixtools
  862.  
  863. # On install, we re-make the framework
  864. # structure in the install location, /Library/Frameworks/ or the argument to
  865. # --enable-framework. If --enable-framework has been specified then we have
  866. # automatically set prefix to the location deep down in the framework, so we
  867. # only have to cater for the structural bits of the framework.
  868.  
  869. frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
  870.  
  871. frameworkinstallstructure:    $(LDLIBRARY)
  872.     @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
  873.         echo Not configured with --enable-framework; \
  874.         exit 1; \
  875.     else true; \
  876.     fi
  877.     @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
  878.         if test ! -d $(DESTDIR)$$i; then \
  879.             echo "Creating directory $(DESTDIR)$$i"; \
  880.             $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
  881.         else    true; \
  882.         fi; \
  883.     done
  884.     $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
  885.     $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(DESTDIR)$(prefix)/Resources/Info.plist
  886.     $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(DESTDIR)$(prefix)/Resources/version.plist
  887.     $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
  888.         $(DESTDIR)$(prefix)/Resources/English.lproj/InfoPlist.strings
  889.     $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
  890.     $(LN) -fsn Versions/Current/Python $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Python
  891.     $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
  892.     $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
  893.     $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
  894.  
  895. # This installs Mac/Lib into the framework
  896. frameworkinstallmaclib:
  897.     $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installmacsubtree \
  898.         $(RUNSHARED) BUILDPYTHON=./$(BUILDPYTHON) DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \
  899.         srcdir=$(srcdir) builddir=. prefix=$(prefix) LIBDEST=$(LIBDEST) \
  900.         DESTDIR=$(DESTDIR)
  901.  
  902. # This installs the IDE, the Launcher and other apps into /Applications
  903. frameworkinstallapps:
  904.     $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installapps \
  905.         $(RUNSHARED) BUILDPYTHON=./$(BUILDPYTHON) DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \
  906.         srcdir=$(srcdir) builddir=. DESTDIR=$(DESTDIR) prefix=$(prefix)
  907.  
  908. # This install the unix python and pythonw tools in /usr/local/bin
  909. frameworkinstallunixtools:
  910.     $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installunixtools \
  911.         DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \
  912.         srcdir=$(srcdir) builddir=. DESTDIR=$(DESTDIR) prefix=$(prefix)
  913.  
  914. # This installs the Demos and Tools into the applications directory.
  915. # It is not part of a normal frameworkinstall
  916. frameworkinstallextras:
  917.     $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installextras \
  918.         $(RUNSHARED) BUILDPYTHON=./$(BUILDPYTHON) DIRMODE=$(DIRMODE) FILEMODE=$(FILEMODE) \
  919.         srcdir=$(srcdir) builddir=. DESTDIR=$(DESTDIR)
  920.  
  921. # This installs a few of the useful scripts in Tools/scripts
  922. scriptsinstall:
  923.     SRCDIR=$(srcdir) $(RUNSHARED) \
  924.     ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
  925.     --prefix=$(prefix) \
  926.     --install-scripts=$(BINDIR) \
  927.     --root=/$(DESTDIR)
  928.  
  929. # Build the toplevel Makefile
  930. Makefile.pre: Makefile.pre.in config.status
  931.     CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
  932.     $(MAKE) -f Makefile.pre Makefile
  933.  
  934. # Run the configure script.
  935. config.status:    $(srcdir)/configure
  936.     $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
  937.  
  938. .PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
  939.  
  940. # Some make's put the object file in the current directory
  941. .c.o:
  942.     $(CC) -c $(PY_CFLAGS) -o $@ $<
  943.  
  944. # Rerun configure with the same options as it was run last time,
  945. # provided the config.status script exists
  946. recheck:
  947.     $(SHELL) config.status --recheck
  948.     $(SHELL) config.status
  949.  
  950. # Rebuild the configure script from configure.in; also rebuild pyconfig.h.in
  951. autoconf:
  952.     (cd $(srcdir); autoconf)
  953.     (cd $(srcdir); autoheader)
  954.  
  955. # Create a tags file for vi
  956. tags::
  957.     cd $(srcdir); \
  958.     ctags -w -t Include/*.h; \
  959.     for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \
  960.     done; \
  961.     sort -o tags tags
  962.  
  963. # Create a tags file for GNU Emacs
  964. TAGS::
  965.     cd $(srcdir); \
  966.     etags Include/*.h; \
  967.     for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
  968.  
  969. # Sanitation targets -- clean leaves libraries, executables and tags
  970. # files, which clobber removes those as well
  971.  
  972. clean:
  973.     find . -name '*.o' -exec rm -f {} ';'
  974.     find . -name '*.s[ol]' -exec rm -f {} ';'
  975.     find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
  976.  
  977. clobber: clean
  978.     -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
  979.         tags TAGS \
  980.         config.cache config.log pyconfig.h Modules/config.c
  981.     -rm -rf build platform
  982.     -rm -rf $(PYTHONFRAMEWORKDIR)
  983.  
  984. # Make things extra clean, before making a distribution:
  985. # remove all generated files, even Makefile[.pre]
  986. distclean: clobber
  987.     -rm -f core Makefile Makefile.pre buildno config.status \
  988.         Modules/Setup Modules/Setup.local Modules/Setup.config
  989.     find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
  990.                -o -name '[@,#]*' -o -name '*.old' \
  991.                -o -name '*.orig' -o -name '*.rej' \
  992.                -o -name '*.bak' ')' \
  993.                -exec rm -f {} ';'
  994.  
  995. # Check for smelly exported symbols (not starting with Py/_Py)
  996. smelly: all
  997.     nm -p $(LIBRARY) | \
  998.         sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
  999.  
  1000. # Find files with funny names
  1001. funny:
  1002.     find $(DISTDIRS) -type d \
  1003.         -o -name '*.[chs]' \
  1004.         -o -name '*.py' \
  1005.         -o -name '*.doc' \
  1006.         -o -name '*.sty' \
  1007.         -o -name '*.bib' \
  1008.         -o -name '*.dat' \
  1009.         -o -name '*.el' \
  1010.         -o -name '*.fd' \
  1011.         -o -name '*.in' \
  1012.         -o -name '*.tex' \
  1013.         -o -name '*,[vpt]' \
  1014.         -o -name 'Setup' \
  1015.         -o -name 'Setup.*' \
  1016.         -o -name README \
  1017.         -o -name Makefile \
  1018.         -o -name ChangeLog \
  1019.         -o -name Repository \
  1020.         -o -name Root \
  1021.         -o -name Entries \
  1022.         -o -name Tag \
  1023.         -o -name tags \
  1024.         -o -name TAGS \
  1025.         -o -name .cvsignore \
  1026.         -o -name MANIFEST \
  1027.         -o -print
  1028.  
  1029. # Dependencies
  1030.  
  1031. Python/thread.o:  $(srcdir)/Python/thread_atheos.h $(srcdir)/Python/thread_beos.h $(srcdir)/Python/thread_cthread.h $(srcdir)/Python/thread_foobar.h $(srcdir)/Python/thread_lwp.h $(srcdir)/Python/thread_nt.h $(srcdir)/Python/thread_os2.h $(srcdir)/Python/thread_pth.h $(srcdir)/Python/thread_pthread.h $(srcdir)/Python/thread_sgi.h $(srcdir)/Python/thread_solaris.h $(srcdir)/Python/thread_wince.h
  1032.  
  1033. # Declare targets that aren't real files
  1034. .PHONY: all sharedmods oldsharedmods test quicktest memtest
  1035. .PHONY: install altinstall oldsharedinstall bininstall altbininstall
  1036. .PHONY: maninstall libinstall inclinstall libainstall sharedinstall
  1037. .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
  1038. .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
  1039. .PHONY: recheck autoconf clean clobber distclean smelly funny
  1040.  
  1041. # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
  1042.  
  1043. # Rules appended by makedepend
  1044.  
  1045. Modules/threadmodule.o: $(srcdir)/Modules/threadmodule.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/threadmodule.c -o Modules/threadmodule.o
  1046. Modules/threadmodule$(SO):  Modules/threadmodule.o; $(LDSHARED)  Modules/threadmodule.o   -o Modules/threadmodule$(SO)
  1047. Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/signalmodule.c -o Modules/signalmodule.o
  1048. Modules/signalmodule$(SO):  Modules/signalmodule.o; $(LDSHARED)  Modules/signalmodule.o   -o Modules/signalmodule$(SO)
  1049. Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/posixmodule.c -o Modules/posixmodule.o
  1050. Modules/posixmodule$(SO):  Modules/posixmodule.o; $(LDSHARED)  Modules/posixmodule.o   -o Modules/posixmodule$(SO)
  1051. Modules/errnomodule.o: $(srcdir)/Modules/errnomodule.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/errnomodule.c -o Modules/errnomodule.o
  1052. Modules/errnomodule$(SO):  Modules/errnomodule.o; $(LDSHARED)  Modules/errnomodule.o   -o Modules/errnomodule$(SO)
  1053. Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/pwdmodule.c -o Modules/pwdmodule.o
  1054. Modules/pwdmodule$(SO):  Modules/pwdmodule.o; $(LDSHARED)  Modules/pwdmodule.o   -o Modules/pwdmodule$(SO)
  1055. Modules/_sre.o: $(srcdir)/Modules/_sre.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/_sre.c -o Modules/_sre.o
  1056. Modules/_sre$(SO):  Modules/_sre.o; $(LDSHARED)  Modules/_sre.o   -o Modules/_sre$(SO)
  1057. Modules/_codecsmodule.o: $(srcdir)/Modules/_codecsmodule.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/_codecsmodule.c -o Modules/_codecsmodule.o
  1058. Modules/_codecsmodule$(SO):  Modules/_codecsmodule.o; $(LDSHARED)  Modules/_codecsmodule.o   -o Modules/_codecsmodule$(SO)
  1059. Modules/zipimport.o: $(srcdir)/Modules/zipimport.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/zipimport.c -o Modules/zipimport.o
  1060. Modules/zipimport$(SO):  Modules/zipimport.o; $(LDSHARED)  Modules/zipimport.o   -o Modules/zipimport$(SO)
  1061. Modules/symtablemodule.o: $(srcdir)/Modules/symtablemodule.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/symtablemodule.c -o Modules/symtablemodule.o
  1062. Modules/_symtablemodule$(SO):  Modules/symtablemodule.o; $(LDSHARED)  Modules/symtablemodule.o   -o Modules/_symtablemodule$(SO)
  1063. Modules/xxsubtype.o: $(srcdir)/Modules/xxsubtype.c; $(CC) $(PY_CFLAGS)  -c $(srcdir)/Modules/xxsubtype.c -o Modules/xxsubtype.o
  1064. Modules/xxsubtype$(SO):  Modules/xxsubtype.o; $(LDSHARED)  Modules/xxsubtype.o   -o Modules/xxsubtype$(SO)
  1065.