issue1597011: Fix for bz2 module corner-case error due to error checking bug.
[python.git] / Makefile.pre.in
blobeaefb07c7f8da6e0e702f30b78d6e895a270594c
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 UNICODE_OBJS=   @UNICODE_OBJS@
174 PYTHON=         python$(EXE)
175 BUILDPYTHON=    python$(BUILDEXE)
177 # === Definitions added by makesetup ===
180 ##########################################################################
181 # Modules
182 MODULE_OBJS=    \
183                 Modules/config.o \
184                 Modules/getpath.o \
185                 Modules/main.o \
186                 Modules/gcmodule.o
188 # Used of signalmodule.o is not available
189 SIGNAL_OBJS=    @SIGNAL_OBJS@
192 ##########################################################################
193 # Grammar
194 GRAMMAR_H=      $(srcdir)/Include/graminit.h
195 GRAMMAR_C=      $(srcdir)/Python/graminit.c
196 GRAMMAR_INPUT=  $(srcdir)/Grammar/Grammar
199 ##########################################################################
200 # Parser
201 PGEN=           Parser/pgen$(EXE)
203 POBJS=          \
204                 Parser/acceler.o \
205                 Parser/grammar1.o \
206                 Parser/listnode.o \
207                 Parser/node.o \
208                 Parser/parser.o \
209                 Parser/parsetok.o \
210                 Parser/bitset.o \
211                 Parser/metagrammar.o \
212                 Parser/firstsets.o \
213                 Parser/grammar.o \
214                 Parser/pgen.o
216 PARSER_OBJS=    $(POBJS) Parser/myreadline.o Parser/tokenizer.o
218 PGOBJS=         \
219                 Objects/obmalloc.o \
220                 Python/mysnprintf.o \
221                 Parser/tokenizer_pgen.o \
222                 Parser/printgrammar.o \
223                 Parser/pgenmain.o
225 PGENOBJS=       $(PGENMAIN) $(POBJS) $(PGOBJS)
227 ##########################################################################
228 # AST
229 AST_H_DIR=      $(srcdir)/Include
230 AST_H=          $(AST_H_DIR)/Python-ast.h
231 AST_C_DIR=      $(srcdir)/Python
232 AST_C=          $(AST_C_DIR)/Python-ast.c
233 AST_ASDL=       $(srcdir)/Parser/Python.asdl
235 ASDLGEN_FILES=  $(srcdir)/Parser/asdl.py $(srcdir)/Parser/asdl_c.py
236 # XXX Note that a build now requires Python exist before the build starts
237 ASDLGEN=        $(srcdir)/Parser/asdl_c.py
239 ##########################################################################
240 # Python
241 PYTHON_OBJS=    \
242                 Python/Python-ast.o \
243                 Python/asdl.o \
244                 Python/ast.o \
245                 Python/bltinmodule.o \
246                 Python/ceval.o \
247                 Python/compile.o \
248                 Python/codecs.o \
249                 Python/errors.o \
250                 Python/frozen.o \
251                 Python/frozenmain.o \
252                 Python/future.o \
253                 Python/getargs.o \
254                 Python/getcompiler.o \
255                 Python/getcopyright.o \
256                 Python/getmtime.o \
257                 Python/getplatform.o \
258                 Python/getversion.o \
259                 Python/graminit.o \
260                 Python/import.o \
261                 Python/importdl.o \
262                 Python/marshal.o \
263                 Python/modsupport.o \
264                 Python/mystrtoul.o \
265                 Python/mysnprintf.o \
266                 Python/peephole.o \
267                 Python/pyarena.o \
268                 Python/pyfpe.o \
269                 Python/pystate.o \
270                 Python/pythonrun.o \
271                 Python/structmember.o \
272                 Python/symtable.o \
273                 Python/sysmodule.o \
274                 Python/traceback.o \
275                 Python/getopt.o \
276                 Python/pystrtod.o \
277                 Python/$(DYNLOADFILE) \
278                 $(MACHDEP_OBJS) \
279                 $(THREADOBJ)
282 ##########################################################################
283 # Objects
284 OBJECT_OBJS=    \
285                 Objects/abstract.o \
286                 Objects/boolobject.o \
287                 Objects/bufferobject.o \
288                 Objects/cellobject.o \
289                 Objects/classobject.o \
290                 Objects/cobject.o \
291                 Objects/codeobject.o \
292                 Objects/complexobject.o \
293                 Objects/descrobject.o \
294                 Objects/enumobject.o \
295                 Objects/exceptions.o \
296                 Objects/genobject.o \
297                 Objects/fileobject.o \
298                 Objects/floatobject.o \
299                 Objects/frameobject.o \
300                 Objects/funcobject.o \
301                 Objects/intobject.o \
302                 Objects/iterobject.o \
303                 Objects/listobject.o \
304                 Objects/longobject.o \
305                 Objects/dictobject.o \
306                 Objects/methodobject.o \
307                 Objects/moduleobject.o \
308                 Objects/object.o \
309                 Objects/obmalloc.o \
310                 Objects/rangeobject.o \
311                 Objects/setobject.o \
312                 Objects/sliceobject.o \
313                 Objects/stringobject.o \
314                 Objects/structseq.o \
315                 Objects/tupleobject.o \
316                 Objects/typeobject.o \
317                 Objects/weakrefobject.o \
318                 $(UNICODE_OBJS)
321 ##########################################################################
322 # objects that get linked into the Python library
323 LIBRARY_OBJS=   \
324                 Modules/_typesmodule.o \
325                 Modules/getbuildinfo.o \
326                 $(PARSER_OBJS) \
327                 $(OBJECT_OBJS) \
328                 $(PYTHON_OBJS) \
329                 $(MODULE_OBJS) \
330                 $(SIGNAL_OBJS) \
331                 $(MODOBJS)
333 #########################################################################
334 # Rules
336 # Default target
337 all:            $(BUILDPYTHON) oldsharedmods sharedmods
339 # Build the interpreter
340 $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
341                 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
342                         Modules/python.o \
343                         $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
345 platform: $(BUILDPYTHON)
346         $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
349 # Build the shared modules
350 sharedmods: $(BUILDPYTHON)
351         @case $$MAKEFLAGS in \
352         *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
353         *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
354         esac
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 $@ Modules/_typesmodule.o
362         $(AR) cr $@ $(PARSER_OBJS)
363         $(AR) cr $@ $(OBJECT_OBJS)
364         $(AR) cr $@ $(PYTHON_OBJS)
365         $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
366         $(AR) cr $@ $(MODOBJS)
367         $(RANLIB) $@
369 libpython$(VERSION).so: $(LIBRARY_OBJS)
370         if test $(INSTSONAME) != $(LDLIBRARY); then \
371                 $(LDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
372                 $(LN) -f $(INSTSONAME) $@; \
373         else\
374                 $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
375         fi
377 libpython$(VERSION).sl: $(LIBRARY_OBJS)
378         $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM)
380 # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
381 # minimal framework (not including the Lib directory and such) in the current
382 # directory.
383 RESSRCDIR=$(srcdir)/Mac/Resources/framework
384 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
385                 $(LIBRARY) \
386                 $(RESSRCDIR)/Info.plist \
387                 $(RESSRCDIR)/version.plist \
388                 $(RESSRCDIR)/English.lproj/InfoPlist.strings
389         $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
390         if test "${UNIVERSALSDK}"; then \
391                 $(CC) -o $(LDLIBRARY) -arch i386 -arch ppc -dynamiclib \
392                         -isysroot "${UNIVERSALSDK}" \
393                         -all_load $(LIBRARY) -Wl,-single_module \
394                         -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/Python \
395                         -compatibility_version $(VERSION) \
396                         -current_version $(VERSION); \
397         else \
398                 /usr/bin/libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \
399                         @LIBTOOL_CRUFT@ ;\
400         fi
401         $(INSTALL) -d -m $(DIRMODE)  \
402                 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
403         $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
404                 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
405         $(INSTALL_DATA) $(RESSRCDIR)/version.plist \
406                 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/version.plist
407         $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
408                 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj/InfoPlist.strings
409         $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
410         $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
411         $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
412         $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
414 # This rule builds the Cygwin Python DLL and import library if configured
415 # for a shared core library; otherwise, this rule is a noop.
416 $(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
417         if test -n "$(DLLLIBRARY)"; then \
418                 $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
419                         $(LIBS) $(MODLIBS) $(SYSLIBS); \
420         else true; \
421         fi
424 oldsharedmods: $(SHAREDMODS)
427 Makefile Modules/config.c: Makefile.pre \
428                                 $(srcdir)/Modules/config.c.in \
429                                 $(MAKESETUP) \
430                                 Modules/Setup.config \
431                                 Modules/Setup \
432                                 Modules/Setup.local
433         $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
434                                 -s Modules \
435                                 Modules/Setup.config \
436                                 Modules/Setup.local \
437                                 Modules/Setup
438         @mv config.c Modules
439         @echo "The Makefile was updated, you may need to re-run make."
442 Modules/Setup: $(srcdir)/Modules/Setup.dist
443         @if test -f Modules/Setup; then \
444                 echo "-----------------------------------------------"; \
445                 echo "Modules/Setup.dist is newer than Modules/Setup;"; \
446                 echo "check to make sure you have all the updates you"; \
447                 echo "need in your Modules/Setup file."; \
448                 echo "Usually, copying Setup.dist to Setup will work."; \
449                 echo "-----------------------------------------------"; \
450         fi
452 ############################################################################
453 # Special rules for object files
455 Modules/getbuildinfo.o: $(PARSER_OBJS) \
456                 $(OBJECT_OBJS) \
457                 $(PYTHON_OBJS) \
458                 $(MODULE_OBJS) \
459                 $(SIGNAL_OBJS) \
460                 $(MODOBJS) \
461                 $(srcdir)/Modules/getbuildinfo.c
462         $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
464 Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
465         $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
466                 -DPREFIX='"$(prefix)"' \
467                 -DEXEC_PREFIX='"$(exec_prefix)"' \
468                 -DVERSION='"$(VERSION)"' \
469                 -DVPATH='"$(VPATH)"' \
470                 -o $@ $(srcdir)/Modules/getpath.c
472 Modules/python.o: $(srcdir)/Modules/python.c
473         $(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
476 $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
477                 -@ mkdir Include
478                 -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
480 $(PGEN):        $(PGENOBJS)
481                 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
483 Parser/grammar.o:       $(srcdir)/Parser/grammar.c \
484                                 $(srcdir)/Include/token.h \
485                                 $(srcdir)/Include/grammar.h
486 Parser/metagrammar.o:   $(srcdir)/Parser/metagrammar.c
488 Parser/tokenizer_pgen.o:        $(srcdir)/Parser/tokenizer.c
490 Parser/pgenmain.o:      $(srcdir)/Include/parsetok.h
492 $(AST_H): $(AST_ASDL) $(ASDLGEN_FILES)
493         $(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL)
495 $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
496         $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL)
498 Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H)
500 Python/getplatform.o: $(srcdir)/Python/getplatform.c
501                 $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
503 Python/importdl.o: $(srcdir)/Python/importdl.c
504                 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
506 Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
507                                 $(srcdir)/Objects/unicodetype_db.h
509 ############################################################################
510 # Header files
512 PYTHON_HEADERS= \
513                 Include/Python.h \
514                 Include/Python-ast.h \
515                 Include/asdl.h \
516                 Include/abstract.h \
517                 Include/boolobject.h \
518                 Include/bufferobject.h \
519                 Include/ceval.h \
520                 Include/classobject.h \
521                 Include/cobject.h \
522                 Include/code.h \
523                 Include/codecs.h \
524                 Include/compile.h \
525                 Include/complexobject.h \
526                 Include/descrobject.h \
527                 Include/dictobject.h \
528                 Include/enumobject.h \
529                 Include/genobject.h \
530                 Include/fileobject.h \
531                 Include/floatobject.h \
532                 Include/funcobject.h \
533                 Include/import.h \
534                 Include/intobject.h \
535                 Include/intrcheck.h \
536                 Include/iterobject.h \
537                 Include/listobject.h \
538                 Include/longobject.h \
539                 Include/methodobject.h \
540                 Include/modsupport.h \
541                 Include/moduleobject.h \
542                 Include/object.h \
543                 Include/objimpl.h \
544                 Include/parsetok.h \
545                 Include/patchlevel.h \
546                 Include/pyarena.h \
547                 Include/pydebug.h \
548                 Include/pyerrors.h \
549                 Include/pyfpe.h \
550                 Include/pymem.h \
551                 Include/pyport.h \
552                 Include/pystate.h \
553                 Include/pythonrun.h \
554                 Include/rangeobject.h \
555                 Include/setobject.h \
556                 Include/sliceobject.h \
557                 Include/stringobject.h \
558                 Include/structseq.h \
559                 Include/structmember.h \
560                 Include/symtable.h \
561                 Include/sysmodule.h \
562                 Include/traceback.h \
563                 Include/tupleobject.h \
564                 Include/unicodeobject.h \
565                 Include/weakrefobject.h \
566                 pyconfig.h
568 $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
571 ######################################################################
573 # Test the interpreter (twice, once without .pyc files, once with)
574 # In the past, we've had problems where bugs in the marshalling or
575 # elsewhere caused bytecode read from .pyc files to behave differently
576 # than bytecode generated directly from a .py source file.  Sometimes
577 # the bytecode read from a .pyc file had the bug, somtimes the directly
578 # generated bytecode.  This is sometimes a very shy bug needing a lot of
579 # sample data.
581 TESTOPTS=       -l $(EXTRATESTOPTS)
582 TESTPROG=       $(srcdir)/Lib/test/regrtest.py
583 TESTPYTHON=     $(RUNSHARED) ./$(BUILDPYTHON) -E -tt
584 test:           all platform
585                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
586                 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
587                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
589 testall:        all platform
590                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
591                 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
592                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
594 #  Run the unitests for both architectures in a Universal build on OSX
595 #  Must be run on an Intel box.
596 testuniversal:  all platform
597                 if [ `arch` != 'i386' ];then \
598                         echo "This can only be used on OSX/i386" ;\
599                         exit 1 ;\
600                 fi
601                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
602                 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
603                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
604                 $(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E -tt $(TESTPROG) $(TESTOPTS) -uall
607 # Like testall, but with a single pass only
608 # run an optional script to include some information about the build environment
609 buildbottest:   all platform
610                 -@if which pybuildbot.identify >/dev/null 2>&1; then \
611                         pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
612                 fi
613                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall -rw
615 QUICKTESTOPTS=  $(TESTOPTS) -x test_thread test_signal test_strftime \
616                 test_unicodedata test_re test_sre test_select test_poll \
617                 test_linuxaudiodev test_struct test_sunaudiodev test_zlib
618 quicktest:      all platform
619                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
620                 -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
621                 $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
623 MEMTESTOPTS=    $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
624                 test_longexp
625 memtest:        all platform
626                 -rm -f $(srcdir)/Lib/test/*.py[co]
627                 -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
628                 $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
630 # Install everything
631 install:        @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@
633 # Install almost everything without disturbing previous versions
634 altinstall:     @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \
635                 sharedinstall oldsharedinstall @FRAMEWORKALTINSTALLLAST@
637 # Install shared libraries enabled by Setup
638 DESTDIRS=       $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
640 oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
641                 @for i in X $(SHAREDMODS); do \
642                   if test $$i != X; then \
643                     echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
644                     $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
645                   fi; \
646                 done
648 $(DESTSHARED):
649                 @for i in $(DESTDIRS); \
650                 do \
651                         if test ! -d $(DESTDIR)$$i; then \
652                                 echo "Creating directory $$i"; \
653                                 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
654                         else    true; \
655                         fi; \
656                 done
659 # Install the interpreter (by creating a hard link to python$(VERSION))
660 bininstall:     altbininstall
661         -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON); \
662         then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
663         else true; \
664         fi
665         (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
666         -rm -f $(DESTDIR)$(BINDIR)/python-config
667         (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config)
669 # Install the interpreter with $(VERSION) affixed
670 # This goes into $(exec_prefix)
671 altbininstall:  $(BUILDPYTHON)
672         @for i in $(BINDIR) $(LIBDIR); \
673         do \
674                 if test ! -d $(DESTDIR)$$i; then \
675                         echo "Creating directory $$i"; \
676                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
677                 else    true; \
678                 fi; \
679         done
680         $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
681         if test -f libpython$(VERSION)$(SO); then \
682                 if test "$(SO)" = .dll; then \
683                         $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \
684                 else \
685                         $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
686                         if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \
687                                 (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \
688                         fi \
689                 fi; \
690         else    true; \
691         fi
693 # Install the manual page
694 maninstall:
695         @for i in $(MANDIR) $(MANDIR)/man1; \
696         do \
697                 if test ! -d $(DESTDIR)$$i; then \
698                         echo "Creating directory $$i"; \
699                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
700                 else    true; \
701                 fi; \
702         done
703         $(INSTALL_DATA) $(srcdir)/Misc/python.man \
704                 $(DESTDIR)$(MANDIR)/man1/python.1
706 # Install the library
707 PLATDIR=        plat-$(MACHDEP)
708 EXTRAPLATDIR= @EXTRAPLATDIR@
709 EXTRAMACHDEPPATH=@EXTRAMACHDEPPATH@
710 MACHDEPS=       $(PLATDIR) $(EXTRAPLATDIR)
711 XMLLIBSUBDIRS=  xml xml/dom xml/etree xml/parsers xml/sax
712 PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
713         plat-mac/lib-scriptpackages/_builtinSuites \
714         plat-mac/lib-scriptpackages/CodeWarrior \
715         plat-mac/lib-scriptpackages/Explorer \
716         plat-mac/lib-scriptpackages/Finder \
717         plat-mac/lib-scriptpackages/Netscape \
718         plat-mac/lib-scriptpackages/StdSuites \
719         plat-mac/lib-scriptpackages/SystemEvents \
720         plat-mac/lib-scriptpackages/Terminal 
721 PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
722 LIBSUBDIRS=     lib-tk site-packages test test/output test/data \
723                 test/decimaltestdata \
724                 encodings compiler hotshot \
725                 email email/mime email/test email/test/data \
726                 sqlite3 sqlite3/test \
727                 logging bsddb bsddb/test csv wsgiref \
728                 ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \
729                 distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
730                 setuptools setuptools/command setuptools/tests setuptools.egg-info \
731                 curses $(MACHDEPS)
732 libinstall:     $(BUILDPYTHON) $(srcdir)/Lib/$(PLATDIR)
733         @for i in $(SCRIPTDIR) $(LIBDEST); \
734         do \
735                 if test ! -d $(DESTDIR)$$i; then \
736                         echo "Creating directory $$i"; \
737                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
738                 else    true; \
739                 fi; \
740         done
741         @for d in $(LIBSUBDIRS); \
742         do \
743                 a=$(srcdir)/Lib/$$d; \
744                 if test ! -d $$a; then continue; else true; fi; \
745                 b=$(LIBDEST)/$$d; \
746                 if test ! -d $(DESTDIR)$$b; then \
747                         echo "Creating directory $$b"; \
748                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
749                 else    true; \
750                 fi; \
751         done
752         @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \
753         do \
754                 if test -x $$i; then \
755                         $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
756                         echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
757                 else \
758                         $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
759                         echo $(INSTALL_DATA) $$i $(LIBDEST); \
760                 fi; \
761         done
762         @for d in $(LIBSUBDIRS); \
763         do \
764                 a=$(srcdir)/Lib/$$d; \
765                 if test ! -d $$a; then continue; else true; fi; \
766                 if test `ls $$a | wc -l` -lt 1; then continue; fi; \
767                 b=$(LIBDEST)/$$d; \
768                 for i in $$a/*; \
769                 do \
770                         case $$i in \
771                         *CVS) ;; \
772                         *.py[co]) ;; \
773                         *.orig) ;; \
774                         *~) ;; \
775                         *) \
776                                 if test -d $$i; then continue; fi; \
777                                 if test -x $$i; then \
778                                     echo $(INSTALL_SCRIPT) $$i $$b; \
779                                     $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
780                                 else \
781                                     echo $(INSTALL_DATA) $$i $$b; \
782                                     $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
783                                 fi;; \
784                         esac; \
785                 done; \
786         done
787         $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
788         PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
789                 ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
790                 -d $(LIBDEST) -f \
791                 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
792         PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
793                 ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
794                 -d $(LIBDEST) -f \
795                 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
796         -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
797                 ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
798                 -d $(LIBDEST)/site-packages -f \
799                 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
800         -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
801                 ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
802                 -d $(LIBDEST)/site-packages -f \
803                 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
805 # Create the PLATDIR source directory, if one wasn't distributed..
806 $(srcdir)/Lib/$(PLATDIR):
807         mkdir $(srcdir)/Lib/$(PLATDIR)
808         cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
809         export PATH; PATH="`pwd`:$$PATH"; \
810         export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
811         export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
812         export EXE; EXE="$(BUILDEXE)"; \
813         cd $(srcdir)/Lib/$(PLATDIR); ./regen
815 # Install the include files
816 INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
817 inclinstall:
818         @for i in $(INCLDIRSTOMAKE); \
819         do \
820                 if test ! -d $(DESTDIR)$$i; then \
821                         echo "Creating directory $$i"; \
822                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
823                 else    true; \
824                 fi; \
825         done
826         @for i in $(srcdir)/Include/*.h; \
827         do \
828                 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
829                 $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
830         done
831         $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
833 # Install the library and miscellaneous stuff needed for extending/embedding
834 # This goes into $(exec_prefix)
835 LIBPL=          $(LIBP)/config
836 libainstall:    all
837         @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
838         do \
839                 if test ! -d $(DESTDIR)$$i; then \
840                         echo "Creating directory $$i"; \
841                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
842                 else    true; \
843                 fi; \
844         done
845         @if test -d $(LIBRARY); then :; else \
846                 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
847                         if test "$(SO)" = .dll; then \
848                                 $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
849                         else \
850                                 $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
851                                 $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
852                         fi; \
853                 else \
854                         echo Skip install of $(LIBRARY) - use make frameworkinstall; \
855                 fi; \
856         fi
857         $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
858         $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
859         $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
860         $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
861         $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
862         $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
863         $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
864         $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
865         $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
866         # Substitution happens here, as the completely-expanded BINDIR
867         # is not available in configure
868         sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
869         $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
870         rm python-config
871         @if [ -s Modules/python.exp -a \
872                 "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
873                 echo; echo "Installing support files for building shared extension modules on AIX:"; \
874                 $(INSTALL_DATA) Modules/python.exp              \
875                                 $(DESTDIR)$(LIBPL)/python.exp;          \
876                 echo; echo "$(LIBPL)/python.exp";               \
877                 $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix  \
878                                 $(DESTDIR)$(LIBPL)/makexp_aix;          \
879                 echo "$(LIBPL)/makexp_aix";                     \
880                 $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix   \
881                                 $(DESTDIR)$(LIBPL)/ld_so_aix;           \
882                 echo "$(LIBPL)/ld_so_aix";                      \
883                 echo; echo "See Misc/AIX-NOTES for details.";   \
884         else true; \
885         fi
886         @case "$(MACHDEP)" in beos*) \
887                 echo; echo "Installing support files for building shared extension modules on BeOS:"; \
888                 $(INSTALL_DATA) Misc/BeOS-NOTES $(DESTDIR)$(LIBPL)/README;      \
889                 echo; echo "$(LIBPL)/README";                   \
890                 $(INSTALL_SCRIPT) Modules/ar_beos $(DESTDIR)$(LIBPL)/ar_beos; \
891                 echo "$(LIBPL)/ar_beos";                        \
892                 $(INSTALL_SCRIPT) Modules/ld_so_beos $(DESTDIR)$(LIBPL)/ld_so_beos; \
893                 echo "$(LIBPL)/ld_so_beos";                     \
894                 echo; echo "See Misc/BeOS-NOTES for details.";  \
895                 ;; \
896         esac
898 # Install the dynamically loadable modules
899 # This goes into $(exec_prefix)
900 sharedinstall:
901         $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
902                 --prefix=$(prefix) \
903                 --install-scripts=$(BINDIR) \
904                 --install-platlib=$(DESTSHARED) \
905                 --root=/$(DESTDIR)
907 # Here are a couple of targets for MacOSX again, to install a full
908 # framework-based Python. frameworkinstall installs everything, the
909 # subtargets install specific parts. Much of the actual work is offloaded to
910 # the Makefile in Mac
913 # This target is here for backward compatiblity, previous versions of Python
914 # hadn't integrated framework installation in the normal install process.
915 frameworkinstall: install
917 # On install, we re-make the framework
918 # structure in the install location, /Library/Frameworks/ or the argument to
919 # --enable-framework. If --enable-framework has been specified then we have
920 # automatically set prefix to the location deep down in the framework, so we
921 # only have to cater for the structural bits of the framework.
923 frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
925 frameworkinstallstructure:      $(LDLIBRARY)
926         @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
927                 echo Not configured with --enable-framework; \
928                 exit 1; \
929         else true; \
930         fi
931         @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
932                 if test ! -d $(DESTDIR)$$i; then \
933                         echo "Creating directory $(DESTDIR)$$i"; \
934                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
935                 else    true; \
936                 fi; \
937         done
938         $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
939         $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(DESTDIR)$(prefix)/Resources/Info.plist
940         $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(DESTDIR)$(prefix)/Resources/version.plist
941         $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
942                 $(DESTDIR)$(prefix)/Resources/English.lproj/InfoPlist.strings
943         $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
944         $(LN) -fsn Versions/Current/Python $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Python
945         $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
946         $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
947         $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
949 # This installs Mac/Lib into the framework
950 # Install a number of symlinks to keep software that expects a normal unix
951 # install (which includes python-config) happy.
952 frameworkinstallmaclib:
953         ln -fs "../../../Python" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a"
954         cd Mac && $(MAKE) installmacsubtree DESTDIR="$(DESTDIR)"
956 # This installs the IDE, the Launcher and other apps into /Applications
957 frameworkinstallapps:
958         cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
960 # This install the unix python and pythonw tools in /usr/local/bin
961 frameworkinstallunixtools:
962         cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
964 frameworkaltinstallunixtools:
965         cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"
967 # This installs the Demos and Tools into the applications directory.
968 # It is not part of a normal frameworkinstall
969 frameworkinstallextras:
970         cd Mac && Make installextras DESTDIR="$(DESTDIR)"
972 # This installs a few of the useful scripts in Tools/scripts
973 scriptsinstall:
974         SRCDIR=$(srcdir) $(RUNSHARED) \
975         ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
976         --prefix=$(prefix) \
977         --install-scripts=$(BINDIR) \
978         --root=/$(DESTDIR)
980 # Build the toplevel Makefile
981 Makefile.pre: Makefile.pre.in config.status
982         CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
983         $(MAKE) -f Makefile.pre Makefile
985 # Run the configure script.
986 config.status:  $(srcdir)/configure
987         $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
989 .PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
991 # Some make's put the object file in the current directory
992 .c.o:
993         $(CC) -c $(PY_CFLAGS) -o $@ $<
995 # Run reindent on the library
996 reindent:
997         ./python$(EXEEXT) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
999 # Rerun configure with the same options as it was run last time,
1000 # provided the config.status script exists
1001 recheck:
1002         $(SHELL) config.status --recheck
1003         $(SHELL) config.status
1005 # Rebuild the configure script from configure.in; also rebuild pyconfig.h.in
1006 autoconf:
1007         (cd $(srcdir); autoconf)
1008         (cd $(srcdir); autoheader)
1010 # Create a tags file for vi
1011 tags::
1012         cd $(srcdir); \
1013         ctags -w -t Include/*.h; \
1014         for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \
1015         done; \
1016         sort -o tags tags
1018 # Create a tags file for GNU Emacs
1019 TAGS::
1020         cd $(srcdir); \
1021         etags Include/*.h; \
1022         for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
1024 # Sanitation targets -- clean leaves libraries, executables and tags
1025 # files, which clobber removes those as well
1026 pycremoval:
1027         find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
1029 clean: pycremoval
1030         find . -name '*.o' -exec rm -f {} ';'
1031         find . -name '*.s[ol]' -exec rm -f {} ';'
1032         find $(srcdir)/build -name 'fficonfig.h' -exec rm -f {} ';' || true
1033         find $(srcdir)/build -name 'fficonfig.py' -exec rm -f {} ';' || true
1035 clobber: clean
1036         -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
1037                 tags TAGS \
1038                 config.cache config.log pyconfig.h Modules/config.c
1039         -rm -rf build platform
1040         -rm -rf $(PYTHONFRAMEWORKDIR)
1042 # Make things extra clean, before making a distribution:
1043 # remove all generated files, even Makefile[.pre]
1044 # Keep configure and Python-ast.[ch], it's possible they can't be generated
1045 distclean: clobber
1046         -rm -f core Makefile Makefile.pre config.status \
1047                 Modules/Setup Modules/Setup.local Modules/Setup.config
1048         find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
1049                            -o -name '[@,#]*' -o -name '*.old' \
1050                            -o -name '*.orig' -o -name '*.rej' \
1051                            -o -name '*.bak' ')' \
1052                            -exec rm -f {} ';'
1054 # Check for smelly exported symbols (not starting with Py/_Py)
1055 smelly: all
1056         nm -p $(LIBRARY) | \
1057                 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
1059 # Find files with funny names
1060 funny:
1061         find $(DISTDIRS) -type d \
1062                 -o -name '*.[chs]' \
1063                 -o -name '*.py' \
1064                 -o -name '*.doc' \
1065                 -o -name '*.sty' \
1066                 -o -name '*.bib' \
1067                 -o -name '*.dat' \
1068                 -o -name '*.el' \
1069                 -o -name '*.fd' \
1070                 -o -name '*.in' \
1071                 -o -name '*.tex' \
1072                 -o -name '*,[vpt]' \
1073                 -o -name 'Setup' \
1074                 -o -name 'Setup.*' \
1075                 -o -name README \
1076                 -o -name Makefile \
1077                 -o -name ChangeLog \
1078                 -o -name Repository \
1079                 -o -name Root \
1080                 -o -name Entries \
1081                 -o -name Tag \
1082                 -o -name tags \
1083                 -o -name TAGS \
1084                 -o -name .cvsignore \
1085                 -o -name MANIFEST \
1086                 -o -print
1088 # Dependencies
1090 Python/thread.o: @THREADHEADERS@
1092 # Declare targets that aren't real files
1093 .PHONY: all sharedmods oldsharedmods test quicktest memtest
1094 .PHONY: install altinstall oldsharedinstall bininstall altbininstall
1095 .PHONY: maninstall libinstall inclinstall libainstall sharedinstall
1096 .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
1097 .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
1098 .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean 
1099 .PHONY: smelly funny
1101 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY