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