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