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