Change to basicConfig() to fix #1021.
[python.git] / Makefile.pre.in
blob0972411447caf671633b99147280a3eceeb8fce5
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:            build_all
338 build_all:      $(BUILDPYTHON) oldsharedmods sharedmods
340 # Build the interpreter
341 $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
342                 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
343                         Modules/python.o \
344                         $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
346 platform: $(BUILDPYTHON)
347         $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
350 # Build the shared modules
351 sharedmods: $(BUILDPYTHON)
352         @case $$MAKEFLAGS in \
353         *-s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
354         *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
355         esac
357 # Build static library
358 # avoid long command lines, same as LIBRARY_OBJS
359 $(LIBRARY): $(LIBRARY_OBJS)
360         -rm -f $@
361         $(AR) cr $@ Modules/getbuildinfo.o
362         $(AR) cr $@ Modules/_typesmodule.o
363         $(AR) cr $@ $(PARSER_OBJS)
364         $(AR) cr $@ $(OBJECT_OBJS)
365         $(AR) cr $@ $(PYTHON_OBJS)
366         $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
367         $(AR) cr $@ $(MODOBJS)
368         $(RANLIB) $@
370 libpython$(VERSION).so: $(LIBRARY_OBJS)
371         if test $(INSTSONAME) != $(LDLIBRARY); then \
372                 $(LDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
373                 $(LN) -f $(INSTSONAME) $@; \
374         else\
375                 $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
376         fi
378 libpython$(VERSION).sl: $(LIBRARY_OBJS)
379         $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM)
381 # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
382 # minimal framework (not including the Lib directory and such) in the current
383 # directory.
384 RESSRCDIR=$(srcdir)/Mac/Resources/framework
385 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
386                 $(LIBRARY) \
387                 $(RESSRCDIR)/Info.plist \
388                 $(RESSRCDIR)/version.plist \
389                 $(RESSRCDIR)/English.lproj/InfoPlist.strings
390         $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
391         if test "${UNIVERSALSDK}"; then \
392                 $(CC) -o $(LDLIBRARY) -arch i386 -arch ppc -dynamiclib \
393                         -isysroot "${UNIVERSALSDK}" \
394                         -all_load $(LIBRARY) -Wl,-single_module \
395                         -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/Python \
396                         -compatibility_version $(VERSION) \
397                         -current_version $(VERSION); \
398         else \
399                 /usr/bin/libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \
400                         @LIBTOOL_CRUFT@ ;\
401         fi
402         $(INSTALL) -d -m $(DIRMODE)  \
403                 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
404         $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
405                 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
406         $(INSTALL_DATA) $(RESSRCDIR)/version.plist \
407                 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/version.plist
408         $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
409                 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj/InfoPlist.strings
410         $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
411         $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
412         $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
413         $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
415 # This rule builds the Cygwin Python DLL and import library if configured
416 # for a shared core library; otherwise, this rule is a noop.
417 $(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
418         if test -n "$(DLLLIBRARY)"; then \
419                 $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
420                         $(LIBS) $(MODLIBS) $(SYSLIBS); \
421         else true; \
422         fi
425 oldsharedmods: $(SHAREDMODS)
428 Makefile Modules/config.c: Makefile.pre \
429                                 $(srcdir)/Modules/config.c.in \
430                                 $(MAKESETUP) \
431                                 Modules/Setup.config \
432                                 Modules/Setup \
433                                 Modules/Setup.local
434         $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
435                                 -s Modules \
436                                 Modules/Setup.config \
437                                 Modules/Setup.local \
438                                 Modules/Setup
439         @mv config.c Modules
440         @echo "The Makefile was updated, you may need to re-run make."
443 Modules/Setup: $(srcdir)/Modules/Setup.dist
444         @if test -f Modules/Setup; then \
445                 echo "-----------------------------------------------"; \
446                 echo "Modules/Setup.dist is newer than Modules/Setup;"; \
447                 echo "check to make sure you have all the updates you"; \
448                 echo "need in your Modules/Setup file."; \
449                 echo "Usually, copying Setup.dist to Setup will work."; \
450                 echo "-----------------------------------------------"; \
451         fi
453 ############################################################################
454 # Special rules for object files
456 Modules/getbuildinfo.o: $(PARSER_OBJS) \
457                 $(OBJECT_OBJS) \
458                 $(PYTHON_OBJS) \
459                 $(MODULE_OBJS) \
460                 $(SIGNAL_OBJS) \
461                 $(MODOBJS) \
462                 $(srcdir)/Modules/getbuildinfo.c
463         $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
465 Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
466         $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
467                 -DPREFIX='"$(prefix)"' \
468                 -DEXEC_PREFIX='"$(exec_prefix)"' \
469                 -DVERSION='"$(VERSION)"' \
470                 -DVPATH='"$(VPATH)"' \
471                 -o $@ $(srcdir)/Modules/getpath.c
473 Modules/python.o: $(srcdir)/Modules/python.c
474         $(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
477 $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
478                 -@ mkdir Include
479                 -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
481 $(PGEN):        $(PGENOBJS)
482                 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
484 Parser/grammar.o:       $(srcdir)/Parser/grammar.c \
485                                 $(srcdir)/Include/token.h \
486                                 $(srcdir)/Include/grammar.h
487 Parser/metagrammar.o:   $(srcdir)/Parser/metagrammar.c
489 Parser/tokenizer_pgen.o:        $(srcdir)/Parser/tokenizer.c
491 Parser/pgenmain.o:      $(srcdir)/Include/parsetok.h
493 $(AST_H): $(AST_ASDL) $(ASDLGEN_FILES)
494         $(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL)
496 $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
497         $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL)
499 Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H)
501 Python/getplatform.o: $(srcdir)/Python/getplatform.c
502                 $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
504 Python/importdl.o: $(srcdir)/Python/importdl.c
505                 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
507 Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
508                                 $(srcdir)/Objects/unicodetype_db.h
510 ############################################################################
511 # Header files
513 PYTHON_HEADERS= \
514                 Include/Python.h \
515                 Include/Python-ast.h \
516                 Include/asdl.h \
517                 Include/abstract.h \
518                 Include/boolobject.h \
519                 Include/bufferobject.h \
520                 Include/ceval.h \
521                 Include/classobject.h \
522                 Include/cobject.h \
523                 Include/code.h \
524                 Include/codecs.h \
525                 Include/compile.h \
526                 Include/complexobject.h \
527                 Include/descrobject.h \
528                 Include/dictobject.h \
529                 Include/enumobject.h \
530                 Include/genobject.h \
531                 Include/fileobject.h \
532                 Include/floatobject.h \
533                 Include/funcobject.h \
534                 Include/import.h \
535                 Include/intobject.h \
536                 Include/intrcheck.h \
537                 Include/iterobject.h \
538                 Include/listobject.h \
539                 Include/longobject.h \
540                 Include/methodobject.h \
541                 Include/modsupport.h \
542                 Include/moduleobject.h \
543                 Include/object.h \
544                 Include/objimpl.h \
545                 Include/parsetok.h \
546                 Include/patchlevel.h \
547                 Include/pyarena.h \
548                 Include/pydebug.h \
549                 Include/pyerrors.h \
550                 Include/pyfpe.h \
551                 Include/pymem.h \
552                 Include/pyport.h \
553                 Include/pystate.h \
554                 Include/pythonrun.h \
555                 Include/rangeobject.h \
556                 Include/setobject.h \
557                 Include/sliceobject.h \
558                 Include/stringobject.h \
559                 Include/structseq.h \
560                 Include/structmember.h \
561                 Include/symtable.h \
562                 Include/sysmodule.h \
563                 Include/traceback.h \
564                 Include/tupleobject.h \
565                 Include/unicodeobject.h \
566                 Include/weakrefobject.h \
567                 pyconfig.h
569 $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
572 ######################################################################
574 # Test the interpreter (twice, once without .pyc files, once with)
575 # In the past, we've had problems where bugs in the marshalling or
576 # elsewhere caused bytecode read from .pyc files to behave differently
577 # than bytecode generated directly from a .py source file.  Sometimes
578 # the bytecode read from a .pyc file had the bug, somtimes the directly
579 # generated bytecode.  This is sometimes a very shy bug needing a lot of
580 # sample data.
582 TESTOPTS=       -l $(EXTRATESTOPTS)
583 TESTPROG=       $(srcdir)/Lib/test/regrtest.py
584 TESTPYTHON=     $(RUNSHARED) ./$(BUILDPYTHON) -E -tt
585 test:           all platform
586                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
587                 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
588                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
590 testall:        all platform
591                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
592                 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
593                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
595 #  Run the unitests for both architectures in a Universal build on OSX
596 #  Must be run on an Intel box.
597 testuniversal:  all platform
598                 if [ `arch` != 'i386' ];then \
599                         echo "This can only be used on OSX/i386" ;\
600                         exit 1 ;\
601                 fi
602                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
603                 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
604                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
605                 $(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E -tt $(TESTPROG) $(TESTOPTS) -uall
608 # Like testall, but with a single pass only
609 # run an optional script to include some information about the build environment
610 buildbottest:   all platform
611                 -@if which pybuildbot.identify >/dev/null 2>&1; then \
612                         pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
613                 fi
614                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall -rw
616 QUICKTESTOPTS=  $(TESTOPTS) -x test_thread test_signal test_strftime \
617                 test_unicodedata test_re test_sre test_select test_poll \
618                 test_linuxaudiodev test_struct test_sunaudiodev test_zlib
619 quicktest:      all platform
620                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
621                 -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
622                 $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
624 MEMTESTOPTS=    $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
625                 test_longexp
626 memtest:        all platform
627                 -rm -f $(srcdir)/Lib/test/*.py[co]
628                 -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
629                 $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
631 # Install everything
632 install:        @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@
634 # Install almost everything without disturbing previous versions
635 altinstall:     @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \
636                 sharedinstall oldsharedinstall @FRAMEWORKALTINSTALLLAST@
638 # Install shared libraries enabled by Setup
639 DESTDIRS=       $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
641 oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
642                 @for i in X $(SHAREDMODS); do \
643                   if test $$i != X; then \
644                     echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
645                     $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
646                   fi; \
647                 done
649 $(DESTSHARED):
650                 @for i in $(DESTDIRS); \
651                 do \
652                         if test ! -d $(DESTDIR)$$i; then \
653                                 echo "Creating directory $$i"; \
654                                 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
655                         else    true; \
656                         fi; \
657                 done
660 # Install the interpreter (by creating a hard link to python$(VERSION))
661 bininstall:     altbininstall
662         -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON); \
663         then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
664         else true; \
665         fi
666         (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
667         -rm -f $(DESTDIR)$(BINDIR)/python-config
668         (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config)
670 # Install the interpreter with $(VERSION) affixed
671 # This goes into $(exec_prefix)
672 altbininstall:  $(BUILDPYTHON)
673         @for i in $(BINDIR) $(LIBDIR); \
674         do \
675                 if test ! -d $(DESTDIR)$$i; then \
676                         echo "Creating directory $$i"; \
677                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
678                 else    true; \
679                 fi; \
680         done
681         $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
682         if test -f libpython$(VERSION)$(SO); then \
683                 if test "$(SO)" = .dll; then \
684                         $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \
685                 else \
686                         $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
687                         if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \
688                                 (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \
689                         fi \
690                 fi; \
691         else    true; \
692         fi
694 # Install the manual page
695 maninstall:
696         @for i in $(MANDIR) $(MANDIR)/man1; \
697         do \
698                 if test ! -d $(DESTDIR)$$i; then \
699                         echo "Creating directory $$i"; \
700                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
701                 else    true; \
702                 fi; \
703         done
704         $(INSTALL_DATA) $(srcdir)/Misc/python.man \
705                 $(DESTDIR)$(MANDIR)/man1/python.1
707 # Install the library
708 PLATDIR=        plat-$(MACHDEP)
709 EXTRAPLATDIR= @EXTRAPLATDIR@
710 EXTRAMACHDEPPATH=@EXTRAMACHDEPPATH@
711 MACHDEPS=       $(PLATDIR) $(EXTRAPLATDIR)
712 XMLLIBSUBDIRS=  xml xml/dom xml/etree xml/parsers xml/sax
713 PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
714         plat-mac/lib-scriptpackages/_builtinSuites \
715         plat-mac/lib-scriptpackages/CodeWarrior \
716         plat-mac/lib-scriptpackages/Explorer \
717         plat-mac/lib-scriptpackages/Finder \
718         plat-mac/lib-scriptpackages/Netscape \
719         plat-mac/lib-scriptpackages/StdSuites \
720         plat-mac/lib-scriptpackages/SystemEvents \
721         plat-mac/lib-scriptpackages/Terminal 
722 PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
723 LIBSUBDIRS=     lib-tk site-packages test test/output test/data \
724                 test/decimaltestdata \
725                 encodings compiler hotshot \
726                 email email/mime email/test email/test/data \
727                 sqlite3 sqlite3/test \
728                 logging bsddb bsddb/test csv wsgiref \
729                 ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \
730                 distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
731                 setuptools setuptools/command setuptools/tests setuptools.egg-info \
732                 curses $(MACHDEPS)
733 libinstall:     build_all $(srcdir)/Lib/$(PLATDIR)
734         @for i in $(SCRIPTDIR) $(LIBDEST); \
735         do \
736                 if test ! -d $(DESTDIR)$$i; then \
737                         echo "Creating directory $$i"; \
738                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
739                 else    true; \
740                 fi; \
741         done
742         @for d in $(LIBSUBDIRS); \
743         do \
744                 a=$(srcdir)/Lib/$$d; \
745                 if test ! -d $$a; then continue; else true; fi; \
746                 b=$(LIBDEST)/$$d; \
747                 if test ! -d $(DESTDIR)$$b; then \
748                         echo "Creating directory $$b"; \
749                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
750                 else    true; \
751                 fi; \
752         done
753         @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \
754         do \
755                 if test -x $$i; then \
756                         $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
757                         echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
758                 else \
759                         $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
760                         echo $(INSTALL_DATA) $$i $(LIBDEST); \
761                 fi; \
762         done
763         @for d in $(LIBSUBDIRS); \
764         do \
765                 a=$(srcdir)/Lib/$$d; \
766                 if test ! -d $$a; then continue; else true; fi; \
767                 if test `ls $$a | wc -l` -lt 1; then continue; fi; \
768                 b=$(LIBDEST)/$$d; \
769                 for i in $$a/*; \
770                 do \
771                         case $$i in \
772                         *CVS) ;; \
773                         *.py[co]) ;; \
774                         *.orig) ;; \
775                         *~) ;; \
776                         *) \
777                                 if test -d $$i; then continue; fi; \
778                                 if test -x $$i; then \
779                                     echo $(INSTALL_SCRIPT) $$i $$b; \
780                                     $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
781                                 else \
782                                     echo $(INSTALL_DATA) $$i $$b; \
783                                     $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
784                                 fi;; \
785                         esac; \
786                 done; \
787         done
788         $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
789         PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
790                 ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
791                 -d $(LIBDEST) -f \
792                 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
793         PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
794                 ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
795                 -d $(LIBDEST) -f \
796                 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
797         -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
798                 ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
799                 -d $(LIBDEST)/site-packages -f \
800                 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
801         -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
802                 ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
803                 -d $(LIBDEST)/site-packages -f \
804                 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
806 # Create the PLATDIR source directory, if one wasn't distributed..
807 $(srcdir)/Lib/$(PLATDIR):
808         mkdir $(srcdir)/Lib/$(PLATDIR)
809         cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
810         export PATH; PATH="`pwd`:$$PATH"; \
811         export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
812         export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
813         export EXE; EXE="$(BUILDEXE)"; \
814         cd $(srcdir)/Lib/$(PLATDIR); ./regen
816 # Install the include files
817 INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
818 inclinstall:
819         @for i in $(INCLDIRSTOMAKE); \
820         do \
821                 if test ! -d $(DESTDIR)$$i; then \
822                         echo "Creating directory $$i"; \
823                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
824                 else    true; \
825                 fi; \
826         done
827         @for i in $(srcdir)/Include/*.h; \
828         do \
829                 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
830                 $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
831         done
832         $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
834 # Install the library and miscellaneous stuff needed for extending/embedding
835 # This goes into $(exec_prefix)
836 LIBPL=          $(LIBP)/config
837 libainstall:    all
838         @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
839         do \
840                 if test ! -d $(DESTDIR)$$i; then \
841                         echo "Creating directory $$i"; \
842                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
843                 else    true; \
844                 fi; \
845         done
846         @if test -d $(LIBRARY); then :; else \
847                 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
848                         if test "$(SO)" = .dll; then \
849                                 $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
850                         else \
851                                 $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
852                                 $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
853                         fi; \
854                 else \
855                         echo Skip install of $(LIBRARY) - use make frameworkinstall; \
856                 fi; \
857         fi
858         $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
859         $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
860         $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
861         $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
862         $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
863         $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
864         $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
865         $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
866         $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
867         # Substitution happens here, as the completely-expanded BINDIR
868         # is not available in configure
869         sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
870         $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
871         rm python-config
872         @if [ -s Modules/python.exp -a \
873                 "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
874                 echo; echo "Installing support files for building shared extension modules on AIX:"; \
875                 $(INSTALL_DATA) Modules/python.exp              \
876                                 $(DESTDIR)$(LIBPL)/python.exp;          \
877                 echo; echo "$(LIBPL)/python.exp";               \
878                 $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix  \
879                                 $(DESTDIR)$(LIBPL)/makexp_aix;          \
880                 echo "$(LIBPL)/makexp_aix";                     \
881                 $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix   \
882                                 $(DESTDIR)$(LIBPL)/ld_so_aix;           \
883                 echo "$(LIBPL)/ld_so_aix";                      \
884                 echo; echo "See Misc/AIX-NOTES for details.";   \
885         else true; \
886         fi
887         @case "$(MACHDEP)" in beos*) \
888                 echo; echo "Installing support files for building shared extension modules on BeOS:"; \
889                 $(INSTALL_DATA) Misc/BeOS-NOTES $(DESTDIR)$(LIBPL)/README;      \
890                 echo; echo "$(LIBPL)/README";                   \
891                 $(INSTALL_SCRIPT) Modules/ar_beos $(DESTDIR)$(LIBPL)/ar_beos; \
892                 echo "$(LIBPL)/ar_beos";                        \
893                 $(INSTALL_SCRIPT) Modules/ld_so_beos $(DESTDIR)$(LIBPL)/ld_so_beos; \
894                 echo "$(LIBPL)/ld_so_beos";                     \
895                 echo; echo "See Misc/BeOS-NOTES for details.";  \
896                 ;; \
897         esac
899 # Install the dynamically loadable modules
900 # This goes into $(exec_prefix)
901 sharedinstall:
902         $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
903                 --prefix=$(prefix) \
904                 --install-scripts=$(BINDIR) \
905                 --install-platlib=$(DESTSHARED) \
906                 --root=/$(DESTDIR)
908 # Here are a couple of targets for MacOSX again, to install a full
909 # framework-based Python. frameworkinstall installs everything, the
910 # subtargets install specific parts. Much of the actual work is offloaded to
911 # the Makefile in Mac
914 # This target is here for backward compatiblity, previous versions of Python
915 # hadn't integrated framework installation in the normal install process.
916 frameworkinstall: install
918 # On install, we re-make the framework
919 # structure in the install location, /Library/Frameworks/ or the argument to
920 # --enable-framework. If --enable-framework has been specified then we have
921 # automatically set prefix to the location deep down in the framework, so we
922 # only have to cater for the structural bits of the framework.
924 frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
926 frameworkinstallstructure:      $(LDLIBRARY)
927         @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
928                 echo Not configured with --enable-framework; \
929                 exit 1; \
930         else true; \
931         fi
932         @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
933                 if test ! -d $(DESTDIR)$$i; then \
934                         echo "Creating directory $(DESTDIR)$$i"; \
935                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
936                 else    true; \
937                 fi; \
938         done
939         $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
940         $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(DESTDIR)$(prefix)/Resources/Info.plist
941         $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(DESTDIR)$(prefix)/Resources/version.plist
942         $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
943                 $(DESTDIR)$(prefix)/Resources/English.lproj/InfoPlist.strings
944         $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
945         $(LN) -fsn Versions/Current/Python $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Python
946         $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
947         $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
948         $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
950 # This installs Mac/Lib into the framework
951 # Install a number of symlinks to keep software that expects a normal unix
952 # install (which includes python-config) happy.
953 frameworkinstallmaclib:
954         ln -fs "../../../Python" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a"
955         cd Mac && $(MAKE) installmacsubtree DESTDIR="$(DESTDIR)"
957 # This installs the IDE, the Launcher and other apps into /Applications
958 frameworkinstallapps:
959         cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
961 # This install the unix python and pythonw tools in /usr/local/bin
962 frameworkinstallunixtools:
963         cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
965 frameworkaltinstallunixtools:
966         cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"
968 # This installs the Demos and Tools into the applications directory.
969 # It is not part of a normal frameworkinstall
970 frameworkinstallextras:
971         cd Mac && Make installextras DESTDIR="$(DESTDIR)"
973 # This installs a few of the useful scripts in Tools/scripts
974 scriptsinstall:
975         SRCDIR=$(srcdir) $(RUNSHARED) \
976         ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
977         --prefix=$(prefix) \
978         --install-scripts=$(BINDIR) \
979         --root=/$(DESTDIR)
981 # Build the toplevel Makefile
982 Makefile.pre: Makefile.pre.in config.status
983         CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
984         $(MAKE) -f Makefile.pre Makefile
986 # Run the configure script.
987 config.status:  $(srcdir)/configure
988         $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
990 .PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
992 # Some make's put the object file in the current directory
993 .c.o:
994         $(CC) -c $(PY_CFLAGS) -o $@ $<
996 # Run reindent on the library
997 reindent:
998         ./python$(EXEEXT) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
1000 # Rerun configure with the same options as it was run last time,
1001 # provided the config.status script exists
1002 recheck:
1003         $(SHELL) config.status --recheck
1004         $(SHELL) config.status
1006 # Rebuild the configure script from configure.in; also rebuild pyconfig.h.in
1007 autoconf:
1008         (cd $(srcdir); autoconf)
1009         (cd $(srcdir); autoheader)
1011 # Create a tags file for vi
1012 tags::
1013         cd $(srcdir); \
1014         ctags -w -t Include/*.h; \
1015         for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \
1016         done; \
1017         sort -o tags tags
1019 # Create a tags file for GNU Emacs
1020 TAGS::
1021         cd $(srcdir); \
1022         etags Include/*.h; \
1023         for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
1025 # Sanitation targets -- clean leaves libraries, executables and tags
1026 # files, which clobber removes those as well
1027 pycremoval:
1028         find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
1030 clean: pycremoval
1031         find . -name '*.o' -exec rm -f {} ';'
1032         find . -name '*.s[ol]' -exec rm -f {} ';'
1033         find $(srcdir)/build -name 'fficonfig.h' -exec rm -f {} ';' || true
1034         find $(srcdir)/build -name 'fficonfig.py' -exec rm -f {} ';' || true
1036 clobber: clean
1037         -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
1038                 tags TAGS \
1039                 config.cache config.log pyconfig.h Modules/config.c
1040         -rm -rf build platform
1041         -rm -rf $(PYTHONFRAMEWORKDIR)
1043 # Make things extra clean, before making a distribution:
1044 # remove all generated files, even Makefile[.pre]
1045 # Keep configure and Python-ast.[ch], it's possible they can't be generated
1046 distclean: clobber
1047         -rm -f core Makefile Makefile.pre config.status \
1048                 Modules/Setup Modules/Setup.local Modules/Setup.config
1049         find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
1050                            -o -name '[@,#]*' -o -name '*.old' \
1051                            -o -name '*.orig' -o -name '*.rej' \
1052                            -o -name '*.bak' ')' \
1053                            -exec rm -f {} ';'
1055 # Check for smelly exported symbols (not starting with Py/_Py)
1056 smelly: all
1057         nm -p $(LIBRARY) | \
1058                 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
1060 # Find files with funny names
1061 funny:
1062         find $(DISTDIRS) -type d \
1063                 -o -name '*.[chs]' \
1064                 -o -name '*.py' \
1065                 -o -name '*.doc' \
1066                 -o -name '*.sty' \
1067                 -o -name '*.bib' \
1068                 -o -name '*.dat' \
1069                 -o -name '*.el' \
1070                 -o -name '*.fd' \
1071                 -o -name '*.in' \
1072                 -o -name '*.tex' \
1073                 -o -name '*,[vpt]' \
1074                 -o -name 'Setup' \
1075                 -o -name 'Setup.*' \
1076                 -o -name README \
1077                 -o -name Makefile \
1078                 -o -name ChangeLog \
1079                 -o -name Repository \
1080                 -o -name Root \
1081                 -o -name Entries \
1082                 -o -name Tag \
1083                 -o -name tags \
1084                 -o -name TAGS \
1085                 -o -name .cvsignore \
1086                 -o -name MANIFEST \
1087                 -o -print
1089 # Dependencies
1091 Python/thread.o: @THREADHEADERS@
1093 # Declare targets that aren't real files
1094 .PHONY: all build_all sharedmods oldsharedmods test quicktest memtest
1095 .PHONY: install altinstall oldsharedinstall bininstall altbininstall
1096 .PHONY: maninstall libinstall inclinstall libainstall sharedinstall
1097 .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
1098 .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
1099 .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean 
1100 .PHONY: smelly funny
1102 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY