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