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