Added LoggerAdapter class, changed copyright dates, made check for extra parameter...
[python.git] / Makefile.pre.in
blob4133d39dc288a36c7f5afb84deee5504e7d585a2
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:
9 #       ./configure
10 #       make
11 #       make test
12 #       make install
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
17 # additional details.
19 # See also the section "Build instructions" in the README file.
21 # === Variables set by makesetup ===
23 MODOBJS=        _MODOBJS_
24 MODLIBS=        _MODLIBS_
26 # === Variables set by configure
27 VERSION=        @VERSION@
28 srcdir=         @srcdir@
29 VPATH=          @srcdir@
31 CC=             @CC@
32 CXX=            @CXX@
33 MAINCC=         @MAINCC@
34 LINKCC=         @LINKCC@
35 AR=             @AR@
36 RANLIB=         @RANLIB@
37 SVNVERSION=     @SVNVERSION@
39 # Shell used by make (some versions default to the login shell, which is bad)
40 SHELL=          /bin/sh
42 # Use this to make a link between python$(VERSION) and python in $(BINDIR)
43 LN=             @LN@
45 # Portable install script (configure doesn't always guess right)
46 INSTALL=        @INSTALL@
47 INSTALL_PROGRAM=@INSTALL_PROGRAM@
48 INSTALL_SCRIPT= @INSTALL_SCRIPT@
49 INSTALL_DATA=   @INSTALL_DATA@
50 # Shared libraries must be installed with executable mode on some systems;
51 # rather than figuring out exactly which, we always give them executable mode.
52 # Also, making them read-only seems to be a good idea...
53 INSTALL_SHARED= ${INSTALL} -m 555
55 MAKESETUP=      $(srcdir)/Modules/makesetup
57 # Compiler options
58 OPT=            @OPT@
59 BASECFLAGS=     @BASECFLAGS@
60 CFLAGS=         $(BASECFLAGS) $(OPT) $(EXTRA_CFLAGS)
61 # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
62 # be able to build extension modules using the directories specified in the
63 # environment variables
64 CPPFLAGS=       -I. -IInclude -I$(srcdir)/Include @CPPFLAGS@
65 LDFLAGS=        @LDFLAGS@
66 LDLAST=         @LDLAST@
67 SGI_ABI=        @SGI_ABI@
68 CCSHARED=       @CCSHARED@
69 LINKFORSHARED=  @LINKFORSHARED@
70 # Extra C flags added for building the interpreter object files.
71 CFLAGSFORSHARED=@CFLAGSFORSHARED@
72 # C flags used for building the interpreter object files
73 PY_CFLAGS=      $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
76 # Machine-dependent subdirectories
77 MACHDEP=        @MACHDEP@
79 # Install prefix for architecture-independent files
80 prefix=         @prefix@
82 # Install prefix for architecture-dependent files
83 exec_prefix=    @exec_prefix@
85 # Install prefix for data files
86 datarootdir=    @datarootdir@
88 # Expanded directories
89 BINDIR=         $(exec_prefix)/bin
90 LIBDIR=         $(exec_prefix)/lib
91 MANDIR=         @mandir@
92 INCLUDEDIR=     @includedir@
93 CONFINCLUDEDIR= $(exec_prefix)/include
94 SCRIPTDIR=      $(prefix)/lib
96 # Detailed destination directories
97 BINLIBDEST=     $(LIBDIR)/python$(VERSION)
98 LIBDEST=        $(SCRIPTDIR)/python$(VERSION)
99 INCLUDEPY=      $(INCLUDEDIR)/python$(VERSION)
100 CONFINCLUDEPY=  $(CONFINCLUDEDIR)/python$(VERSION)
101 LIBP=           $(LIBDIR)/python$(VERSION)
103 # Symbols used for using shared libraries
104 SO=             @SO@
105 LDSHARED=       @LDSHARED@
106 BLDSHARED=      @BLDSHARED@
107 DESTSHARED=     $(BINLIBDEST)/lib-dynload
109 # Executable suffix (.exe on Windows and Mac OS X)
110 EXE=            @EXEEXT@
111 BUILDEXE=       @BUILDEXEEXT@
113 # Short name and location for Mac OS X Python framework
114 UNIVERSALSDK=@UNIVERSALSDK@
115 PYTHONFRAMEWORK=        @PYTHONFRAMEWORK@
116 PYTHONFRAMEWORKDIR=     @PYTHONFRAMEWORKDIR@
117 PYTHONFRAMEWORKPREFIX=  @PYTHONFRAMEWORKPREFIX@
118 PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
119 # Deployment target selected during configure, to be checked
120 # by distutils. The export statement is needed to ensure that the
121 # deployment target is active during build.
122 MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
123 @EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
125 # Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
126 OTHER_LIBTOOL_OPT=@OTHER_LIBTOOL_OPT@
128 # Environment to run shared python without installed libraries
129 RUNSHARED=       @RUNSHARED@
131 # Modes for directories, executables and data files created by the
132 # install process.  Default to user-only-writable for all file types.
133 DIRMODE=        755
134 EXEMODE=        755
135 FILEMODE=       644
137 # configure script arguments
138 CONFIG_ARGS=    @CONFIG_ARGS@
141 # Subdirectories with code
142 SRCDIRS=        @SRCDIRS@
144 # Other subdirectories
145 SUBDIRSTOO=     Include Lib Misc Demo
147 # Files and directories to be distributed
148 CONFIGFILES=    configure configure.in acconfig.h pyconfig.h.in Makefile.pre.in
149 DISTFILES=      README ChangeLog $(CONFIGFILES)
150 DISTDIRS=       $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
151 DIST=           $(DISTFILES) $(DISTDIRS)
154 LIBRARY=        @LIBRARY@
155 LDLIBRARY=      @LDLIBRARY@
156 BLDLIBRARY=     @BLDLIBRARY@
157 DLLLIBRARY=     @DLLLIBRARY@
158 LDLIBRARYDIR=   @LDLIBRARYDIR@
159 INSTSONAME=     @INSTSONAME@
162 LIBS=           @LIBS@
163 LIBM=           @LIBM@
164 LIBC=           @LIBC@
165 SYSLIBS=        $(LIBM) $(LIBC)
166 SHLIBS=         @SHLIBS@
168 THREADOBJ=      @THREADOBJ@
169 DLINCLDIR=      @DLINCLDIR@
170 DYNLOADFILE=    @DYNLOADFILE@
171 MACHDEP_OBJS=   @MACHDEP_OBJS@
172 LIBOBJDIR=      Python/
173 LIBOBJS=        @LIBOBJS@
174 UNICODE_OBJS=   @UNICODE_OBJS@
176 PYTHON=         python$(EXE)
177 BUILDPYTHON=    python$(BUILDEXE)
179 # === Definitions added by makesetup ===
182 ##########################################################################
183 # Modules
184 MODULE_OBJS=    \
185                 Modules/config.o \
186                 Modules/getpath.o \
187                 Modules/main.o \
188                 Modules/gcmodule.o
190 # Used of signalmodule.o is not available
191 SIGNAL_OBJS=    @SIGNAL_OBJS@
194 ##########################################################################
195 # Grammar
196 GRAMMAR_H=      $(srcdir)/Include/graminit.h
197 GRAMMAR_C=      $(srcdir)/Python/graminit.c
198 GRAMMAR_INPUT=  $(srcdir)/Grammar/Grammar
201 ##########################################################################
202 # Parser
203 PGEN=           Parser/pgen$(EXE)
205 POBJS=          \
206                 Parser/acceler.o \
207                 Parser/grammar1.o \
208                 Parser/listnode.o \
209                 Parser/node.o \
210                 Parser/parser.o \
211                 Parser/parsetok.o \
212                 Parser/bitset.o \
213                 Parser/metagrammar.o \
214                 Parser/firstsets.o \
215                 Parser/grammar.o \
216                 Parser/pgen.o
218 PARSER_OBJS=    $(POBJS) Parser/myreadline.o Parser/tokenizer.o
220 PGOBJS=         \
221                 Objects/obmalloc.o \
222                 Python/mysnprintf.o \
223                 Parser/tokenizer_pgen.o \
224                 Parser/printgrammar.o \
225                 Parser/pgenmain.o
227 PGENOBJS=       $(PGENMAIN) $(POBJS) $(PGOBJS)
229 ##########################################################################
230 # AST
231 AST_H_DIR=      $(srcdir)/Include
232 AST_H=          $(AST_H_DIR)/Python-ast.h
233 AST_C_DIR=      $(srcdir)/Python
234 AST_C=          $(AST_C_DIR)/Python-ast.c
235 AST_ASDL=       $(srcdir)/Parser/Python.asdl
237 ASDLGEN_FILES=  $(srcdir)/Parser/asdl.py $(srcdir)/Parser/asdl_c.py
238 # XXX Note that a build now requires Python exist before the build starts
239 ASDLGEN=        $(srcdir)/Parser/asdl_c.py
241 ##########################################################################
242 # Python
243 PYTHON_OBJS=    \
244                 Python/Python-ast.o \
245                 Python/asdl.o \
246                 Python/ast.o \
247                 Python/bltinmodule.o \
248                 Python/ceval.o \
249                 Python/compile.o \
250                 Python/codecs.o \
251                 Python/errors.o \
252                 Python/frozen.o \
253                 Python/frozenmain.o \
254                 Python/future.o \
255                 Python/getargs.o \
256                 Python/getcompiler.o \
257                 Python/getcopyright.o \
258                 Python/getmtime.o \
259                 Python/getplatform.o \
260                 Python/getversion.o \
261                 Python/graminit.o \
262                 Python/import.o \
263                 Python/importdl.o \
264                 Python/marshal.o \
265                 Python/modsupport.o \
266                 Python/mystrtoul.o \
267                 Python/mysnprintf.o \
268                 Python/peephole.o \
269                 Python/pyarena.o \
270                 Python/pyfpe.o \
271                 Python/pystate.o \
272                 Python/pythonrun.o \
273                 Python/structmember.o \
274                 Python/symtable.o \
275                 Python/sysmodule.o \
276                 Python/traceback.o \
277                 Python/getopt.o \
278                 Python/pystrcmp.o \
279                 Python/pystrtod.o \
280                 Python/$(DYNLOADFILE) \
281                 $(LIBOBJS) \
282                 $(MACHDEP_OBJS) \
283                 $(THREADOBJ)
286 ##########################################################################
287 # Objects
288 OBJECT_OBJS=    \
289                 Objects/abstract.o \
290                 Objects/boolobject.o \
291                 Objects/bufferobject.o \
292                 Objects/cellobject.o \
293                 Objects/classobject.o \
294                 Objects/cobject.o \
295                 Objects/codeobject.o \
296                 Objects/complexobject.o \
297                 Objects/descrobject.o \
298                 Objects/enumobject.o \
299                 Objects/exceptions.o \
300                 Objects/genobject.o \
301                 Objects/fileobject.o \
302                 Objects/floatobject.o \
303                 Objects/frameobject.o \
304                 Objects/funcobject.o \
305                 Objects/intobject.o \
306                 Objects/iterobject.o \
307                 Objects/listobject.o \
308                 Objects/longobject.o \
309                 Objects/dictobject.o \
310                 Objects/methodobject.o \
311                 Objects/moduleobject.o \
312                 Objects/object.o \
313                 Objects/obmalloc.o \
314                 Objects/rangeobject.o \
315                 Objects/setobject.o \
316                 Objects/sliceobject.o \
317                 Objects/stringobject.o \
318                 Objects/structseq.o \
319                 Objects/tupleobject.o \
320                 Objects/typeobject.o \
321                 Objects/weakrefobject.o \
322                 $(UNICODE_OBJS)
325 ##########################################################################
326 # objects that get linked into the Python library
327 LIBRARY_OBJS=   \
328                 Modules/_typesmodule.o \
329                 Modules/getbuildinfo.o \
330                 $(PARSER_OBJS) \
331                 $(OBJECT_OBJS) \
332                 $(PYTHON_OBJS) \
333                 $(MODULE_OBJS) \
334                 $(SIGNAL_OBJS) \
335                 $(MODOBJS)
337 #########################################################################
338 # Rules
340 # Default target
341 all:            build_all
342 build_all:      $(BUILDPYTHON) oldsharedmods sharedmods
344 # Build the interpreter
345 $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
346                 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
347                         Modules/python.o \
348                         $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
350 platform: $(BUILDPYTHON)
351         $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
354 # Build the shared modules
355 sharedmods: $(BUILDPYTHON)
356         @case $$MAKEFLAGS in \
357         *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
358         *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
359         esac
361 # Build static library
362 # avoid long command lines, same as LIBRARY_OBJS
363 $(LIBRARY): $(LIBRARY_OBJS)
364         -rm -f $@
365         $(AR) cr $@ Modules/getbuildinfo.o
366         $(AR) cr $@ Modules/_typesmodule.o
367         $(AR) cr $@ $(PARSER_OBJS)
368         $(AR) cr $@ $(OBJECT_OBJS)
369         $(AR) cr $@ $(PYTHON_OBJS)
370         $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
371         $(AR) cr $@ $(MODOBJS)
372         $(RANLIB) $@
374 libpython$(VERSION).so: $(LIBRARY_OBJS)
375         if test $(INSTSONAME) != $(LDLIBRARY); then \
376                 $(LDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
377                 $(LN) -f $(INSTSONAME) $@; \
378         else\
379                 $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
380         fi
382 libpython$(VERSION).sl: $(LIBRARY_OBJS)
383         $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM)
385 # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
386 # minimal framework (not including the Lib directory and such) in the current
387 # directory.
388 RESSRCDIR=$(srcdir)/Mac/Resources/framework
389 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
390                 $(LIBRARY) \
391                 $(RESSRCDIR)/Info.plist \
392                 $(RESSRCDIR)/version.plist \
393                 $(RESSRCDIR)/English.lproj/InfoPlist.strings
394         $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
395         if test "${UNIVERSALSDK}"; then \
396                 $(CC) -o $(LDLIBRARY) -arch i386 -arch ppc -dynamiclib \
397                         -isysroot "${UNIVERSALSDK}" \
398                         -all_load $(LIBRARY) -Wl,-single_module \
399                         -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/Python \
400                         -compatibility_version $(VERSION) \
401                         -current_version $(VERSION); \
402         else \
403                 /usr/bin/libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \
404                         @LIBTOOL_CRUFT@ ;\
405         fi
406         $(INSTALL) -d -m $(DIRMODE)  \
407                 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
408         $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
409                 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
410         $(INSTALL_DATA) $(RESSRCDIR)/version.plist \
411                 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/version.plist
412         $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
413                 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj/InfoPlist.strings
414         $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
415         $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
416         $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
417         $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
419 # This rule builds the Cygwin Python DLL and import library if configured
420 # for a shared core library; otherwise, this rule is a noop.
421 $(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
422         if test -n "$(DLLLIBRARY)"; then \
423                 $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
424                         $(LIBS) $(MODLIBS) $(SYSLIBS); \
425         else true; \
426         fi
429 oldsharedmods: $(SHAREDMODS)
432 Makefile Modules/config.c: Makefile.pre \
433                                 $(srcdir)/Modules/config.c.in \
434                                 $(MAKESETUP) \
435                                 Modules/Setup.config \
436                                 Modules/Setup \
437                                 Modules/Setup.local
438         $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
439                                 -s Modules \
440                                 Modules/Setup.config \
441                                 Modules/Setup.local \
442                                 Modules/Setup
443         @mv config.c Modules
444         @echo "The Makefile was updated, you may need to re-run make."
447 Modules/Setup: $(srcdir)/Modules/Setup.dist
448         @if test -f Modules/Setup; then \
449                 echo "-----------------------------------------------"; \
450                 echo "Modules/Setup.dist is newer than Modules/Setup;"; \
451                 echo "check to make sure you have all the updates you"; \
452                 echo "need in your Modules/Setup file."; \
453                 echo "Usually, copying Setup.dist to Setup will work."; \
454                 echo "-----------------------------------------------"; \
455         fi
457 ############################################################################
458 # Special rules for object files
460 Modules/getbuildinfo.o: $(PARSER_OBJS) \
461                 $(OBJECT_OBJS) \
462                 $(PYTHON_OBJS) \
463                 $(MODULE_OBJS) \
464                 $(SIGNAL_OBJS) \
465                 $(MODOBJS) \
466                 $(srcdir)/Modules/getbuildinfo.c
467         $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
469 Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
470         $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
471                 -DPREFIX='"$(prefix)"' \
472                 -DEXEC_PREFIX='"$(exec_prefix)"' \
473                 -DVERSION='"$(VERSION)"' \
474                 -DVPATH='"$(VPATH)"' \
475                 -o $@ $(srcdir)/Modules/getpath.c
477 Modules/python.o: $(srcdir)/Modules/python.c
478         $(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
481 $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
482                 -@$(INSTALL) -d Include
483                 -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
485 $(PGEN):        $(PGENOBJS)
486                 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
488 Parser/grammar.o:       $(srcdir)/Parser/grammar.c \
489                                 $(srcdir)/Include/token.h \
490                                 $(srcdir)/Include/grammar.h
491 Parser/metagrammar.o:   $(srcdir)/Parser/metagrammar.c
493 Parser/tokenizer_pgen.o:        $(srcdir)/Parser/tokenizer.c
495 Parser/pgenmain.o:      $(srcdir)/Include/parsetok.h
497 $(AST_H): $(AST_ASDL) $(ASDLGEN_FILES)
498         $(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL)
500 $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
501         $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL)
503 Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H)
505 Python/getplatform.o: $(srcdir)/Python/getplatform.c
506                 $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
508 Python/importdl.o: $(srcdir)/Python/importdl.c
509                 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
511 Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
512                                 $(srcdir)/Objects/unicodetype_db.h
514 ############################################################################
515 # Header files
517 PYTHON_HEADERS= \
518                 Include/Python.h \
519                 Include/Python-ast.h \
520                 Include/asdl.h \
521                 Include/abstract.h \
522                 Include/boolobject.h \
523                 Include/bufferobject.h \
524                 Include/ceval.h \
525                 Include/classobject.h \
526                 Include/cobject.h \
527                 Include/code.h \
528                 Include/codecs.h \
529                 Include/compile.h \
530                 Include/complexobject.h \
531                 Include/descrobject.h \
532                 Include/dictobject.h \
533                 Include/enumobject.h \
534                 Include/genobject.h \
535                 Include/fileobject.h \
536                 Include/floatobject.h \
537                 Include/funcobject.h \
538                 Include/import.h \
539                 Include/intobject.h \
540                 Include/intrcheck.h \
541                 Include/iterobject.h \
542                 Include/listobject.h \
543                 Include/longobject.h \
544                 Include/methodobject.h \
545                 Include/modsupport.h \
546                 Include/moduleobject.h \
547                 Include/object.h \
548                 Include/objimpl.h \
549                 Include/parsetok.h \
550                 Include/patchlevel.h \
551                 Include/pyarena.h \
552                 Include/pydebug.h \
553                 Include/pyerrors.h \
554                 Include/pyfpe.h \
555                 Include/pymem.h \
556                 Include/pyport.h \
557                 Include/pystate.h \
558                 Include/pystrtod.h \
559                 Include/pystrcmp.h \
560                 Include/pythonrun.h \
561                 Include/rangeobject.h \
562                 Include/setobject.h \
563                 Include/sliceobject.h \
564                 Include/stringobject.h \
565                 Include/structseq.h \
566                 Include/structmember.h \
567                 Include/symtable.h \
568                 Include/sysmodule.h \
569                 Include/traceback.h \
570                 Include/tupleobject.h \
571                 Include/unicodeobject.h \
572                 Include/weakrefobject.h \
573                 pyconfig.h
575 $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
578 ######################################################################
580 # Test the interpreter (twice, once without .pyc files, once with)
581 # In the past, we've had problems where bugs in the marshalling or
582 # elsewhere caused bytecode read from .pyc files to behave differently
583 # than bytecode generated directly from a .py source file.  Sometimes
584 # the bytecode read from a .pyc file had the bug, somtimes the directly
585 # generated bytecode.  This is sometimes a very shy bug needing a lot of
586 # sample data.
588 TESTOPTS=       -l $(EXTRATESTOPTS)
589 TESTPROG=       $(srcdir)/Lib/test/regrtest.py
590 TESTPYTHON=     $(RUNSHARED) ./$(BUILDPYTHON) -E -tt
591 test:           all platform
592                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
593                 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
594                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
596 testall:        all platform
597                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
598                 $(TESTPYTHON) Lib/compileall.py
599                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
600                 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
601                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
603 #  Run the unitests for both architectures in a Universal build on OSX
604 #  Must be run on an Intel box.
605 testuniversal:  all platform
606                 if [ `arch` != 'i386' ];then \
607                         echo "This can only be used on OSX/i386" ;\
608                         exit 1 ;\
609                 fi
610                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
611                 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
612                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
613                 $(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E -tt $(TESTPROG) $(TESTOPTS) -uall
616 # Like testall, but with a single pass only
617 # run an optional script to include some information about the build environment
618 buildbottest:   all platform
619                 -@if which pybuildbot.identify >/dev/null 2>&1; then \
620                         pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
621                 fi
622                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall -rw
624 QUICKTESTOPTS=  $(TESTOPTS) -x test_thread test_signal test_strftime \
625                 test_unicodedata test_re test_sre test_select test_poll \
626                 test_linuxaudiodev test_struct test_sunaudiodev test_zlib
627 quicktest:      all platform
628                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
629                 -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
630                 $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
632 MEMTESTOPTS=    $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
633                 test_longexp
634 memtest:        all platform
635                 -rm -f $(srcdir)/Lib/test/*.py[co]
636                 -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
637                 $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
639 # Install everything
640 install:        @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@
642 # Install almost everything without disturbing previous versions
643 altinstall:     @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \
644                 sharedinstall oldsharedinstall @FRAMEWORKALTINSTALLLAST@
646 # Install shared libraries enabled by Setup
647 DESTDIRS=       $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
649 oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
650                 @for i in X $(SHAREDMODS); do \
651                   if test $$i != X; then \
652                     echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
653                     $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
654                   fi; \
655                 done
657 $(DESTSHARED):
658                 @for i in $(DESTDIRS); \
659                 do \
660                         if test ! -d $(DESTDIR)$$i; then \
661                                 echo "Creating directory $$i"; \
662                                 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
663                         else    true; \
664                         fi; \
665                 done
668 # Install the interpreter (by creating a hard link to python$(VERSION))
669 bininstall:     altbininstall
670         -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON); \
671         then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
672         else true; \
673         fi
674         (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
675         -rm -f $(DESTDIR)$(BINDIR)/python-config
676         (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config)
678 # Install the interpreter with $(VERSION) affixed
679 # This goes into $(exec_prefix)
680 altbininstall:  $(BUILDPYTHON)
681         @for i in $(BINDIR) $(LIBDIR); \
682         do \
683                 if test ! -d $(DESTDIR)$$i; then \
684                         echo "Creating directory $$i"; \
685                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
686                 else    true; \
687                 fi; \
688         done
689         $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
690         if test -f libpython$(VERSION)$(SO); then \
691                 if test "$(SO)" = .dll; then \
692                         $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \
693                 else \
694                         $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
695                         if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \
696                                 (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \
697                         fi \
698                 fi; \
699         else    true; \
700         fi
702 # Install the manual page
703 maninstall:
704         @for i in $(MANDIR) $(MANDIR)/man1; \
705         do \
706                 if test ! -d $(DESTDIR)$$i; then \
707                         echo "Creating directory $$i"; \
708                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
709                 else    true; \
710                 fi; \
711         done
712         $(INSTALL_DATA) $(srcdir)/Misc/python.man \
713                 $(DESTDIR)$(MANDIR)/man1/python.1
715 # Install the library
716 PLATDIR=        plat-$(MACHDEP)
717 EXTRAPLATDIR= @EXTRAPLATDIR@
718 EXTRAMACHDEPPATH=@EXTRAMACHDEPPATH@
719 MACHDEPS=       $(PLATDIR) $(EXTRAPLATDIR)
720 XMLLIBSUBDIRS=  xml xml/dom xml/etree xml/parsers xml/sax
721 PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
722         plat-mac/lib-scriptpackages/_builtinSuites \
723         plat-mac/lib-scriptpackages/CodeWarrior \
724         plat-mac/lib-scriptpackages/Explorer \
725         plat-mac/lib-scriptpackages/Finder \
726         plat-mac/lib-scriptpackages/Netscape \
727         plat-mac/lib-scriptpackages/StdSuites \
728         plat-mac/lib-scriptpackages/SystemEvents \
729         plat-mac/lib-scriptpackages/Terminal 
730 PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
731 LIBSUBDIRS=     lib-tk site-packages test test/output test/data \
732                 test/decimaltestdata \
733                 encodings compiler hotshot \
734                 email email/mime email/test email/test/data \
735                 sqlite3 sqlite3/test \
736                 logging bsddb bsddb/test csv wsgiref \
737                 ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \
738                 distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
739                 setuptools setuptools/command setuptools/tests setuptools.egg-info \
740                 curses $(MACHDEPS)
741 libinstall:     build_all $(srcdir)/Lib/$(PLATDIR)
742         @for i in $(SCRIPTDIR) $(LIBDEST); \
743         do \
744                 if test ! -d $(DESTDIR)$$i; then \
745                         echo "Creating directory $$i"; \
746                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
747                 else    true; \
748                 fi; \
749         done
750         @for d in $(LIBSUBDIRS); \
751         do \
752                 a=$(srcdir)/Lib/$$d; \
753                 if test ! -d $$a; then continue; else true; fi; \
754                 b=$(LIBDEST)/$$d; \
755                 if test ! -d $(DESTDIR)$$b; then \
756                         echo "Creating directory $$b"; \
757                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
758                 else    true; \
759                 fi; \
760         done
761         @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \
762         do \
763                 if test -x $$i; then \
764                         $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
765                         echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
766                 else \
767                         $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
768                         echo $(INSTALL_DATA) $$i $(LIBDEST); \
769                 fi; \
770         done
771         @for d in $(LIBSUBDIRS); \
772         do \
773                 a=$(srcdir)/Lib/$$d; \
774                 if test ! -d $$a; then continue; else true; fi; \
775                 if test `ls $$a | wc -l` -lt 1; then continue; fi; \
776                 b=$(LIBDEST)/$$d; \
777                 for i in $$a/*; \
778                 do \
779                         case $$i in \
780                         *CVS) ;; \
781                         *.py[co]) ;; \
782                         *.orig) ;; \
783                         *~) ;; \
784                         *) \
785                                 if test -d $$i; then continue; fi; \
786                                 if test -x $$i; then \
787                                     echo $(INSTALL_SCRIPT) $$i $$b; \
788                                     $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
789                                 else \
790                                     echo $(INSTALL_DATA) $$i $$b; \
791                                     $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
792                                 fi;; \
793                         esac; \
794                 done; \
795         done
796         $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
797         PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
798                 ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
799                 -d $(LIBDEST) -f \
800                 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
801         PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
802                 ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
803                 -d $(LIBDEST) -f \
804                 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
805         -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
806                 ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
807                 -d $(LIBDEST)/site-packages -f \
808                 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
809         -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
810                 ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
811                 -d $(LIBDEST)/site-packages -f \
812                 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
814 # Create the PLATDIR source directory, if one wasn't distributed..
815 $(srcdir)/Lib/$(PLATDIR):
816         mkdir $(srcdir)/Lib/$(PLATDIR)
817         cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
818         export PATH; PATH="`pwd`:$$PATH"; \
819         export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
820         export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
821         export EXE; EXE="$(BUILDEXE)"; \
822         cd $(srcdir)/Lib/$(PLATDIR); ./regen
824 # Install the include files
825 INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
826 inclinstall:
827         @for i in $(INCLDIRSTOMAKE); \
828         do \
829                 if test ! -d $(DESTDIR)$$i; then \
830                         echo "Creating directory $$i"; \
831                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
832                 else    true; \
833                 fi; \
834         done
835         @for i in $(srcdir)/Include/*.h; \
836         do \
837                 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
838                 $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
839         done
840         $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
842 # Install the library and miscellaneous stuff needed for extending/embedding
843 # This goes into $(exec_prefix)
844 LIBPL=          $(LIBP)/config
845 libainstall:    all
846         @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
847         do \
848                 if test ! -d $(DESTDIR)$$i; then \
849                         echo "Creating directory $$i"; \
850                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
851                 else    true; \
852                 fi; \
853         done
854         @if test -d $(LIBRARY); then :; else \
855                 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
856                         if test "$(SO)" = .dll; then \
857                                 $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
858                         else \
859                                 $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
860                                 $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
861                         fi; \
862                 else \
863                         echo Skip install of $(LIBRARY) - use make frameworkinstall; \
864                 fi; \
865         fi
866         $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
867         $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
868         $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
869         $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
870         $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
871         $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
872         $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
873         $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
874         $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
875         # Substitution happens here, as the completely-expanded BINDIR
876         # is not available in configure
877         sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
878         $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
879         rm python-config
880         @if [ -s Modules/python.exp -a \
881                 "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
882                 echo; echo "Installing support files for building shared extension modules on AIX:"; \
883                 $(INSTALL_DATA) Modules/python.exp              \
884                                 $(DESTDIR)$(LIBPL)/python.exp;          \
885                 echo; echo "$(LIBPL)/python.exp";               \
886                 $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix  \
887                                 $(DESTDIR)$(LIBPL)/makexp_aix;          \
888                 echo "$(LIBPL)/makexp_aix";                     \
889                 $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix   \
890                                 $(DESTDIR)$(LIBPL)/ld_so_aix;           \
891                 echo "$(LIBPL)/ld_so_aix";                      \
892                 echo; echo "See Misc/AIX-NOTES for details.";   \
893         else true; \
894         fi
895         @case "$(MACHDEP)" in beos*) \
896                 echo; echo "Installing support files for building shared extension modules on BeOS:"; \
897                 $(INSTALL_DATA) Misc/BeOS-NOTES $(DESTDIR)$(LIBPL)/README;      \
898                 echo; echo "$(LIBPL)/README";                   \
899                 $(INSTALL_SCRIPT) Modules/ar_beos $(DESTDIR)$(LIBPL)/ar_beos; \
900                 echo "$(LIBPL)/ar_beos";                        \
901                 $(INSTALL_SCRIPT) Modules/ld_so_beos $(DESTDIR)$(LIBPL)/ld_so_beos; \
902                 echo "$(LIBPL)/ld_so_beos";                     \
903                 echo; echo "See Misc/BeOS-NOTES for details.";  \
904                 ;; \
905         esac
907 # Install the dynamically loadable modules
908 # This goes into $(exec_prefix)
909 sharedinstall:
910         $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
911                 --prefix=$(prefix) \
912                 --install-scripts=$(BINDIR) \
913                 --install-platlib=$(DESTSHARED) \
914                 --root=/$(DESTDIR)
916 # Here are a couple of targets for MacOSX again, to install a full
917 # framework-based Python. frameworkinstall installs everything, the
918 # subtargets install specific parts. Much of the actual work is offloaded to
919 # the Makefile in Mac
922 # This target is here for backward compatiblity, previous versions of Python
923 # hadn't integrated framework installation in the normal install process.
924 frameworkinstall: install
926 # On install, we re-make the framework
927 # structure in the install location, /Library/Frameworks/ or the argument to
928 # --enable-framework. If --enable-framework has been specified then we have
929 # automatically set prefix to the location deep down in the framework, so we
930 # only have to cater for the structural bits of the framework.
932 frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
934 frameworkinstallstructure:      $(LDLIBRARY)
935         @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
936                 echo Not configured with --enable-framework; \
937                 exit 1; \
938         else true; \
939         fi
940         @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
941                 if test ! -d $(DESTDIR)$$i; then \
942                         echo "Creating directory $(DESTDIR)$$i"; \
943                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
944                 else    true; \
945                 fi; \
946         done
947         $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
948         $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(DESTDIR)$(prefix)/Resources/Info.plist
949         $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(DESTDIR)$(prefix)/Resources/version.plist
950         $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
951                 $(DESTDIR)$(prefix)/Resources/English.lproj/InfoPlist.strings
952         $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
953         $(LN) -fsn Versions/Current/Python $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Python
954         $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
955         $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
956         $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
958 # This installs Mac/Lib into the framework
959 # Install a number of symlinks to keep software that expects a normal unix
960 # install (which includes python-config) happy.
961 frameworkinstallmaclib:
962         ln -fs "../../../Python" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a"
963         cd Mac && $(MAKE) installmacsubtree DESTDIR="$(DESTDIR)"
965 # This installs the IDE, the Launcher and other apps into /Applications
966 frameworkinstallapps:
967         cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
969 # This install the unix python and pythonw tools in /usr/local/bin
970 frameworkinstallunixtools:
971         cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
973 frameworkaltinstallunixtools:
974         cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"
976 # This installs the Demos and Tools into the applications directory.
977 # It is not part of a normal frameworkinstall
978 frameworkinstallextras:
979         cd Mac && Make installextras DESTDIR="$(DESTDIR)"
981 # This installs a few of the useful scripts in Tools/scripts
982 scriptsinstall:
983         SRCDIR=$(srcdir) $(RUNSHARED) \
984         ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
985         --prefix=$(prefix) \
986         --install-scripts=$(BINDIR) \
987         --root=/$(DESTDIR)
989 # Build the toplevel Makefile
990 Makefile.pre: Makefile.pre.in config.status
991         CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
992         $(MAKE) -f Makefile.pre Makefile
994 # Run the configure script.
995 config.status:  $(srcdir)/configure
996         $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
998 .PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
1000 # Some make's put the object file in the current directory
1001 .c.o:
1002         $(CC) -c $(PY_CFLAGS) -o $@ $<
1004 # Run reindent on the library
1005 reindent:
1006         ./python$(EXEEXT) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
1008 # Rerun configure with the same options as it was run last time,
1009 # provided the config.status script exists
1010 recheck:
1011         $(SHELL) config.status --recheck
1012         $(SHELL) config.status
1014 # Rebuild the configure script from configure.in; also rebuild pyconfig.h.in
1015 autoconf:
1016         (cd $(srcdir); autoconf)
1017         (cd $(srcdir); autoheader)
1019 # Create a tags file for vi
1020 tags::
1021         cd $(srcdir); \
1022         ctags -w -t Include/*.h; \
1023         for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \
1024         done; \
1025         sort -o tags tags
1027 # Create a tags file for GNU Emacs
1028 TAGS::
1029         cd $(srcdir); \
1030         etags Include/*.h; \
1031         for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
1033 # Sanitation targets -- clean leaves libraries, executables and tags
1034 # files, which clobber removes those as well
1035 pycremoval:
1036         find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
1038 clean: pycremoval
1039         find . -name '*.o' -exec rm -f {} ';'
1040         find . -name '*.s[ol]' -exec rm -f {} ';'
1041         find $(srcdir)/build -name 'fficonfig.h' -exec rm -f {} ';' || true
1042         find $(srcdir)/build -name 'fficonfig.py' -exec rm -f {} ';' || true
1044 clobber: clean
1045         -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
1046                 tags TAGS \
1047                 config.cache config.log pyconfig.h Modules/config.c
1048         -rm -rf build platform
1049         -rm -rf $(PYTHONFRAMEWORKDIR)
1051 # Make things extra clean, before making a distribution:
1052 # remove all generated files, even Makefile[.pre]
1053 # Keep configure and Python-ast.[ch], it's possible they can't be generated
1054 distclean: clobber
1055         -rm -f core Makefile Makefile.pre config.status \
1056                 Modules/Setup Modules/Setup.local Modules/Setup.config
1057         find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
1058                            -o -name '[@,#]*' -o -name '*.old' \
1059                            -o -name '*.orig' -o -name '*.rej' \
1060                            -o -name '*.bak' ')' \
1061                            -exec rm -f {} ';'
1063 # Check for smelly exported symbols (not starting with Py/_Py)
1064 smelly: all
1065         nm -p $(LIBRARY) | \
1066                 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
1068 # Find files with funny names
1069 funny:
1070         find $(DISTDIRS) -type d \
1071                 -o -name '*.[chs]' \
1072                 -o -name '*.py' \
1073                 -o -name '*.doc' \
1074                 -o -name '*.sty' \
1075                 -o -name '*.bib' \
1076                 -o -name '*.dat' \
1077                 -o -name '*.el' \
1078                 -o -name '*.fd' \
1079                 -o -name '*.in' \
1080                 -o -name '*.tex' \
1081                 -o -name '*,[vpt]' \
1082                 -o -name 'Setup' \
1083                 -o -name 'Setup.*' \
1084                 -o -name README \
1085                 -o -name Makefile \
1086                 -o -name ChangeLog \
1087                 -o -name Repository \
1088                 -o -name Root \
1089                 -o -name Entries \
1090                 -o -name Tag \
1091                 -o -name tags \
1092                 -o -name TAGS \
1093                 -o -name .cvsignore \
1094                 -o -name MANIFEST \
1095                 -o -print
1097 # Dependencies
1099 Python/thread.o: @THREADHEADERS@
1101 # Declare targets that aren't real files
1102 .PHONY: all build_all sharedmods oldsharedmods test quicktest memtest
1103 .PHONY: install altinstall oldsharedinstall bininstall altbininstall
1104 .PHONY: maninstall libinstall inclinstall libainstall sharedinstall
1105 .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
1106 .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
1107 .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean 
1108 .PHONY: smelly funny
1110 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY