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