Re-tagging.
[python/dscho.git] / Makefile.pre.in
blob9e01d84bc973060e65f826192c5b2b978405018c
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@
175 PYTHON=         python$(EXE)
176 BUILDPYTHON=    python$(BUILDEXE)
178 # The task to run while instrument when building the profile-opt target
179 PROFILE_TASK=   $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
180 #PROFILE_TASK=  $(srcdir)/Lib/test/regrtest.py
182 # === Definitions added by makesetup ===
185 ##########################################################################
186 # Modules
187 MODULE_OBJS=    \
188                 Modules/config.o \
189                 Modules/getpath.o \
190                 Modules/main.o \
191                 Modules/gcmodule.o
193 # Used of signalmodule.o is not available
194 SIGNAL_OBJS=    @SIGNAL_OBJS@
197 ##########################################################################
198 # Grammar
199 GRAMMAR_H=      $(srcdir)/Include/graminit.h
200 GRAMMAR_C=      $(srcdir)/Python/graminit.c
201 GRAMMAR_INPUT=  $(srcdir)/Grammar/Grammar
204 ##########################################################################
205 # Parser
206 PGEN=           Parser/pgen$(EXE)
208 POBJS=          \
209                 Parser/acceler.o \
210                 Parser/grammar1.o \
211                 Parser/listnode.o \
212                 Parser/node.o \
213                 Parser/parser.o \
214                 Parser/parsetok.o \
215                 Parser/bitset.o \
216                 Parser/metagrammar.o \
217                 Parser/firstsets.o \
218                 Parser/grammar.o \
219                 Parser/pgen.o
221 PARSER_OBJS=    $(POBJS) Parser/myreadline.o Parser/tokenizer.o
223 PGOBJS=         \
224                 Objects/obmalloc.o \
225                 Python/mysnprintf.o \
226                 Parser/tokenizer_pgen.o \
227                 Parser/printgrammar.o \
228                 Parser/pgenmain.o
230 PARSER_HEADERS= \
231                 Parser/parser.h \
232                 Parser/tokenizer.h
234 PGENOBJS=       $(PGENMAIN) $(POBJS) $(PGOBJS)
236 ##########################################################################
237 # AST
238 AST_H_DIR=      $(srcdir)/Include
239 AST_H=          $(AST_H_DIR)/Python-ast.h
240 AST_C_DIR=      $(srcdir)/Python
241 AST_C=          $(AST_C_DIR)/Python-ast.c
242 AST_ASDL=       $(srcdir)/Parser/Python.asdl
244 ASDLGEN_FILES=  $(srcdir)/Parser/asdl.py $(srcdir)/Parser/asdl_c.py
245 # XXX Note that a build now requires Python exist before the build starts
246 ASDLGEN=        $(srcdir)/Parser/asdl_c.py
248 ##########################################################################
249 # Python
250 PYTHON_OBJS=    \
251                 Python/_warnings.o \
252                 Python/Python-ast.o \
253                 Python/asdl.o \
254                 Python/ast.o \
255                 Python/bltinmodule.o \
256                 Python/ceval.o \
257                 Python/compile.o \
258                 Python/codecs.o \
259                 Python/errors.o \
260                 Python/frozen.o \
261                 Python/frozenmain.o \
262                 Python/future.o \
263                 Python/getargs.o \
264                 Python/getcompiler.o \
265                 Python/getcopyright.o \
266                 Python/getmtime.o \
267                 Python/getplatform.o \
268                 Python/getversion.o \
269                 Python/graminit.o \
270                 Python/import.o \
271                 Python/importdl.o \
272                 Python/marshal.o \
273                 Python/modsupport.o \
274                 Python/mystrtoul.o \
275                 Python/mysnprintf.o \
276                 Python/peephole.o \
277                 Python/pyarena.o \
278                 Python/pyfpe.o \
279                 Python/pymath.o \
280                 Python/pystate.o \
281                 Python/pythonrun.o \
282                 Python/structmember.o \
283                 Python/symtable.o \
284                 Python/sysmodule.o \
285                 Python/traceback.o \
286                 Python/getopt.o \
287                 Python/pystrcmp.o \
288                 Python/pystrtod.o \
289                 Python/formatter_unicode.o \
290                 Python/$(DYNLOADFILE) \
291                 $(LIBOBJS) \
292                 $(MACHDEP_OBJS) \
293                 $(THREADOBJ)
296 ##########################################################################
297 # Objects
298 OBJECT_OBJS=    \
299                 Objects/abstract.o \
300                 Objects/boolobject.o \
301                 Objects/bytes_methods.o \
302                 Objects/bytearrayobject.o \
303                 Objects/bytesobject.o \
304                 Objects/cellobject.o \
305                 Objects/classobject.o \
306                 Objects/cobject.o \
307                 Objects/codeobject.o \
308                 Objects/complexobject.o \
309                 Objects/descrobject.o \
310                 Objects/enumobject.o \
311                 Objects/exceptions.o \
312                 Objects/genobject.o \
313                 Objects/fileobject.o \
314                 Objects/floatobject.o \
315                 Objects/frameobject.o \
316                 Objects/funcobject.o \
317                 Objects/iterobject.o \
318                 Objects/listobject.o \
319                 Objects/longobject.o \
320                 Objects/dictobject.o \
321                 Objects/memoryobject.o \
322                 Objects/methodobject.o \
323                 Objects/moduleobject.o \
324                 Objects/object.o \
325                 Objects/obmalloc.o \
326                 Objects/rangeobject.o \
327                 Objects/setobject.o \
328                 Objects/sliceobject.o \
329                 Objects/structseq.o \
330                 Objects/tupleobject.o \
331                 Objects/typeobject.o \
332                 Objects/unicodeobject.o \
333                 Objects/unicodectype.o \
334                 Objects/weakrefobject.o
337 ##########################################################################
338 # objects that get linked into the Python library
339 LIBRARY_OBJS=   \
340                 Modules/getbuildinfo.o \
341                 $(PARSER_OBJS) \
342                 $(OBJECT_OBJS) \
343                 $(PYTHON_OBJS) \
344                 $(MODULE_OBJS) \
345                 $(SIGNAL_OBJS) \
346                 $(MODOBJS)
348 #########################################################################
349 # Rules
351 # Default target
352 all:            build_all
353 build_all:      $(BUILDPYTHON) oldsharedmods sharedmods
355 # Compile a binary with gcc profile guided optimization.
356 profile-opt:
357         @echo "Building with support for profile generation:"
358         $(MAKE) clean
359         $(MAKE) build_all_generate_profile
360         @echo "Running benchmark to generate profile data:"
361         $(MAKE) profile-removal
362         $(MAKE) run_profile_task
363         @echo "Rebuilding with profile guided optimizations:"
364         $(MAKE) clean
365         $(MAKE) build_all_use_profile
367 build_all_generate_profile:
368         $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
370 run_profile_task:
371         ./$(BUILDPYTHON) $(PROFILE_TASK)
373 build_all_use_profile:
374         $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use"
376 coverage:
377         @echo "Building with support for coverage checking:"
378         $(MAKE) clean
379         $(MAKE) all CFLAGS="$(CFLAGS) -O0 -pg -fprofile-arcs -ftest-coverage" LIBS="$(LIBS) -lgcov"
382 # Build the interpreter
383 $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
384                 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
385                         Modules/python.o \
386                         $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
388 platform: $(BUILDPYTHON)
389         $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform
392 # Build the shared modules
393 sharedmods: $(BUILDPYTHON)
394         @case $$MAKEFLAGS in \
395         *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
396         *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
397         esac
399 # Build static library
400 # avoid long command lines, same as LIBRARY_OBJS
401 $(LIBRARY): $(LIBRARY_OBJS)
402         -rm -f $@
403         $(AR) cr $@ Modules/getbuildinfo.o
404         $(AR) cr $@ $(PARSER_OBJS)
405         $(AR) cr $@ $(OBJECT_OBJS)
406         $(AR) cr $@ $(PYTHON_OBJS)
407         $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
408         $(AR) cr $@ $(MODOBJS)
409         $(RANLIB) $@
411 libpython$(VERSION).so: $(LIBRARY_OBJS)
412         if test $(INSTSONAME) != $(LDLIBRARY); then \
413                 $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
414                 $(LN) -f $(INSTSONAME) $@; \
415         else\
416                 $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
417         fi
419 libpython$(VERSION).sl: $(LIBRARY_OBJS)
420         $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST)
422 # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
423 # minimal framework (not including the Lib directory and such) in the current
424 # directory.
425 RESSRCDIR=Mac/Resources/framework
426 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
427                 $(LIBRARY) \
428                 $(RESSRCDIR)/Info.plist
429         $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
430         if test "${UNIVERSALSDK}"; then \
431                 $(CC) -o $(LDLIBRARY) @UNIVERSAL_ARCH_FLAGS@ -dynamiclib \
432                         -isysroot "${UNIVERSALSDK}" \
433                         -all_load $(LIBRARY) -Wl,-single_module \
434                         -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \
435                         -compatibility_version $(VERSION) \
436                         -current_version $(VERSION); \
437         else \
438                 /usr/bin/libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \
439                         @LIBTOOL_CRUFT@ ;\
440         fi
441         $(INSTALL) -d -m $(DIRMODE)  \
442                 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
443         $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
444                 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
445         $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
446         $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
447         $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
448         $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
450 # This rule builds the Cygwin Python DLL and import library if configured
451 # for a shared core library; otherwise, this rule is a noop.
452 $(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
453         if test -n "$(DLLLIBRARY)"; then \
454                 $(LDSHARED) $(LDFLAGS) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
455                         $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST); \
456         else true; \
457         fi
460 oldsharedmods: $(SHAREDMODS)
463 Makefile Modules/config.c: Makefile.pre \
464                                 $(srcdir)/Modules/config.c.in \
465                                 $(MAKESETUP) \
466                                 Modules/Setup.config \
467                                 Modules/Setup \
468                                 Modules/Setup.local
469         $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
470                                 -s Modules \
471                                 Modules/Setup.config \
472                                 Modules/Setup.local \
473                                 Modules/Setup
474         @mv config.c Modules
475         @echo "The Makefile was updated, you may need to re-run make."
478 Modules/Setup: $(srcdir)/Modules/Setup.dist
479         @if test -f Modules/Setup; then \
480                 echo "-----------------------------------------------"; \
481                 echo "Modules/Setup.dist is newer than Modules/Setup;"; \
482                 echo "check to make sure you have all the updates you"; \
483                 echo "need in your Modules/Setup file."; \
484                 echo "Usually, copying Modules/Setup.dist to Modules/Setup will work."; \
485                 echo "-----------------------------------------------"; \
486         fi
488 ############################################################################
489 # Special rules for object files
491 Modules/getbuildinfo.o: $(PARSER_OBJS) \
492                 $(OBJECT_OBJS) \
493                 $(PYTHON_OBJS) \
494                 $(MODULE_OBJS) \
495                 $(SIGNAL_OBJS) \
496                 $(MODOBJS) \
497                 $(srcdir)/Modules/getbuildinfo.c
498         $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
500 Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
501         $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
502                 -DPREFIX='"$(prefix)"' \
503                 -DEXEC_PREFIX='"$(exec_prefix)"' \
504                 -DVERSION='"$(VERSION)"' \
505                 -DVPATH='"$(VPATH)"' \
506                 -o $@ $(srcdir)/Modules/getpath.c
508 Modules/python.o: $(srcdir)/Modules/python.c
509         $(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
512 $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
513                 -@$(INSTALL) -d Include
514                 -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
516 $(PGEN):        $(PGENOBJS)
517                 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
519 Parser/grammar.o:       $(srcdir)/Parser/grammar.c \
520                                 $(srcdir)/Include/token.h \
521                                 $(srcdir)/Include/grammar.h
522 Parser/metagrammar.o:   $(srcdir)/Parser/metagrammar.c
524 Parser/tokenizer_pgen.o:        $(srcdir)/Parser/tokenizer.c
526 Parser/pgenmain.o:      $(srcdir)/Include/parsetok.h
528 $(AST_H): $(AST_ASDL) $(ASDLGEN_FILES)
529         $(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL)
531 $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
532         $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL)
534 Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H)
536 Python/getplatform.o: $(srcdir)/Python/getplatform.c
537                 $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
539 Python/importdl.o: $(srcdir)/Python/importdl.c
540                 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
542 Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
543                                 $(srcdir)/Objects/unicodetype_db.h
545 BYTESTR_DEPS = \
546                 $(srcdir)/Include/bytes_methods.h \
547                 $(srcdir)/Objects/stringlib/count.h \
548                 $(srcdir)/Objects/stringlib/ctype.h \
549                 $(srcdir)/Objects/stringlib/eq.h \
550                 $(srcdir)/Objects/stringlib/fastsearch.h \
551                 $(srcdir)/Objects/stringlib/find.h \
552                 $(srcdir)/Objects/stringlib/partition.h \
553                 $(srcdir)/Objects/stringlib/stringdefs.h \
554                 $(srcdir)/Objects/stringlib/string_format.h \
555                 $(srcdir)/Objects/stringlib/transmogrify.h \
556                 $(srcdir)/Objects/stringlib/unicodedefs.h \
557                 $(srcdir)/Objects/stringlib/localeutil.h
559 Objects/stringobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS)
561 Objects/bytesobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS) 
563 Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \
564                                              $(BYTESTR_DEPS) \
565                                              $(srcdir)/Objects/stringlib/formatter.h
567 Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \
568                                              $(BYTESTR_DEPS)
571 ############################################################################
572 # Header files
574 PYTHON_HEADERS= \
575                 Include/Python-ast.h \
576                 Include/Python.h \
577                 Include/abstract.h \
578                 Include/asdl.h \
579                 Include/ast.h \
580                 Include/bitset.h \
581                 Include/boolobject.h \
582                 Include/bytes_methods.h \
583                 Include/bytearrayobject.h \
584                 Include/bytesobject.h \
585                 Include/cellobject.h \
586                 Include/ceval.h \
587                 Include/classobject.h \
588                 Include/cobject.h \
589                 Include/code.h \
590                 Include/codecs.h \
591                 Include/compile.h \
592                 Include/complexobject.h \
593                 Include/descrobject.h \
594                 Include/dictobject.h \
595                 Include/enumobject.h \
596                 Include/errcode.h \
597                 Include/eval.h \
598                 Include/fileobject.h \
599                 Include/floatobject.h \
600                 Include/frameobject.h \
601                 Include/funcobject.h \
602                 Include/genobject.h \
603                 Include/import.h \
604                 Include/intrcheck.h \
605                 Include/iterobject.h \
606                 Include/listobject.h \
607                 Include/longintrepr.h \
608                 Include/longobject.h \
609                 Include/marshal.h \
610                 Include/memoryobject.h \
611                 Include/metagrammar.h \
612                 Include/methodobject.h \
613                 Include/modsupport.h \
614                 Include/moduleobject.h \
615                 Include/node.h \
616                 Include/object.h \
617                 Include/objimpl.h \
618                 Include/opcode.h \
619                 Include/osdefs.h \
620                 Include/parsetok.h \
621                 Include/patchlevel.h \
622                 Include/pgen.h \
623                 Include/pgenheaders.h \
624                 Include/pyarena.h \
625                 Include/pydebug.h \
626                 Include/pyerrors.h \
627                 Include/pyfpe.h \
628                 Include/pymath.h \
629                 Include/pygetopt.h \
630                 Include/pymem.h \
631                 Include/pyport.h \
632                 Include/pystate.h \
633                 Include/pystrcmp.h \
634                 Include/pystrtod.h \
635                 Include/pythonrun.h \
636                 Include/pythread.h \
637                 Include/rangeobject.h \
638                 Include/setobject.h \
639                 Include/sliceobject.h \
640                 Include/structmember.h \
641                 Include/structseq.h \
642                 Include/symtable.h \
643                 Include/sysmodule.h \
644                 Include/traceback.h \
645                 Include/tupleobject.h \
646                 Include/ucnhash.h \
647                 Include/unicodeobject.h \
648                 Include/warnings.h \
649                 Include/weakrefobject.h \
650                 pyconfig.h \
651                 $(PARSER_HEADERS)
653 $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
656 ######################################################################
658 # Test the interpreter (twice, once without .pyc files, once with)
659 # In the past, we've had problems where bugs in the marshalling or
660 # elsewhere caused bytecode read from .pyc files to behave differently
661 # than bytecode generated directly from a .py source file.  Sometimes
662 # the bytecode read from a .pyc file had the bug, somtimes the directly
663 # generated bytecode.  This is sometimes a very shy bug needing a lot of
664 # sample data.
666 TESTOPTS=       -l $(EXTRATESTOPTS)
667 TESTPROG=       $(srcdir)/Lib/test/regrtest.py
668 TESTPYTHON=     $(RUNSHARED) ./$(BUILDPYTHON) -E -bb
669 test:           all platform
670                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
671                 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
672                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
674 testall:        all platform
675                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
676                 $(TESTPYTHON) $(srcdir)/Lib/compileall.py
677                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
678                 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
679                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
681 #  Run the unitests for both architectures in a Universal build on OSX
682 #  Must be run on an Intel box.
683 testuniversal:  all platform
684                 if [ `arch` != 'i386' ];then \
685                         echo "This can only be used on OSX/i386" ;\
686                         exit 1 ;\
687                 fi
688                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
689                 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
690                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall
691                 $(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E $(TESTPROG) $(TESTOPTS) -uall
694 # Like testall, but with a single pass only
695 # run an optional script to include some information about the build environment
696 buildbottest:   all platform
697                 -@if which pybuildbot.identify >/dev/null 2>&1; then \
698                         pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
699                 fi
700                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS) -uall -rw
702 QUICKTESTOPTS=  $(TESTOPTS) -x test_thread test_signal test_strftime \
703                 test_unicodedata test_re test_sre test_select test_poll \
704                 test_struct test_zlib
705 quicktest:      all platform
706                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
707                 -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
708                 $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
710 MEMTESTOPTS=    $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
711                 test_longexp
712 memtest:        all platform
713                 -rm -f $(srcdir)/Lib/test/*.py[co]
714                 -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
715                 $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
717 # Install everything
718 fullinstall:    @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@
720 # "make install" is an alias for "make altinstall" since we never want to
721 # overwrite Python 2.x.
722 install:        altinstall
723                 @echo "* Note: not installed as 'python'."
724                 @echo "* Use 'make fullinstall' to install as 'python'."
725                 @echo "* However, 'make fullinstall' is discouraged,"
726                 @echo "* as it will clobber your Python 2.x installation."
728 # Install almost everything without disturbing previous versions
729 altinstall:     @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \
730                 sharedinstall oldsharedinstall @FRAMEWORKALTINSTALLLAST@
732 # Install shared libraries enabled by Setup
733 DESTDIRS=       $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
735 oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
736                 @for i in X $(SHAREDMODS); do \
737                   if test $$i != X; then \
738                     echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
739                     $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
740                   fi; \
741                 done
743 $(DESTSHARED):
744                 @for i in $(DESTDIRS); \
745                 do \
746                         if test ! -d $(DESTDIR)$$i; then \
747                                 echo "Creating directory $$i"; \
748                                 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
749                         else    true; \
750                         fi; \
751                 done
754 # Install the interpreter (by creating a hard link to python$(VERSION))
755 bininstall:     altbininstall
756         -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON); \
757         then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
758         else true; \
759         fi
760         (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
761         -rm -f $(DESTDIR)$(BINDIR)/python-config
762         (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config)
764 # Install the interpreter with $(VERSION) affixed
765 # This goes into $(exec_prefix)
766 altbininstall:  $(BUILDPYTHON)
767         @for i in $(BINDIR) $(LIBDIR); \
768         do \
769                 if test ! -d $(DESTDIR)$$i; then \
770                         echo "Creating directory $$i"; \
771                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
772                 else    true; \
773                 fi; \
774         done
775         $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
776         if test -f libpython$(VERSION)$(SO); then \
777                 if test "$(SO)" = .dll; then \
778                         $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(BINDIR); \
779                 else \
780                         $(INSTALL_SHARED) libpython$(VERSION)$(SO) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
781                         if test libpython$(VERSION)$(SO) != $(INSTSONAME); then \
782                                 (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \
783                         fi \
784                 fi; \
785         else    true; \
786         fi
788 # Install the manual page
789 maninstall:
790         @for i in $(MANDIR) $(MANDIR)/man1; \
791         do \
792                 if test ! -d $(DESTDIR)$$i; then \
793                         echo "Creating directory $$i"; \
794                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
795                 else    true; \
796                 fi; \
797         done
798         $(INSTALL_DATA) $(srcdir)/Misc/python.man \
799                 $(DESTDIR)$(MANDIR)/man1/python$(VERSION).1
801 # Install the library
802 PLATDIR=        plat-$(MACHDEP)
803 EXTRAPLATDIR= @EXTRAPLATDIR@
804 MACHDEPS=       $(PLATDIR) $(EXTRAPLATDIR)
805 XMLLIBSUBDIRS=  xml xml/dom xml/etree xml/parsers xml/sax
806 LIBSUBDIRS=     tkinter site-packages test test/output test/data \
807                 test/decimaltestdata \
808                 encodings \
809                 email email/mime email/test email/test/data \
810                 html json json/tests http dbm xmlrpc \
811                 sqlite3 sqlite3/test \
812                 logging bsddb bsddb/test csv wsgiref urllib \
813                 lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
814                 ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \
815                 distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
816                 setuptools setuptools/command setuptools/tests setuptools.egg-info \
817                 multiprocessing multiprocessing/dummy \
818                 curses $(MACHDEPS)
819 libinstall:     build_all $(srcdir)/Lib/$(PLATDIR)
820         @for i in $(SCRIPTDIR) $(LIBDEST); \
821         do \
822                 if test ! -d $(DESTDIR)$$i; then \
823                         echo "Creating directory $$i"; \
824                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
825                 else    true; \
826                 fi; \
827         done
828         @for d in $(LIBSUBDIRS); \
829         do \
830                 a=$(srcdir)/Lib/$$d; \
831                 if test ! -d $$a; then continue; else true; fi; \
832                 b=$(LIBDEST)/$$d; \
833                 if test ! -d $(DESTDIR)$$b; then \
834                         echo "Creating directory $$b"; \
835                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
836                 else    true; \
837                 fi; \
838         done
839         @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \
840         do \
841                 if test -x $$i; then \
842                         $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
843                         echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
844                 else \
845                         $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
846                         echo $(INSTALL_DATA) $$i $(LIBDEST); \
847                 fi; \
848         done
849         @for d in $(LIBSUBDIRS); \
850         do \
851                 a=$(srcdir)/Lib/$$d; \
852                 if test ! -d $$a; then continue; else true; fi; \
853                 if test `ls $$a | wc -l` -lt 1; then continue; fi; \
854                 b=$(LIBDEST)/$$d; \
855                 for i in $$a/*; \
856                 do \
857                         case $$i in \
858                         *CVS) ;; \
859                         *.py[co]) ;; \
860                         *.orig) ;; \
861                         *~) ;; \
862                         *) \
863                                 if test -d $$i; then continue; fi; \
864                                 if test -x $$i; then \
865                                     echo $(INSTALL_SCRIPT) $$i $$b; \
866                                     $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
867                                 else \
868                                     echo $(INSTALL_DATA) $$i $$b; \
869                                     $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
870                                 fi;; \
871                         esac; \
872                 done; \
873         done
874         $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
875         -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
876                 ./$(BUILDPYTHON) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
877                 -d $(LIBDEST) -f \
878                 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
879         -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
880                 ./$(BUILDPYTHON) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
881                 -d $(LIBDEST) -f \
882                 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
883         -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
884                 ./$(BUILDPYTHON) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
885                 -d $(LIBDEST)/site-packages -f \
886                 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
887         -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
888                 ./$(BUILDPYTHON) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
889                 -d $(LIBDEST)/site-packages -f \
890                 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
891         -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
892                 ./$(BUILDPYTHON) -Wi -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
894 # Create the PLATDIR source directory, if one wasn't distributed..
895 $(srcdir)/Lib/$(PLATDIR):
896         mkdir $(srcdir)/Lib/$(PLATDIR)
897         cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
898         export PATH; PATH="`pwd`:$$PATH"; \
899         export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
900         export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
901         export EXE; EXE="$(BUILDEXE)"; \
902         cd $(srcdir)/Lib/$(PLATDIR); ./regen
904 # Install the include files
905 INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
906 inclinstall:
907         @for i in $(INCLDIRSTOMAKE); \
908         do \
909                 if test ! -d $(DESTDIR)$$i; then \
910                         echo "Creating directory $$i"; \
911                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
912                 else    true; \
913                 fi; \
914         done
915         @for i in $(srcdir)/Include/*.h; \
916         do \
917                 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
918                 $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
919         done
920         $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
922 # Install the library and miscellaneous stuff needed for extending/embedding
923 # This goes into $(exec_prefix)
924 LIBPL=          $(LIBP)/config
925 libainstall:    all
926         @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
927         do \
928                 if test ! -d $(DESTDIR)$$i; then \
929                         echo "Creating directory $$i"; \
930                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
931                 else    true; \
932                 fi; \
933         done
934         @if test -d $(LIBRARY); then :; else \
935                 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
936                         if test "$(SO)" = .dll; then \
937                                 $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
938                         else \
939                                 $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
940                                 $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
941                         fi; \
942                 else \
943                         echo Skip install of $(LIBRARY) - use make frameworkinstall; \
944                 fi; \
945         fi
946         $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
947         $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
948         $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
949         $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
950         $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
951         $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
952         $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
953         $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
954         $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
955         # Substitution happens here, as the completely-expanded BINDIR
956         # is not available in configure
957         sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
958         $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
959         rm python-config
960         @if [ -s Modules/python.exp -a \
961                 "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
962                 echo; echo "Installing support files for building shared extension modules on AIX:"; \
963                 $(INSTALL_DATA) Modules/python.exp              \
964                                 $(DESTDIR)$(LIBPL)/python.exp;          \
965                 echo; echo "$(LIBPL)/python.exp";               \
966                 $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix  \
967                                 $(DESTDIR)$(LIBPL)/makexp_aix;          \
968                 echo "$(LIBPL)/makexp_aix";                     \
969                 $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix   \
970                                 $(DESTDIR)$(LIBPL)/ld_so_aix;           \
971                 echo "$(LIBPL)/ld_so_aix";                      \
972                 echo; echo "See Misc/AIX-NOTES for details.";   \
973         else true; \
974         fi
976 # Install the dynamically loadable modules
977 # This goes into $(exec_prefix)
978 sharedinstall:
979         $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
980                 --prefix=$(prefix) \
981                 --install-scripts=$(BINDIR) \
982                 --install-platlib=$(DESTSHARED) \
983                 --root=/$(DESTDIR)
985 # Here are a couple of targets for MacOSX again, to install a full
986 # framework-based Python. frameworkinstall installs everything, the
987 # subtargets install specific parts. Much of the actual work is offloaded to
988 # the Makefile in Mac
991 # This target is here for backward compatiblity, previous versions of Python
992 # hadn't integrated framework installation in the normal install process.
993 frameworkinstall: install
995 # On install, we re-make the framework
996 # structure in the install location, /Library/Frameworks/ or the argument to
997 # --enable-framework. If --enable-framework has been specified then we have
998 # automatically set prefix to the location deep down in the framework, so we
999 # only have to cater for the structural bits of the framework.
1001 frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
1003 frameworkinstallstructure:      $(LDLIBRARY)
1004         @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
1005                 echo Not configured with --enable-framework; \
1006                 exit 1; \
1007         else true; \
1008         fi
1009         @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
1010                 if test ! -d $(DESTDIR)$$i; then \
1011                         echo "Creating directory $(DESTDIR)$$i"; \
1012                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
1013                 else    true; \
1014                 fi; \
1015         done
1016         $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
1017         sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
1018         $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
1019         $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
1020         $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
1021         $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
1022         $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
1024 # This installs Mac/Lib into the framework
1025 # Install a number of symlinks to keep software that expects a normal unix
1026 # install (which includes python-config) happy.
1027 frameworkinstallmaclib:
1028         ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a"
1030 # This installs the IDE, the Launcher and other apps into /Applications
1031 frameworkinstallapps:
1032         cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
1034 frameworkinstallapps4way:
1035         cd Mac && $(MAKE) installapps4way DESTDIR="$(DESTDIR)"
1037 # This install the unix python and pythonw tools in /usr/local/bin
1038 frameworkinstallunixtools:
1039         cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
1041 frameworkinstallunixtools4way:
1042         cd Mac && $(MAKE) installunixtools4way DESTDIR="$(DESTDIR)"
1044 frameworkaltinstallunixtools:
1045         cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"
1047 frameworkaltinstallunixtools4way:
1048         cd Mac && $(MAKE) altinstallunixtools4way DESTDIR="$(DESTDIR)"
1050 # This installs the Demos and Tools into the applications directory.
1051 # It is not part of a normal frameworkinstall
1052 frameworkinstallextras:
1053         cd Mac && Make installextras DESTDIR="$(DESTDIR)"
1055 # This installs a few of the useful scripts in Tools/scripts
1056 scriptsinstall:
1057         SRCDIR=$(srcdir) $(RUNSHARED) \
1058         ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
1059         --prefix=$(prefix) \
1060         --install-scripts=$(BINDIR) \
1061         --root=/$(DESTDIR)
1063 # Build the toplevel Makefile
1064 Makefile.pre: Makefile.pre.in config.status
1065         CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
1066         $(MAKE) -f Makefile.pre Makefile
1068 # Run the configure script.
1069 config.status:  $(srcdir)/configure
1070         $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
1072 .PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
1074 # Some make's put the object file in the current directory
1075 .c.o:
1076         $(CC) -c $(PY_CFLAGS) -o $@ $<
1078 # Run reindent on the library
1079 reindent:
1080         ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
1082 # Rerun configure with the same options as it was run last time,
1083 # provided the config.status script exists
1084 recheck:
1085         $(SHELL) config.status --recheck
1086         $(SHELL) config.status
1088 # Rebuild the configure script from configure.in; also rebuild pyconfig.h.in
1089 autoconf:
1090         (cd $(srcdir); autoconf)
1091         (cd $(srcdir); autoheader)
1093 # Create a tags file for vi
1094 tags::
1095         cd $(srcdir); \
1096         ctags -w -t Include/*.h; \
1097         for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \
1098         done; \
1099         sort -o tags tags
1101 # Create a tags file for GNU Emacs
1102 TAGS::
1103         cd $(srcdir); \
1104         etags Include/*.h; \
1105         for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
1107 # Sanitation targets -- clean leaves libraries, executables and tags
1108 # files, which clobber removes those as well
1109 pycremoval:
1110         find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
1112 rmtestturds:
1113         -rm -f *BAD *GOOD *SKIPPED
1114         -rm -rf OUT
1115         -rm -f *.TXT
1116         -rm -f *.txt
1117         -rm -f gb-18030-2000.xml
1119 docclean:
1120         -rm -rf Doc/build
1121         -rm -rf Doc/tools/sphinx Doc/tools/pygments Doc/tools/docutils
1123 clean: pycremoval
1124         find . -name '*.o' -exec rm -f {} ';'
1125         find . -name '*.s[ol]' -exec rm -f {} ';'
1126         find $(srcdir)/build -name 'fficonfig.h' -exec rm -f {} ';' || true
1127         find $(srcdir)/build -name 'fficonfig.py' -exec rm -f {} ';' || true
1129 profile-removal:
1130         find . -name '*.gc??' -exec rm -f {} ';'
1132 clobber: clean profile-removal
1133         -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
1134                 tags TAGS \
1135                 config.cache config.log pyconfig.h Modules/config.c
1136         -rm -rf build platform
1137         -rm -rf $(PYTHONFRAMEWORKDIR)
1139 # Make things extra clean, before making a distribution:
1140 # remove all generated files, even Makefile[.pre]
1141 # Keep configure and Python-ast.[ch], it's possible they can't be generated
1142 distclean: clobber
1143         -rm -f core Makefile Makefile.pre config.status \
1144                 Modules/Setup Modules/Setup.local Modules/Setup.config
1145         find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
1146                            -o -name '[@,#]*' -o -name '*.old' \
1147                            -o -name '*.orig' -o -name '*.rej' \
1148                            -o -name '*.bak' ')' \
1149                            -exec rm -f {} ';'
1151 # Check for smelly exported symbols (not starting with Py/_Py)
1152 smelly: all
1153         nm -p $(LIBRARY) | \
1154                 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
1156 # Find files with funny names
1157 funny:
1158         find $(DISTDIRS) \
1159                 -name .svn -prune \
1160                 -o -type d \
1161                 -o -name '*.[chs]' \
1162                 -o -name '*.py' \
1163                 -o -name '*.doc' \
1164                 -o -name '*.dat' \
1165                 -o -name '*.el' \
1166                 -o -name '*.fd' \
1167                 -o -name '*.in' \
1168                 -o -name '*.gif' \
1169                 -o -name '*.txt' \
1170                 -o -name '*.xml' \
1171                 -o -name '*.xbm' \
1172                 -o -name '*.xpm' \
1173                 -o -name '*.uue' \
1174                 -o -name '*.decTest' \
1175                 -o -name '*,[vpt]' \
1176                 -o -name 'Setup' \
1177                 -o -name 'Setup.*' \
1178                 -o -name regen \
1179                 -o -name README \
1180                 -o -name Makefile \
1181                 -o -name ChangeLog \
1182                 -o -name Repository \
1183                 -o -name Root \
1184                 -o -name Entries \
1185                 -o -name Tag \
1186                 -o -name tags \
1187                 -o -name TAGS \
1188                 -o -name .cvsignore \
1189                 -o -name MANIFEST \
1190                 -o -print
1192 # Perform some verification checks on any modified files.
1193 patchcheck:
1194         $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
1196 # Dependencies
1198 Python/thread.o: @THREADHEADERS@
1200 # Declare targets that aren't real files
1201 .PHONY: all build_all sharedmods oldsharedmods test quicktest memtest
1202 .PHONY: install altinstall oldsharedinstall bininstall altbininstall
1203 .PHONY: maninstall libinstall inclinstall libainstall sharedinstall
1204 .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
1205 .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
1206 .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean 
1207 .PHONY: smelly funny patchcheck
1209 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY