Merged revisions 85814 via svnmerge from
[python/dscho.git] / Makefile.pre.in
blob51134fe3d3074fbe4b610db5005e5235a1937315
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 GNULD=          @GNULD@
41 # Shell used by make (some versions default to the login shell, which is bad)
42 SHELL=          /bin/sh
44 # Use this to make a link between python$(VERSION) and python in $(BINDIR)
45 LN=             @LN@
47 # Portable install script (configure doesn't always guess right)
48 INSTALL=        @INSTALL@
49 INSTALL_PROGRAM=@INSTALL_PROGRAM@
50 INSTALL_SCRIPT= @INSTALL_SCRIPT@
51 INSTALL_DATA=   @INSTALL_DATA@
52 # Shared libraries must be installed with executable mode on some systems;
53 # rather than figuring out exactly which, we always give them executable mode.
54 # Also, making them read-only seems to be a good idea...
55 INSTALL_SHARED= ${INSTALL} -m 555
57 MAKESETUP=      $(srcdir)/Modules/makesetup
59 # Compiler options
60 OPT=            @OPT@
61 BASECFLAGS=     @BASECFLAGS@
62 CFLAGS=         $(BASECFLAGS) @CFLAGS@ $(OPT) $(EXTRA_CFLAGS)
63 # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
64 # be able to build extension modules using the directories specified in the
65 # environment variables
66 CPPFLAGS=       -I. -IInclude -I$(srcdir)/Include @CPPFLAGS@
67 LDFLAGS=        @LDFLAGS@
68 LDLAST=         @LDLAST@
69 SGI_ABI=        @SGI_ABI@
70 CCSHARED=       @CCSHARED@
71 LINKFORSHARED=  @LINKFORSHARED@
72 ARFLAGS=        @ARFLAGS@
73 # Extra C flags added for building the interpreter object files.
74 CFLAGSFORSHARED=@CFLAGSFORSHARED@
75 # C flags used for building the interpreter object files
76 PY_CFLAGS=      $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
79 # Machine-dependent subdirectories
80 MACHDEP=        @MACHDEP@
82 # Install prefix for architecture-independent files
83 prefix=         @prefix@
85 # Install prefix for architecture-dependent files
86 exec_prefix=    @exec_prefix@
88 # Install prefix for data files
89 datarootdir=    @datarootdir@
91 # Expanded directories
92 BINDIR=         @bindir@
93 LIBDIR=         @libdir@
94 MANDIR=         @mandir@
95 INCLUDEDIR=     @includedir@
96 CONFINCLUDEDIR= $(exec_prefix)/include
97 SCRIPTDIR=      $(prefix)/lib
99 # Detailed destination directories
100 BINLIBDEST=     $(LIBDIR)/python$(VERSION)
101 LIBDEST=        $(SCRIPTDIR)/python$(VERSION)
102 INCLUDEPY=      $(INCLUDEDIR)/python$(VERSION)
103 CONFINCLUDEPY=  $(CONFINCLUDEDIR)/python$(VERSION)
104 LIBP=           $(LIBDIR)/python$(VERSION)
106 # Symbols used for using shared libraries
107 SO=             @SO@
108 LDSHARED=       @LDSHARED@
109 BLDSHARED=      @BLDSHARED@
110 DESTSHARED=     $(BINLIBDEST)/lib-dynload
112 # Executable suffix (.exe on Windows and Mac OS X)
113 EXE=            @EXEEXT@
114 BUILDEXE=       @BUILDEXEEXT@
116 # Short name and location for Mac OS X Python framework
117 UNIVERSALSDK=@UNIVERSALSDK@
118 PYTHONFRAMEWORK=        @PYTHONFRAMEWORK@
119 PYTHONFRAMEWORKDIR=     @PYTHONFRAMEWORKDIR@
120 PYTHONFRAMEWORKPREFIX=  @PYTHONFRAMEWORKPREFIX@
121 PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
122 # Deployment target selected during configure, to be checked
123 # by distutils. The export statement is needed to ensure that the
124 # deployment target is active during build.
125 MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
126 @EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
128 # Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
129 OTHER_LIBTOOL_OPT=@OTHER_LIBTOOL_OPT@
131 # Environment to run shared python without installed libraries
132 RUNSHARED=       @RUNSHARED@
134 # Modes for directories, executables and data files created by the
135 # install process.  Default to user-only-writable for all file types.
136 DIRMODE=        755
137 EXEMODE=        755
138 FILEMODE=       644
140 # configure script arguments
141 CONFIG_ARGS=    @CONFIG_ARGS@
144 # Subdirectories with code
145 SRCDIRS=        @SRCDIRS@
147 # Other subdirectories
148 SUBDIRSTOO=     Include Lib Misc Demo
150 # Files and directories to be distributed
151 CONFIGFILES=    configure configure.in acconfig.h pyconfig.h.in Makefile.pre.in
152 DISTFILES=      README ChangeLog $(CONFIGFILES)
153 DISTDIRS=       $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
154 DIST=           $(DISTFILES) $(DISTDIRS)
157 LIBRARY=        @LIBRARY@
158 LDLIBRARY=      @LDLIBRARY@
159 BLDLIBRARY=     @BLDLIBRARY@
160 DLLLIBRARY=     @DLLLIBRARY@
161 LDLIBRARYDIR=   @LDLIBRARYDIR@
162 INSTSONAME=     @INSTSONAME@
165 LIBS=           @LIBS@
166 LIBM=           @LIBM@
167 LIBC=           @LIBC@
168 SYSLIBS=        $(LIBM) $(LIBC)
169 SHLIBS=         @SHLIBS@
171 THREADOBJ=      @THREADOBJ@
172 DLINCLDIR=      @DLINCLDIR@
173 DYNLOADFILE=    @DYNLOADFILE@
174 MACHDEP_OBJS=   @MACHDEP_OBJS@
175 LIBOBJDIR=      Python/
176 LIBOBJS=        @LIBOBJS@
178 PYTHON=         python$(EXE)
179 BUILDPYTHON=    python$(BUILDEXE)
181 # The task to run while instrument when building the profile-opt target
182 PROFILE_TASK=   $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
183 #PROFILE_TASK=  $(srcdir)/Lib/test/regrtest.py
185 # === Definitions added by makesetup ===
188 ##########################################################################
189 # Modules
190 MODULE_OBJS=    \
191                 Modules/config.o \
192                 Modules/getpath.o \
193                 Modules/main.o \
194                 Modules/gcmodule.o
196 # Used of signalmodule.o is not available
197 SIGNAL_OBJS=    @SIGNAL_OBJS@
199 IO_H=           Modules/_io/_iomodule.h
201 IO_OBJS=        \
202                 Modules/_io/_iomodule.o \
203                 Modules/_io/iobase.o \
204                 Modules/_io/fileio.o \
205                 Modules/_io/bufferedio.o \
206                 Modules/_io/textio.o \
207                 Modules/_io/bytesio.o \
208                 Modules/_io/stringio.o
210 ##########################################################################
211 # Grammar
212 GRAMMAR_H=      $(srcdir)/Include/graminit.h
213 GRAMMAR_C=      $(srcdir)/Python/graminit.c
214 GRAMMAR_INPUT=  $(srcdir)/Grammar/Grammar
217 ##########################################################################
218 # Parser
219 PGEN=           Parser/pgen$(EXE)
221 POBJS=          \
222                 Parser/acceler.o \
223                 Parser/grammar1.o \
224                 Parser/listnode.o \
225                 Parser/node.o \
226                 Parser/parser.o \
227                 Parser/parsetok.o \
228                 Parser/bitset.o \
229                 Parser/metagrammar.o \
230                 Parser/firstsets.o \
231                 Parser/grammar.o \
232                 Parser/pgen.o
234 PARSER_OBJS=    $(POBJS) Parser/myreadline.o Parser/tokenizer.o
236 PGOBJS=         \
237                 Objects/obmalloc.o \
238                 Python/mysnprintf.o \
239                 Parser/tokenizer_pgen.o \
240                 Parser/printgrammar.o \
241                 Parser/pgenmain.o
243 PARSER_HEADERS= \
244                 Parser/parser.h \
245                 Parser/tokenizer.h
247 PGENOBJS=       $(PGENMAIN) $(POBJS) $(PGOBJS)
249 ##########################################################################
250 # AST
251 AST_H_DIR=      $(srcdir)/Include
252 AST_H=          $(AST_H_DIR)/Python-ast.h
253 AST_C_DIR=      $(srcdir)/Python
254 AST_C=          $(AST_C_DIR)/Python-ast.c
255 AST_ASDL=       $(srcdir)/Parser/Python.asdl
257 ASDLGEN_FILES=  $(srcdir)/Parser/asdl.py $(srcdir)/Parser/asdl_c.py
258 # XXX Note that a build now requires Python exist before the build starts
259 ASDLGEN=        $(srcdir)/Parser/asdl_c.py
261 ##########################################################################
262 # Python
264 OPCODETARGETS_H= \
265                 $(srcdir)/Python/opcode_targets.h
267 OPCODETARGETGEN= \
268                 $(srcdir)/Python/makeopcodetargets.py
270 OPCODETARGETGEN_FILES= \
271                 $(OPCODETARGETGEN) $(srcdir)/Lib/opcode.py
273 PYTHON_OBJS=    \
274                 Python/_warnings.o \
275                 Python/Python-ast.o \
276                 Python/asdl.o \
277                 Python/ast.o \
278                 Python/bltinmodule.o \
279                 Python/ceval.o \
280                 Python/compile.o \
281                 Python/codecs.o \
282                 Python/errors.o \
283                 Python/frozen.o \
284                 Python/frozenmain.o \
285                 Python/future.o \
286                 Python/getargs.o \
287                 Python/getcompiler.o \
288                 Python/getcopyright.o \
289                 Python/getplatform.o \
290                 Python/getversion.o \
291                 Python/graminit.o \
292                 Python/import.o \
293                 Python/importdl.o \
294                 Python/marshal.o \
295                 Python/modsupport.o \
296                 Python/mystrtoul.o \
297                 Python/mysnprintf.o \
298                 Python/peephole.o \
299                 Python/pyarena.o \
300                 Python/pyctype.o \
301                 Python/pyfpe.o \
302                 Python/pymath.o \
303                 Python/pystate.o \
304                 Python/pythonrun.o \
305                 Python/structmember.o \
306                 Python/symtable.o \
307                 Python/sysmodule.o \
308                 Python/traceback.o \
309                 Python/getopt.o \
310                 Python/pystrcmp.o \
311                 Python/pystrtod.o \
312                 Python/dtoa.o \
313                 Python/formatter_unicode.o \
314                 Python/$(DYNLOADFILE) \
315                 $(LIBOBJS) \
316                 $(MACHDEP_OBJS) \
317                 $(THREADOBJ)
320 ##########################################################################
321 # Objects
322 OBJECT_OBJS=    \
323                 Objects/abstract.o \
324                 Objects/boolobject.o \
325                 Objects/bytes_methods.o \
326                 Objects/bytearrayobject.o \
327                 Objects/bytesobject.o \
328                 Objects/cellobject.o \
329                 Objects/classobject.o \
330                 Objects/cobject.o \
331                 Objects/codeobject.o \
332                 Objects/complexobject.o \
333                 Objects/descrobject.o \
334                 Objects/enumobject.o \
335                 Objects/exceptions.o \
336                 Objects/genobject.o \
337                 Objects/fileobject.o \
338                 Objects/floatobject.o \
339                 Objects/frameobject.o \
340                 Objects/funcobject.o \
341                 Objects/iterobject.o \
342                 Objects/listobject.o \
343                 Objects/longobject.o \
344                 Objects/dictobject.o \
345                 Objects/memoryobject.o \
346                 Objects/methodobject.o \
347                 Objects/moduleobject.o \
348                 Objects/object.o \
349                 Objects/obmalloc.o \
350                 Objects/capsule.o \
351                 Objects/rangeobject.o \
352                 Objects/setobject.o \
353                 Objects/sliceobject.o \
354                 Objects/structseq.o \
355                 Objects/tupleobject.o \
356                 Objects/typeobject.o \
357                 Objects/unicodeobject.o \
358                 Objects/unicodectype.o \
359                 Objects/weakrefobject.o
362 ##########################################################################
363 # objects that get linked into the Python library
364 LIBRARY_OBJS=   \
365                 Modules/getbuildinfo.o \
366                 $(PARSER_OBJS) \
367                 $(OBJECT_OBJS) \
368                 $(PYTHON_OBJS) \
369                 $(MODULE_OBJS) \
370                 $(SIGNAL_OBJS) \
371                 $(MODOBJS)
373 #########################################################################
374 # Rules
376 # Default target
377 all:            build_all
378 build_all:      $(BUILDPYTHON) oldsharedmods sharedmods
380 # Compile a binary with gcc profile guided optimization.
381 profile-opt:
382         @echo "Building with support for profile generation:"
383         $(MAKE) clean
384         $(MAKE) build_all_generate_profile
385         @echo "Running benchmark to generate profile data:"
386         $(MAKE) profile-removal
387         $(MAKE) run_profile_task
388         @echo "Rebuilding with profile guided optimizations:"
389         $(MAKE) clean
390         $(MAKE) build_all_use_profile
392 build_all_generate_profile:
393         $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
395 run_profile_task:
396         ./$(BUILDPYTHON) $(PROFILE_TASK)
398 build_all_use_profile:
399         $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use"
401 coverage:
402         @echo "Building with support for coverage checking:"
403         $(MAKE) clean
404         $(MAKE) all CFLAGS="$(CFLAGS) -O0 -pg -fprofile-arcs -ftest-coverage" LIBS="$(LIBS) -lgcov"
407 # Build the interpreter
408 $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
409                 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
410                         Modules/python.o \
411                         $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
413 platform: $(BUILDPYTHON)
414         $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform
417 # Build the shared modules
418 sharedmods: $(BUILDPYTHON)
419         @case $$MAKEFLAGS in \
420         *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
421         *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
422         esac
424 # Build static library
425 # avoid long command lines, same as LIBRARY_OBJS
426 $(LIBRARY): $(LIBRARY_OBJS)
427         -rm -f $@
428         $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o
429         $(AR) $(ARFLAGS) $@ $(PARSER_OBJS)
430         $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS)
431         $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS)
432         $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
433         $(AR) $(ARFLAGS) $@ $(MODOBJS)
434         $(RANLIB) $@
436 libpython$(VERSION).so: $(LIBRARY_OBJS)
437         if test $(INSTSONAME) != $(LDLIBRARY); then \
438                 $(BLDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
439                 $(LN) -f $(INSTSONAME) $@; \
440         else \
441                 $(BLDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
442         fi
444 libpython$(VERSION).dylib: $(LIBRARY_OBJS)
445          $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
446                  
448 libpython$(VERSION).sl: $(LIBRARY_OBJS)
449         $(LDSHARED) $(LDFLAGS) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST)
451 # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
452 # minimal framework (not including the Lib directory and such) in the current
453 # directory.
454 RESSRCDIR=Mac/Resources/framework
455 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
456                 $(LIBRARY) \
457                 $(RESSRCDIR)/Info.plist
458         $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
459         if test "${UNIVERSALSDK}"; then \
460                 $(CC) -o $(LDLIBRARY) @UNIVERSAL_ARCH_FLAGS@ -dynamiclib \
461                         -isysroot "${UNIVERSALSDK}" \
462                         -all_load $(LIBRARY) -Wl,-single_module \
463                         -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \
464                         -compatibility_version $(VERSION) \
465                         -current_version $(VERSION) \
466                         -framework CoreFoundation $(LIBS); \
467         else \
468                 /usr/bin/libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \
469                         @LIBTOOL_CRUFT@ -framework CoreFoundation $(LIBS);\
470         fi
471         $(INSTALL) -d -m $(DIRMODE)  \
472                 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
473         $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
474                 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
475         $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
476         $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
477         $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
478         $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
480 # This rule builds the Cygwin Python DLL and import library if configured
481 # for a shared core library; otherwise, this rule is a noop.
482 $(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
483         if test -n "$(DLLLIBRARY)"; then \
484                 $(LDSHARED) $(LDFLAGS) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
485                         $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST); \
486         else true; \
487         fi
490 oldsharedmods: $(SHAREDMODS)
493 Makefile Modules/config.c: Makefile.pre \
494                                 $(srcdir)/Modules/config.c.in \
495                                 $(MAKESETUP) \
496                                 Modules/Setup.config \
497                                 Modules/Setup \
498                                 Modules/Setup.local
499         $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
500                                 -s Modules \
501                                 Modules/Setup.config \
502                                 Modules/Setup.local \
503                                 Modules/Setup
504         @mv config.c Modules
505         @echo "The Makefile was updated, you may need to re-run make."
508 Modules/Setup: $(srcdir)/Modules/Setup.dist
509         @if test -f Modules/Setup; then \
510                 echo "-----------------------------------------------"; \
511                 echo "Modules/Setup.dist is newer than Modules/Setup;"; \
512                 echo "check to make sure you have all the updates you"; \
513                 echo "need in your Modules/Setup file."; \
514                 echo "Usually, copying Modules/Setup.dist to Modules/Setup will work."; \
515                 echo "-----------------------------------------------"; \
516         fi
518 ############################################################################
519 # Special rules for object files
521 Modules/getbuildinfo.o: $(PARSER_OBJS) \
522                 $(OBJECT_OBJS) \
523                 $(PYTHON_OBJS) \
524                 $(MODULE_OBJS) \
525                 $(SIGNAL_OBJS) \
526                 $(MODOBJS) \
527                 $(srcdir)/Modules/getbuildinfo.c
528         $(CC) -c $(PY_CFLAGS) -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" -o $@ $(srcdir)/Modules/getbuildinfo.c
530 Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
531         $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
532                 -DPREFIX='"$(prefix)"' \
533                 -DEXEC_PREFIX='"$(exec_prefix)"' \
534                 -DVERSION='"$(VERSION)"' \
535                 -DVPATH='"$(VPATH)"' \
536                 -o $@ $(srcdir)/Modules/getpath.c
538 Modules/python.o: $(srcdir)/Modules/python.c
539         $(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
541 $(IO_OBJS): $(IO_H)
543 $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
544                 -@$(INSTALL) -d Include
545                 -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
547 $(PGEN):        $(PGENOBJS)
548                 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
550 Parser/grammar.o:       $(srcdir)/Parser/grammar.c \
551                                 $(srcdir)/Include/token.h \
552                                 $(srcdir)/Include/grammar.h
553 Parser/metagrammar.o:   $(srcdir)/Parser/metagrammar.c
555 Parser/tokenizer_pgen.o:        $(srcdir)/Parser/tokenizer.c
557 Parser/pgenmain.o:      $(srcdir)/Include/parsetok.h
559 $(AST_H): $(AST_ASDL) $(ASDLGEN_FILES)
560         $(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL)
562 $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
563         $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL)
565 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
567 Python/getplatform.o: $(srcdir)/Python/getplatform.c
568                 $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
570 Python/importdl.o: $(srcdir)/Python/importdl.c
571                 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
573 Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
574                                 $(srcdir)/Objects/unicodetype_db.h
576 BYTESTR_DEPS = \
577                 $(srcdir)/Include/bytes_methods.h \
578                 $(srcdir)/Objects/stringlib/count.h \
579                 $(srcdir)/Objects/stringlib/ctype.h \
580                 $(srcdir)/Objects/stringlib/eq.h \
581                 $(srcdir)/Objects/stringlib/fastsearch.h \
582                 $(srcdir)/Objects/stringlib/find.h \
583                 $(srcdir)/Objects/stringlib/partition.h \
584                 $(srcdir)/Objects/stringlib/stringdefs.h \
585                 $(srcdir)/Objects/stringlib/string_format.h \
586                 $(srcdir)/Objects/stringlib/transmogrify.h \
587                 $(srcdir)/Objects/stringlib/unicodedefs.h \
588                 $(srcdir)/Objects/stringlib/localeutil.h
590 Objects/bytesobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS)
592 Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS) 
594 Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \
595                                 $(BYTESTR_DEPS)
597 $(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES)
598         $(OPCODETARGETGEN) $(OPCODETARGETS_H)
600 Python/ceval.o: $(OPCODETARGETS_H)
602 Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \
603                                 $(BYTESTR_DEPS) \
604                                 $(srcdir)/Objects/stringlib/formatter.h
607 ############################################################################
608 # Header files
610 PYTHON_HEADERS= \
611                 Include/Python-ast.h \
612                 Include/Python.h \
613                 Include/abstract.h \
614                 Include/asdl.h \
615                 Include/ast.h \
616                 Include/bltinmodule.h \
617                 Include/bitset.h \
618                 Include/boolobject.h \
619                 Include/bytes_methods.h \
620                 Include/bytearrayobject.h \
621                 Include/bytesobject.h \
622                 Include/cellobject.h \
623                 Include/ceval.h \
624                 Include/classobject.h \
625                 Include/cobject.h \
626                 Include/code.h \
627                 Include/codecs.h \
628                 Include/compile.h \
629                 Include/complexobject.h \
630                 Include/descrobject.h \
631                 Include/dictobject.h \
632                 Include/dtoa.h \
633                 Include/enumobject.h \
634                 Include/errcode.h \
635                 Include/eval.h \
636                 Include/fileobject.h \
637                 Include/floatobject.h \
638                 Include/frameobject.h \
639                 Include/funcobject.h \
640                 Include/genobject.h \
641                 Include/import.h \
642                 Include/intrcheck.h \
643                 Include/iterobject.h \
644                 Include/listobject.h \
645                 Include/longintrepr.h \
646                 Include/longobject.h \
647                 Include/marshal.h \
648                 Include/memoryobject.h \
649                 Include/metagrammar.h \
650                 Include/methodobject.h \
651                 Include/modsupport.h \
652                 Include/moduleobject.h \
653                 Include/node.h \
654                 Include/object.h \
655                 Include/objimpl.h \
656                 Include/opcode.h \
657                 Include/osdefs.h \
658                 Include/parsetok.h \
659                 Include/patchlevel.h \
660                 Include/pgen.h \
661                 Include/pgenheaders.h \
662                 Include/pyarena.h \
663                 Include/pycapsule.h \
664                 Include/pyctype.h \
665                 Include/pydebug.h \
666                 Include/pyerrors.h \
667                 Include/pyfpe.h \
668                 Include/pymath.h \
669                 Include/pygetopt.h \
670                 Include/pymem.h \
671                 Include/pyport.h \
672                 Include/pystate.h \
673                 Include/pystrcmp.h \
674                 Include/pystrtod.h \
675                 Include/pythonrun.h \
676                 Include/pythread.h \
677                 Include/rangeobject.h \
678                 Include/setobject.h \
679                 Include/sliceobject.h \
680                 Include/structmember.h \
681                 Include/structseq.h \
682                 Include/symtable.h \
683                 Include/sysmodule.h \
684                 Include/traceback.h \
685                 Include/tupleobject.h \
686                 Include/ucnhash.h \
687                 Include/unicodeobject.h \
688                 Include/warnings.h \
689                 Include/weakrefobject.h \
690                 pyconfig.h \
691                 $(PARSER_HEADERS)
693 $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
696 ######################################################################
698 # Test the interpreter (twice, once without .pyc files, once with)
699 # In the past, we've had problems where bugs in the marshalling or
700 # elsewhere caused bytecode read from .pyc files to behave differently
701 # than bytecode generated directly from a .py source file.  Sometimes
702 # the bytecode read from a .pyc file had the bug, somtimes the directly
703 # generated bytecode.  This is sometimes a very shy bug needing a lot of
704 # sample data.
706 TESTOPTS=       -l $(EXTRATESTOPTS)
707 TESTPROG=       $(srcdir)/Lib/test/regrtest.py
708 TESTPYTHON=     $(RUNSHARED) ./$(BUILDPYTHON) -E -bb $(TESTPYTHONOPTS)
709 test:           all platform
710                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
711                 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
712                 $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
714 testall:        all platform
715                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
716                 $(TESTPYTHON) $(srcdir)/Lib/compileall.py
717                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
718                 -$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
719                 $(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
721 #  Run the unitests for both architectures in a Universal build on OSX
722 #  Must be run on an Intel box.
723 testuniversal:  all platform
724                 if [ `arch` != 'i386' ];then \
725                         echo "This can only be used on OSX/i386" ;\
726                         exit 1 ;\
727                 fi
728                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
729                 -$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
730                 $(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
731                 $(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E $(TESTPROG) -uall $(TESTOPTS)
734 # Like testall, but with a single pass only
735 # run an optional script to include some information about the build environment
736 buildbottest:   all platform
737                 -@if which pybuildbot.identify >/dev/null 2>&1; then \
738                         pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
739                 fi
740                 $(TESTPYTHON) $(TESTPROG) -uall -rw $(TESTOPTS)
742 QUICKTESTOPTS=  $(TESTOPTS) -x test_subprocess test_io test_lib2to3 \
743                 test_multibytecodec test_urllib2_localnet test_itertools \
744                 test_multiprocessing test_mailbox test_socket test_poll \
745                 test_select test_zipfile
746 quicktest:      all platform
747                 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
748                 -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
749                 $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
751 MEMTESTOPTS=    $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
752                 test_longexp
753 memtest:        all platform
754                 -rm -f $(srcdir)/Lib/test/*.py[co]
755                 -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
756                 $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
758 install: altinstall bininstall
760 altinstall:     @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \
761                 sharedinstall oldsharedinstall maninstall @FRAMEWORKALTINSTALLLAST@
763 # Install shared libraries enabled by Setup
764 DESTDIRS=       $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
766 oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
767                 @for i in X $(SHAREDMODS); do \
768                   if test $$i != X; then \
769                     echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
770                     $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
771                   fi; \
772                 done
774 $(DESTSHARED):
775                 @for i in $(DESTDIRS); \
776                 do \
777                         if test ! -d $(DESTDIR)$$i; then \
778                                 echo "Creating directory $$i"; \
779                                 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
780                         else    true; \
781                         fi; \
782                 done
784 # Install the interpreter with $(VERSION) affixed
785 # This goes into $(exec_prefix)
786 altbininstall: $(BUILDPYTHON)
787         @for i in $(BINDIR) $(LIBDIR); \
788         do \
789                 if test ! -d $(DESTDIR)$$i; then \
790                         echo "Creating directory $$i"; \
791                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
792                 else    true; \
793                 fi; \
794         done
795         $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
796         if test -f $(LDLIBRARY); then \
797                 if test -n "$(DLLLIBRARY)" ; then \
798                         $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
799                 else \
800                         $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
801                         if test $(LDLIBRARY) != $(INSTSONAME); then \
802                                 (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \
803                         fi \
804                 fi; \
805         else    true; \
806         fi
808 bininstall: altbininstall
809         -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON)3$(EXE) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON)3$(EXE); \
810         then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON)3$(EXE); \
811         else true; \
812         fi
813         (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON)3$(EXE))
814         -rm -f $(DESTDIR)$(BINDIR)/python3-config
815         (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python3-config)
816         -rm -f $(DESTDIR)$(LIBPC)/python3.pc
817         (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc)
819 # Install the manual page
820 maninstall:
821         @for i in $(MANDIR) $(MANDIR)/man1; \
822         do \
823                 if test ! -d $(DESTDIR)$$i; then \
824                         echo "Creating directory $$i"; \
825                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
826                 else    true; \
827                 fi; \
828         done
829         $(INSTALL_DATA) $(srcdir)/Misc/python.man \
830                 $(DESTDIR)$(MANDIR)/man1/python$(VERSION).1
832 # Install the library
833 PLATDIR=        plat-$(MACHDEP)
834 EXTRAPLATDIR= @EXTRAPLATDIR@
835 MACHDEPS=       $(PLATDIR) $(EXTRAPLATDIR)
836 XMLLIBSUBDIRS=  xml xml/dom xml/etree xml/parsers xml/sax
837 LIBSUBDIRS=     tkinter tkinter/test tkinter/test/test_tkinter \
838                 tkinter/test/test_ttk site-packages test test/data \
839                 test/decimaltestdata \
840                 test/tracedmodules \
841                 encodings \
842                 email email/mime email/test email/test/data \
843                 html json json/tests http dbm xmlrpc \
844                 sqlite3 sqlite3/test \
845                 logging csv wsgiref urllib \
846                 lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
847                 lib2to3/tests/data lib2to3/tests/data/fixers lib2to3/tests/data/fixers/myfixes \
848                 ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \
849                 distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
850                 importlib importlib/test importlib/test/builtin \
851                 importlib/test/extension importlib/test/frozen \
852                 importlib/test/import_ importlib/test/source \
853                 setuptools setuptools/command setuptools/tests setuptools.egg-info \
854                 multiprocessing multiprocessing/dummy \
855                 curses pydoc_data $(MACHDEPS)
856 libinstall:     build_all $(srcdir)/Lib/$(PLATDIR)
857         @for i in $(SCRIPTDIR) $(LIBDEST); \
858         do \
859                 if test ! -d $(DESTDIR)$$i; then \
860                         echo "Creating directory $$i"; \
861                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
862                 else    true; \
863                 fi; \
864         done
865         @for d in $(LIBSUBDIRS); \
866         do \
867                 a=$(srcdir)/Lib/$$d; \
868                 if test ! -d $$a; then continue; else true; fi; \
869                 b=$(LIBDEST)/$$d; \
870                 if test ! -d $(DESTDIR)$$b; then \
871                         echo "Creating directory $$b"; \
872                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
873                 else    true; \
874                 fi; \
875         done
876         @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \
877         do \
878                 if test -x $$i; then \
879                         $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
880                         echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
881                 else \
882                         $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
883                         echo $(INSTALL_DATA) $$i $(LIBDEST); \
884                 fi; \
885         done
886         @for d in $(LIBSUBDIRS); \
887         do \
888                 a=$(srcdir)/Lib/$$d; \
889                 if test ! -d $$a; then continue; else true; fi; \
890                 if test `ls $$a | wc -l` -lt 1; then continue; fi; \
891                 b=$(LIBDEST)/$$d; \
892                 for i in $$a/*; \
893                 do \
894                         case $$i in \
895                         *CVS) ;; \
896                         *.py[co]) ;; \
897                         *.orig) ;; \
898                         *~) ;; \
899                         *) \
900                                 if test -d $$i; then continue; fi; \
901                                 if test -x $$i; then \
902                                     echo $(INSTALL_SCRIPT) $$i $$b; \
903                                     $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
904                                 else \
905                                     echo $(INSTALL_DATA) $$i $$b; \
906                                     $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
907                                 fi;; \
908                         esac; \
909                 done; \
910         done
911         $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
912         -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
913                 ./$(BUILDPYTHON) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
914                 -d $(LIBDEST) -f \
915                 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
916                 $(DESTDIR)$(LIBDEST)
917         -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
918                 ./$(BUILDPYTHON) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
919                 -d $(LIBDEST) -f \
920                 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
921                 $(DESTDIR)$(LIBDEST)
922         -PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
923                 ./$(BUILDPYTHON) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
924                 -d $(LIBDEST)/site-packages -f \
925                 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
926         -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
927                 ./$(BUILDPYTHON) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
928                 -d $(LIBDEST)/site-packages -f \
929                 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
930         -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
931                 ./$(BUILDPYTHON) -Wi -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
933 # Create the PLATDIR source directory, if one wasn't distributed..
934 $(srcdir)/Lib/$(PLATDIR):
935         mkdir $(srcdir)/Lib/$(PLATDIR)
936         cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
937         export PATH; PATH="`pwd`:$$PATH"; \
938         export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
939         export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
940         export EXE; EXE="$(BUILDEXE)"; \
941         cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
943 # Install the include files
944 INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
945 inclinstall:
946         @for i in $(INCLDIRSTOMAKE); \
947         do \
948                 if test ! -d $(DESTDIR)$$i; then \
949                         echo "Creating directory $$i"; \
950                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
951                 else    true; \
952                 fi; \
953         done
954         @for i in $(srcdir)/Include/*.h; \
955         do \
956                 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
957                 $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
958         done
959         $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
961 # Install the library and miscellaneous stuff needed for extending/embedding
962 # This goes into $(exec_prefix)
963 LIBPL=          $(LIBP)/config
965 # pkgconfig directory
966 LIBPC=          $(LIBDIR)/pkgconfig
968 libainstall:    all
969         @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
970         do \
971                 if test ! -d $(DESTDIR)$$i; then \
972                         echo "Creating directory $$i"; \
973                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
974                 else    true; \
975                 fi; \
976         done
977         @if test -d $(LIBRARY); then :; else \
978                 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
979                         if test "$(SO)" = .dll; then \
980                                 $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
981                         else \
982                                 $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
983                                 $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
984                         fi; \
985                 else \
986                         echo Skip install of $(LIBRARY) - use make frameworkinstall; \
987                 fi; \
988         fi
989         $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
990         $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
991         $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
992         $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
993         $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
994         $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
995         $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
996         $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
997         $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
998         $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
999         # Substitution happens here, as the completely-expanded BINDIR
1000         # is not available in configure
1001         sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
1002         $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
1003         rm python-config
1004         @if [ -s Modules/python.exp -a \
1005                 "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
1006                 echo; echo "Installing support files for building shared extension modules on AIX:"; \
1007                 $(INSTALL_DATA) Modules/python.exp              \
1008                                 $(DESTDIR)$(LIBPL)/python.exp;          \
1009                 echo; echo "$(LIBPL)/python.exp";               \
1010                 $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix  \
1011                                 $(DESTDIR)$(LIBPL)/makexp_aix;          \
1012                 echo "$(LIBPL)/makexp_aix";                     \
1013                 $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix   \
1014                                 $(DESTDIR)$(LIBPL)/ld_so_aix;           \
1015                 echo "$(LIBPL)/ld_so_aix";                      \
1016                 echo; echo "See Misc/AIX-NOTES for details.";   \
1017         else true; \
1018         fi
1020 # Install the dynamically loadable modules
1021 # This goes into $(exec_prefix)
1022 sharedinstall: sharedmods
1023         $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
1024                 --prefix=$(prefix) \
1025                 --install-scripts=$(BINDIR) \
1026                 --install-platlib=$(DESTSHARED) \
1027                 --root=/$(DESTDIR)
1029 # Here are a couple of targets for MacOSX again, to install a full
1030 # framework-based Python. frameworkinstall installs everything, the
1031 # subtargets install specific parts. Much of the actual work is offloaded to
1032 # the Makefile in Mac
1035 # This target is here for backward compatiblity, previous versions of Python
1036 # hadn't integrated framework installation in the normal install process.
1037 frameworkinstall: install
1039 # On install, we re-make the framework
1040 # structure in the install location, /Library/Frameworks/ or the argument to
1041 # --enable-framework. If --enable-framework has been specified then we have
1042 # automatically set prefix to the location deep down in the framework, so we
1043 # only have to cater for the structural bits of the framework.
1045 frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
1047 frameworkinstallstructure:      $(LDLIBRARY)
1048         @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
1049                 echo Not configured with --enable-framework; \
1050                 exit 1; \
1051         else true; \
1052         fi
1053         @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
1054                 if test ! -d $(DESTDIR)$$i; then \
1055                         echo "Creating directory $(DESTDIR)$$i"; \
1056                         $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
1057                 else    true; \
1058                 fi; \
1059         done
1060         $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
1061         sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
1062         $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
1063         $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
1064         $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
1065         $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
1066         $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
1068 # This installs Mac/Lib into the framework
1069 # Install a number of symlinks to keep software that expects a normal unix
1070 # install (which includes python-config) happy.
1071 frameworkinstallmaclib:
1072         ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a"
1073         ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).dylib"
1074         ln -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(VERSION).dylib"
1076 # This installs the IDE, the Launcher and other apps into /Applications
1077 frameworkinstallapps:
1078         cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
1080 frameworkinstallapps4way:
1081         cd Mac && $(MAKE) installapps4way DESTDIR="$(DESTDIR)"
1083 # This install the unix python and pythonw tools in /usr/local/bin
1084 frameworkinstallunixtools:
1085         cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
1087 frameworkinstallunixtools4way:
1088         cd Mac && $(MAKE) installunixtools4way DESTDIR="$(DESTDIR)"
1090 frameworkaltinstallunixtools:
1091         cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"
1093 frameworkaltinstallunixtools4way:
1094         cd Mac && $(MAKE) altinstallunixtools4way DESTDIR="$(DESTDIR)"
1096 # This installs the Demos and Tools into the applications directory.
1097 # It is not part of a normal frameworkinstall
1098 frameworkinstallextras:
1099         cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)"
1101 # This installs a few of the useful scripts in Tools/scripts
1102 scriptsinstall:
1103         SRCDIR=$(srcdir) $(RUNSHARED) \
1104         ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
1105         --prefix=$(prefix) \
1106         --install-scripts=$(BINDIR) \
1107         --root=/$(DESTDIR)
1109 # Build the toplevel Makefile
1110 Makefile.pre: Makefile.pre.in config.status
1111         CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
1112         $(MAKE) -f Makefile.pre Makefile
1114 # Run the configure script.
1115 config.status:  $(srcdir)/configure
1116         $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
1118 .PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
1120 # Some make's put the object file in the current directory
1121 .c.o:
1122         $(CC) -c $(PY_CFLAGS) -o $@ $<
1124 # Run reindent on the library
1125 reindent:
1126         ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
1128 # Rerun configure with the same options as it was run last time,
1129 # provided the config.status script exists
1130 recheck:
1131         $(SHELL) config.status --recheck
1132         $(SHELL) config.status
1134 # Rebuild the configure script from configure.in; also rebuild pyconfig.h.in
1135 autoconf:
1136         (cd $(srcdir); autoconf)
1137         (cd $(srcdir); autoheader)
1139 # Create a tags file for vi
1140 tags::
1141         cd $(srcdir); \
1142         ctags -w -t Include/*.h; \
1143         for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \
1144         done; \
1145         sort -o tags tags
1147 # Create a tags file for GNU Emacs
1148 TAGS::
1149         cd $(srcdir); \
1150         etags Include/*.h; \
1151         for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
1153 # Sanitation targets -- clean leaves libraries, executables and tags
1154 # files, which clobber removes as well
1155 pycremoval:
1156         find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
1158 rmtestturds:
1159         -rm -f *BAD *GOOD *SKIPPED
1160         -rm -rf OUT
1161         -rm -f *.TXT
1162         -rm -f *.txt
1163         -rm -f gb-18030-2000.xml
1165 docclean:
1166         -rm -rf Doc/build
1167         -rm -rf Doc/tools/sphinx Doc/tools/pygments Doc/tools/docutils
1169 clean: pycremoval
1170         find . -name '*.[oa]' -exec rm -f {} ';'
1171         find . -name '*.s[ol]' -exec rm -f {} ';'
1172         find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
1173         find build -name 'fficonfig.h' -exec rm -f {} ';' || true
1174         find build -name 'fficonfig.py' -exec rm -f {} ';' || true
1175         -rm -f Lib/lib2to3/*Grammar*.pickle
1177 profile-removal:
1178         find . -name '*.gc??' -exec rm -f {} ';'
1180 clobber: clean profile-removal
1181         -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
1182                 tags TAGS \
1183                 config.cache config.log pyconfig.h Modules/config.c
1184         -rm -rf build platform
1185         -rm -rf $(PYTHONFRAMEWORKDIR)
1187 # Make things extra clean, before making a distribution:
1188 # remove all generated files, even Makefile[.pre]
1189 # Keep configure and Python-ast.[ch], it's possible they can't be generated
1190 distclean: clobber
1191         -rm -f core Makefile Makefile.pre config.status \
1192                 Modules/Setup Modules/Setup.local Modules/Setup.config \
1193                 Modules/ld_so_aix Misc/python.pc
1194         find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
1195                            -o -name '[@,#]*' -o -name '*.old' \
1196                            -o -name '*.orig' -o -name '*.rej' \
1197                            -o -name '*.bak' ')' \
1198                            -exec rm -f {} ';'
1200 # Check for smelly exported symbols (not starting with Py/_Py)
1201 smelly: all
1202         nm -p $(LIBRARY) | \
1203                 sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
1205 # Find files with funny names
1206 funny:
1207         find $(DISTDIRS) \
1208                 -name .svn -prune \
1209                 -o -type d \
1210                 -o -name '*.[chs]' \
1211                 -o -name '*.py' \
1212                 -o -name '*.doc' \
1213                 -o -name '*.dat' \
1214                 -o -name '*.el' \
1215                 -o -name '*.fd' \
1216                 -o -name '*.in' \
1217                 -o -name '*.gif' \
1218                 -o -name '*.txt' \
1219                 -o -name '*.xml' \
1220                 -o -name '*.xbm' \
1221                 -o -name '*.xpm' \
1222                 -o -name '*.uue' \
1223                 -o -name '*.decTest' \
1224                 -o -name '*,[vpt]' \
1225                 -o -name 'Setup' \
1226                 -o -name 'Setup.*' \
1227                 -o -name regen \
1228                 -o -name README \
1229                 -o -name Makefile \
1230                 -o -name ChangeLog \
1231                 -o -name Repository \
1232                 -o -name Root \
1233                 -o -name Entries \
1234                 -o -name Tag \
1235                 -o -name tags \
1236                 -o -name TAGS \
1237                 -o -name .cvsignore \
1238                 -o -name MANIFEST \
1239                 -o -print
1241 # Perform some verification checks on any modified files.
1242 patchcheck:
1243         $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
1245 # Dependencies
1247 Python/thread.o: @THREADHEADERS@
1249 # Declare targets that aren't real files
1250 .PHONY: all build_all sharedmods oldsharedmods test quicktest memtest
1251 .PHONY: install altinstall oldsharedinstall bininstall altbininstall
1252 .PHONY: maninstall libinstall inclinstall libainstall sharedinstall
1253 .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
1254 .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
1255 .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean 
1256 .PHONY: smelly funny patchcheck
1258 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY