[2] | 1 | # Top-level Makefile for Python
|
---|
| 2 | #
|
---|
| 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:
|
---|
| 8 | #
|
---|
| 9 | # ./configure
|
---|
| 10 | # make
|
---|
| 11 | # make test
|
---|
| 12 | # make install
|
---|
| 13 | #
|
---|
| 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.
|
---|
| 18 | #
|
---|
| 19 | # See also the section "Build instructions" in the README file.
|
---|
| 20 |
|
---|
| 21 | # === Variables set by makesetup ===
|
---|
| 22 |
|
---|
| 23 | MODOBJS= _MODOBJS_
|
---|
| 24 | MODLIBS= _MODLIBS_
|
---|
| 25 |
|
---|
| 26 | # === Variables set by configure
|
---|
| 27 | VERSION= @VERSION@
|
---|
| 28 | srcdir= @srcdir@
|
---|
| 29 | VPATH= @srcdir@
|
---|
[388] | 30 | abs_srcdir= @abs_srcdir@
|
---|
| 31 | abs_builddir= @abs_builddir@
|
---|
| 32 | build= @build@
|
---|
| 33 | host= @host@
|
---|
[2] | 34 |
|
---|
| 35 | CC= @CC@
|
---|
| 36 | CXX= @CXX@
|
---|
| 37 | MAINCC= @MAINCC@
|
---|
| 38 | LINKCC= @LINKCC@
|
---|
| 39 | AR= @AR@
|
---|
| 40 | RANLIB= @RANLIB@
|
---|
| 41 | SVNVERSION= @SVNVERSION@
|
---|
[388] | 42 | HGVERSION= @HGVERSION@
|
---|
| 43 | HGTAG= @HGTAG@
|
---|
| 44 | HGBRANCH= @HGBRANCH@
|
---|
[2] | 45 |
|
---|
[388] | 46 | GNULD= @GNULD@
|
---|
| 47 |
|
---|
[2] | 48 | # Shell used by make (some versions default to the login shell, which is bad)
|
---|
| 49 | SHELL= /bin/sh
|
---|
| 50 |
|
---|
| 51 | # Use this to make a link between python$(VERSION) and python in $(BINDIR)
|
---|
| 52 | LN= @LN@
|
---|
| 53 |
|
---|
| 54 | # Portable install script (configure doesn't always guess right)
|
---|
| 55 | INSTALL= @INSTALL@
|
---|
| 56 | INSTALL_PROGRAM=@INSTALL_PROGRAM@
|
---|
| 57 | INSTALL_SCRIPT= @INSTALL_SCRIPT@
|
---|
| 58 | INSTALL_DATA= @INSTALL_DATA@
|
---|
| 59 | # Shared libraries must be installed with executable mode on some systems;
|
---|
| 60 | # rather than figuring out exactly which, we always give them executable mode.
|
---|
| 61 | # Also, making them read-only seems to be a good idea...
|
---|
| 62 | INSTALL_SHARED= ${INSTALL} -m 555
|
---|
| 63 |
|
---|
[388] | 64 | MKDIR_P= @MKDIR_P@
|
---|
| 65 |
|
---|
[2] | 66 | MAKESETUP= $(srcdir)/Modules/makesetup
|
---|
| 67 |
|
---|
| 68 | # Compiler options
|
---|
| 69 | OPT= @OPT@
|
---|
| 70 | BASECFLAGS= @BASECFLAGS@
|
---|
[388] | 71 | CFLAGS= $(BASECFLAGS) @CFLAGS@ $(OPT) $(EXTRA_CFLAGS)
|
---|
[2] | 72 | # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
|
---|
| 73 | # be able to build extension modules using the directories specified in the
|
---|
| 74 | # environment variables
|
---|
| 75 | CPPFLAGS= -I. -IInclude -I$(srcdir)/Include @CPPFLAGS@
|
---|
| 76 | LDFLAGS= @LDFLAGS@
|
---|
| 77 | LDLAST= @LDLAST@
|
---|
| 78 | SGI_ABI= @SGI_ABI@
|
---|
| 79 | CCSHARED= @CCSHARED@
|
---|
| 80 | LINKFORSHARED= @LINKFORSHARED@
|
---|
[388] | 81 | ARFLAGS= @ARFLAGS@
|
---|
[2] | 82 | # Extra C flags added for building the interpreter object files.
|
---|
| 83 | CFLAGSFORSHARED=@CFLAGSFORSHARED@
|
---|
| 84 | # C flags used for building the interpreter object files
|
---|
| 85 | PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
|
---|
| 86 |
|
---|
| 87 |
|
---|
| 88 | # Machine-dependent subdirectories
|
---|
| 89 | MACHDEP= @MACHDEP@
|
---|
| 90 |
|
---|
[388] | 91 | # Multiarch directory (may be empty)
|
---|
| 92 | MULTIARCH= @MULTIARCH@
|
---|
| 93 |
|
---|
[2] | 94 | # Install prefix for architecture-independent files
|
---|
| 95 | prefix= @prefix@
|
---|
| 96 |
|
---|
| 97 | # Install prefix for architecture-dependent files
|
---|
| 98 | exec_prefix= @exec_prefix@
|
---|
| 99 |
|
---|
| 100 | # Install prefix for data files
|
---|
| 101 | datarootdir= @datarootdir@
|
---|
| 102 |
|
---|
| 103 | # Expanded directories
|
---|
[388] | 104 | BINDIR= @bindir@
|
---|
| 105 | LIBDIR= @libdir@
|
---|
[2] | 106 | MANDIR= @mandir@
|
---|
| 107 | INCLUDEDIR= @includedir@
|
---|
| 108 | CONFINCLUDEDIR= $(exec_prefix)/include
|
---|
| 109 | SCRIPTDIR= $(prefix)/lib
|
---|
| 110 |
|
---|
| 111 | # Detailed destination directories
|
---|
| 112 | BINLIBDEST= $(LIBDIR)/python$(VERSION)
|
---|
| 113 | LIBDEST= $(SCRIPTDIR)/python$(VERSION)
|
---|
| 114 | INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
|
---|
| 115 | CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
|
---|
| 116 | LIBP= $(LIBDIR)/python$(VERSION)
|
---|
| 117 |
|
---|
| 118 | # Symbols used for using shared libraries
|
---|
| 119 | SO= @SO@
|
---|
[388] | 120 | LDSHARED= @LDSHARED@ $(LDFLAGS)
|
---|
| 121 | BLDSHARED= @BLDSHARED@ $(LDFLAGS)
|
---|
| 122 | LDCXXSHARED= @LDCXXSHARED@
|
---|
[2] | 123 | DESTSHARED= $(BINLIBDEST)/lib-dynload
|
---|
| 124 |
|
---|
| 125 | # Executable suffix (.exe on Windows and Mac OS X)
|
---|
| 126 | EXE= @EXEEXT@
|
---|
| 127 | BUILDEXE= @BUILDEXEEXT@
|
---|
| 128 |
|
---|
| 129 | # Short name and location for Mac OS X Python framework
|
---|
| 130 | UNIVERSALSDK=@UNIVERSALSDK@
|
---|
| 131 | PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
|
---|
| 132 | PYTHONFRAMEWORKDIR= @PYTHONFRAMEWORKDIR@
|
---|
| 133 | PYTHONFRAMEWORKPREFIX= @PYTHONFRAMEWORKPREFIX@
|
---|
| 134 | PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
|
---|
| 135 | # Deployment target selected during configure, to be checked
|
---|
| 136 | # by distutils. The export statement is needed to ensure that the
|
---|
| 137 | # deployment target is active during build.
|
---|
| 138 | MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
|
---|
| 139 | @EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
|
---|
| 140 |
|
---|
| 141 | # Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
|
---|
| 142 | OTHER_LIBTOOL_OPT=@OTHER_LIBTOOL_OPT@
|
---|
| 143 |
|
---|
| 144 | # Environment to run shared python without installed libraries
|
---|
| 145 | RUNSHARED= @RUNSHARED@
|
---|
| 146 |
|
---|
| 147 | # Modes for directories, executables and data files created by the
|
---|
| 148 | # install process. Default to user-only-writable for all file types.
|
---|
| 149 | DIRMODE= 755
|
---|
| 150 | EXEMODE= 755
|
---|
| 151 | FILEMODE= 644
|
---|
| 152 |
|
---|
| 153 | # configure script arguments
|
---|
| 154 | CONFIG_ARGS= @CONFIG_ARGS@
|
---|
| 155 |
|
---|
| 156 |
|
---|
| 157 | # Subdirectories with code
|
---|
| 158 | SRCDIRS= @SRCDIRS@
|
---|
| 159 |
|
---|
| 160 | # Other subdirectories
|
---|
| 161 | SUBDIRSTOO= Include Lib Misc Demo
|
---|
| 162 |
|
---|
| 163 | # Files and directories to be distributed
|
---|
[388] | 164 | CONFIGFILES= configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in
|
---|
[2] | 165 | DISTFILES= README ChangeLog $(CONFIGFILES)
|
---|
| 166 | DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
|
---|
| 167 | DIST= $(DISTFILES) $(DISTDIRS)
|
---|
| 168 |
|
---|
| 169 |
|
---|
| 170 | LIBRARY= @LIBRARY@
|
---|
| 171 | LDLIBRARY= @LDLIBRARY@
|
---|
| 172 | BLDLIBRARY= @BLDLIBRARY@
|
---|
| 173 | DLLLIBRARY= @DLLLIBRARY@
|
---|
| 174 | LDLIBRARYDIR= @LDLIBRARYDIR@
|
---|
| 175 | INSTSONAME= @INSTSONAME@
|
---|
| 176 |
|
---|
| 177 |
|
---|
| 178 | LIBS= @LIBS@
|
---|
| 179 | LIBM= @LIBM@
|
---|
| 180 | LIBC= @LIBC@
|
---|
| 181 | SYSLIBS= $(LIBM) $(LIBC)
|
---|
| 182 | SHLIBS= @SHLIBS@
|
---|
| 183 |
|
---|
| 184 | THREADOBJ= @THREADOBJ@
|
---|
| 185 | DLINCLDIR= @DLINCLDIR@
|
---|
| 186 | DYNLOADFILE= @DYNLOADFILE@
|
---|
| 187 | MACHDEP_OBJS= @MACHDEP_OBJS@
|
---|
| 188 | LIBOBJDIR= Python/
|
---|
| 189 | LIBOBJS= @LIBOBJS@
|
---|
| 190 | UNICODE_OBJS= @UNICODE_OBJS@
|
---|
| 191 |
|
---|
| 192 | PYTHON= python$(EXE)
|
---|
| 193 | BUILDPYTHON= python$(BUILDEXE)
|
---|
| 194 |
|
---|
[388] | 195 | PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
|
---|
| 196 | _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
|
---|
| 197 | HOST_GNU_TYPE= @host@
|
---|
| 198 |
|
---|
| 199 | # Tcl and Tk config info from --with-tcltk-includes and -libs options
|
---|
| 200 | TCLTK_INCLUDES= @TCLTK_INCLUDES@
|
---|
| 201 | TCLTK_LIBS= @TCLTK_LIBS@
|
---|
| 202 |
|
---|
[2] | 203 | # The task to run while instrument when building the profile-opt target
|
---|
| 204 | PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
|
---|
| 205 | #PROFILE_TASK= $(srcdir)/Lib/test/regrtest.py
|
---|
| 206 |
|
---|
| 207 | # === Definitions added by makesetup ===
|
---|
| 208 |
|
---|
| 209 |
|
---|
| 210 | ##########################################################################
|
---|
| 211 | # Modules
|
---|
| 212 | MODULE_OBJS= \
|
---|
| 213 | Modules/config.o \
|
---|
| 214 | Modules/getpath.o \
|
---|
| 215 | Modules/main.o \
|
---|
| 216 | Modules/gcmodule.o
|
---|
| 217 |
|
---|
| 218 | # Used of signalmodule.o is not available
|
---|
| 219 | SIGNAL_OBJS= @SIGNAL_OBJS@
|
---|
| 220 |
|
---|
| 221 |
|
---|
| 222 | ##########################################################################
|
---|
| 223 | # Grammar
|
---|
[388] | 224 | GRAMMAR_H= Include/graminit.h
|
---|
| 225 | GRAMMAR_C= Python/graminit.c
|
---|
[2] | 226 | GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
|
---|
| 227 |
|
---|
| 228 |
|
---|
[388] | 229 | LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
|
---|
| 230 |
|
---|
[2] | 231 | ##########################################################################
|
---|
| 232 | # Parser
|
---|
| 233 | PGEN= Parser/pgen$(EXE)
|
---|
| 234 |
|
---|
[388] | 235 | PSRCS= \
|
---|
| 236 | Parser/acceler.c \
|
---|
| 237 | Parser/grammar1.c \
|
---|
| 238 | Parser/listnode.c \
|
---|
| 239 | Parser/node.c \
|
---|
| 240 | Parser/parser.c \
|
---|
| 241 | Parser/parsetok.c \
|
---|
| 242 | Parser/bitset.c \
|
---|
| 243 | Parser/metagrammar.c \
|
---|
| 244 | Parser/firstsets.c \
|
---|
| 245 | Parser/grammar.c \
|
---|
| 246 | Parser/pgen.c
|
---|
| 247 |
|
---|
[2] | 248 | POBJS= \
|
---|
| 249 | Parser/acceler.o \
|
---|
| 250 | Parser/grammar1.o \
|
---|
| 251 | Parser/listnode.o \
|
---|
| 252 | Parser/node.o \
|
---|
| 253 | Parser/parser.o \
|
---|
| 254 | Parser/parsetok.o \
|
---|
| 255 | Parser/bitset.o \
|
---|
| 256 | Parser/metagrammar.o \
|
---|
| 257 | Parser/firstsets.o \
|
---|
| 258 | Parser/grammar.o \
|
---|
| 259 | Parser/pgen.o
|
---|
| 260 |
|
---|
| 261 | PARSER_OBJS= $(POBJS) Parser/myreadline.o Parser/tokenizer.o
|
---|
| 262 |
|
---|
[388] | 263 | PGSRCS= \
|
---|
| 264 | Objects/obmalloc.c \
|
---|
| 265 | Python/mysnprintf.c \
|
---|
| 266 | Python/pyctype.c \
|
---|
| 267 | Parser/tokenizer_pgen.c \
|
---|
| 268 | Parser/printgrammar.c \
|
---|
| 269 | Parser/pgenmain.c
|
---|
| 270 |
|
---|
[2] | 271 | PGOBJS= \
|
---|
| 272 | Objects/obmalloc.o \
|
---|
| 273 | Python/mysnprintf.o \
|
---|
[388] | 274 | Python/pyctype.o \
|
---|
[2] | 275 | Parser/tokenizer_pgen.o \
|
---|
| 276 | Parser/printgrammar.o \
|
---|
| 277 | Parser/pgenmain.o
|
---|
| 278 |
|
---|
| 279 | PARSER_HEADERS= \
|
---|
| 280 | Parser/parser.h \
|
---|
| 281 | Parser/tokenizer.h
|
---|
| 282 |
|
---|
[388] | 283 | PGENSRCS= $(PSRCS) $(PGSRCS)
|
---|
| 284 | PGENOBJS= $(POBJS) $(PGOBJS)
|
---|
[2] | 285 |
|
---|
| 286 | ##########################################################################
|
---|
| 287 | # AST
|
---|
[388] | 288 | AST_H_DIR= Include
|
---|
[2] | 289 | AST_H= $(AST_H_DIR)/Python-ast.h
|
---|
[388] | 290 | AST_C_DIR= Python
|
---|
[2] | 291 | AST_C= $(AST_C_DIR)/Python-ast.c
|
---|
| 292 | AST_ASDL= $(srcdir)/Parser/Python.asdl
|
---|
| 293 |
|
---|
| 294 | ASDLGEN_FILES= $(srcdir)/Parser/asdl.py $(srcdir)/Parser/asdl_c.py
|
---|
| 295 | # XXX Note that a build now requires Python exist before the build starts
|
---|
| 296 | ASDLGEN= $(srcdir)/Parser/asdl_c.py
|
---|
| 297 |
|
---|
| 298 | ##########################################################################
|
---|
| 299 | # Python
|
---|
| 300 | PYTHON_OBJS= \
|
---|
| 301 | Python/_warnings.o \
|
---|
| 302 | Python/Python-ast.o \
|
---|
| 303 | Python/asdl.o \
|
---|
| 304 | Python/ast.o \
|
---|
| 305 | Python/bltinmodule.o \
|
---|
| 306 | Python/ceval.o \
|
---|
| 307 | Python/compile.o \
|
---|
| 308 | Python/codecs.o \
|
---|
| 309 | Python/errors.o \
|
---|
| 310 | Python/frozen.o \
|
---|
| 311 | Python/frozenmain.o \
|
---|
| 312 | Python/future.o \
|
---|
| 313 | Python/getargs.o \
|
---|
| 314 | Python/getcompiler.o \
|
---|
| 315 | Python/getcopyright.o \
|
---|
| 316 | Python/getplatform.o \
|
---|
| 317 | Python/getversion.o \
|
---|
| 318 | Python/graminit.o \
|
---|
| 319 | Python/import.o \
|
---|
| 320 | Python/importdl.o \
|
---|
| 321 | Python/marshal.o \
|
---|
| 322 | Python/modsupport.o \
|
---|
| 323 | Python/mystrtoul.o \
|
---|
| 324 | Python/mysnprintf.o \
|
---|
| 325 | Python/peephole.o \
|
---|
| 326 | Python/pyarena.o \
|
---|
[388] | 327 | Python/pyctype.o \
|
---|
[2] | 328 | Python/pyfpe.o \
|
---|
| 329 | Python/pymath.o \
|
---|
| 330 | Python/pystate.o \
|
---|
| 331 | Python/pythonrun.o \
|
---|
[388] | 332 | Python/random.o \
|
---|
[2] | 333 | Python/structmember.o \
|
---|
| 334 | Python/symtable.o \
|
---|
| 335 | Python/sysmodule.o \
|
---|
| 336 | Python/traceback.o \
|
---|
| 337 | Python/getopt.o \
|
---|
| 338 | Python/pystrcmp.o \
|
---|
| 339 | Python/pystrtod.o \
|
---|
[388] | 340 | Python/dtoa.o \
|
---|
[2] | 341 | Python/formatter_unicode.o \
|
---|
| 342 | Python/formatter_string.o \
|
---|
| 343 | Python/$(DYNLOADFILE) \
|
---|
| 344 | $(LIBOBJS) \
|
---|
| 345 | $(MACHDEP_OBJS) \
|
---|
| 346 | $(THREADOBJ)
|
---|
| 347 |
|
---|
| 348 |
|
---|
| 349 | ##########################################################################
|
---|
| 350 | # Objects
|
---|
| 351 | OBJECT_OBJS= \
|
---|
| 352 | Objects/abstract.o \
|
---|
| 353 | Objects/boolobject.o \
|
---|
| 354 | Objects/bufferobject.o \
|
---|
| 355 | Objects/bytes_methods.o \
|
---|
| 356 | Objects/bytearrayobject.o \
|
---|
[388] | 357 | Objects/capsule.o \
|
---|
[2] | 358 | Objects/cellobject.o \
|
---|
| 359 | Objects/classobject.o \
|
---|
| 360 | Objects/cobject.o \
|
---|
| 361 | Objects/codeobject.o \
|
---|
| 362 | Objects/complexobject.o \
|
---|
| 363 | Objects/descrobject.o \
|
---|
| 364 | Objects/enumobject.o \
|
---|
| 365 | Objects/exceptions.o \
|
---|
| 366 | Objects/genobject.o \
|
---|
| 367 | Objects/fileobject.o \
|
---|
| 368 | Objects/floatobject.o \
|
---|
| 369 | Objects/frameobject.o \
|
---|
| 370 | Objects/funcobject.o \
|
---|
| 371 | Objects/intobject.o \
|
---|
| 372 | Objects/iterobject.o \
|
---|
| 373 | Objects/listobject.o \
|
---|
| 374 | Objects/longobject.o \
|
---|
| 375 | Objects/dictobject.o \
|
---|
[388] | 376 | Objects/memoryobject.o \
|
---|
[2] | 377 | Objects/methodobject.o \
|
---|
| 378 | Objects/moduleobject.o \
|
---|
| 379 | Objects/object.o \
|
---|
| 380 | Objects/obmalloc.o \
|
---|
| 381 | Objects/rangeobject.o \
|
---|
| 382 | Objects/setobject.o \
|
---|
| 383 | Objects/sliceobject.o \
|
---|
| 384 | Objects/stringobject.o \
|
---|
| 385 | Objects/structseq.o \
|
---|
| 386 | Objects/tupleobject.o \
|
---|
| 387 | Objects/typeobject.o \
|
---|
| 388 | Objects/weakrefobject.o \
|
---|
| 389 | $(UNICODE_OBJS)
|
---|
| 390 |
|
---|
| 391 |
|
---|
| 392 | ##########################################################################
|
---|
| 393 | # objects that get linked into the Python library
|
---|
| 394 | LIBRARY_OBJS= \
|
---|
| 395 | Modules/getbuildinfo.o \
|
---|
| 396 | $(PARSER_OBJS) \
|
---|
| 397 | $(OBJECT_OBJS) \
|
---|
| 398 | $(PYTHON_OBJS) \
|
---|
| 399 | $(MODULE_OBJS) \
|
---|
| 400 | $(SIGNAL_OBJS) \
|
---|
| 401 | $(MODOBJS)
|
---|
| 402 |
|
---|
| 403 | #########################################################################
|
---|
| 404 | # Rules
|
---|
| 405 |
|
---|
| 406 | # Default target
|
---|
| 407 | all: build_all
|
---|
[388] | 408 | build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks
|
---|
[2] | 409 |
|
---|
| 410 | # Compile a binary with gcc profile guided optimization.
|
---|
| 411 | profile-opt:
|
---|
| 412 | @echo "Building with support for profile generation:"
|
---|
| 413 | $(MAKE) clean
|
---|
| 414 | $(MAKE) build_all_generate_profile
|
---|
| 415 | @echo "Running benchmark to generate profile data:"
|
---|
| 416 | $(MAKE) profile-removal
|
---|
| 417 | $(MAKE) run_profile_task
|
---|
| 418 | @echo "Rebuilding with profile guided optimizations:"
|
---|
| 419 | $(MAKE) clean
|
---|
| 420 | $(MAKE) build_all_use_profile
|
---|
| 421 |
|
---|
| 422 | build_all_generate_profile:
|
---|
| 423 | $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
|
---|
| 424 |
|
---|
| 425 | run_profile_task:
|
---|
[388] | 426 | : # FIXME: can't run for a cross build
|
---|
[2] | 427 | ./$(BUILDPYTHON) $(PROFILE_TASK)
|
---|
| 428 |
|
---|
| 429 | build_all_use_profile:
|
---|
| 430 | $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use"
|
---|
| 431 |
|
---|
| 432 | coverage:
|
---|
| 433 | @echo "Building with support for coverage checking:"
|
---|
| 434 | $(MAKE) clean
|
---|
| 435 | $(MAKE) all CFLAGS="$(CFLAGS) -O0 -pg -fprofile-arcs -ftest-coverage" LIBS="$(LIBS) -lgcov"
|
---|
| 436 |
|
---|
| 437 |
|
---|
| 438 | # Build the interpreter
|
---|
| 439 | $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
|
---|
| 440 | $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
|
---|
| 441 | Modules/python.o \
|
---|
| 442 | $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
|
---|
| 443 |
|
---|
[388] | 444 | platform: $(BUILDPYTHON) pybuilddir.txt
|
---|
| 445 | $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
|
---|
[2] | 446 |
|
---|
[388] | 447 | # Create build directory and generate the sysconfig build-time data there.
|
---|
| 448 | # pybuilddir.txt contains the name of the build dir and is used for
|
---|
| 449 | # sys.path fixup -- see Modules/getpath.c.
|
---|
| 450 | pybuilddir.txt: $(BUILDPYTHON)
|
---|
| 451 | $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars
|
---|
[2] | 452 |
|
---|
| 453 | # Build the shared modules
|
---|
[388] | 454 | # Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for
|
---|
| 455 | # -s, --silent or --quiet is always the first char.
|
---|
| 456 | # Under BSD make, MAKEFLAGS might be " -s -v x=y".
|
---|
| 457 | sharedmods: $(BUILDPYTHON) pybuilddir.txt
|
---|
| 458 | @case "$$MAKEFLAGS" in \
|
---|
| 459 | *\ -s*|s*) quiet="-q";; \
|
---|
| 460 | *) quiet="";; \
|
---|
| 461 | esac; \
|
---|
| 462 | $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
|
---|
| 463 | _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
|
---|
| 464 | $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
|
---|
[2] | 465 |
|
---|
| 466 | # Build static library
|
---|
| 467 | # avoid long command lines, same as LIBRARY_OBJS
|
---|
| 468 | $(LIBRARY): $(LIBRARY_OBJS)
|
---|
| 469 | -rm -f $@
|
---|
[388] | 470 | $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o
|
---|
| 471 | $(AR) $(ARFLAGS) $@ $(PARSER_OBJS)
|
---|
| 472 | $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS)
|
---|
| 473 | $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS)
|
---|
| 474 | $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
|
---|
| 475 | $(AR) $(ARFLAGS) $@ $(MODOBJS)
|
---|
[2] | 476 | $(RANLIB) $@
|
---|
| 477 |
|
---|
| 478 | libpython$(VERSION).so: $(LIBRARY_OBJS)
|
---|
| 479 | if test $(INSTSONAME) != $(LDLIBRARY); then \
|
---|
[388] | 480 | $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
|
---|
[2] | 481 | $(LN) -f $(INSTSONAME) $@; \
|
---|
| 482 | else \
|
---|
[388] | 483 | $(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
|
---|
[2] | 484 | fi
|
---|
| 485 |
|
---|
| 486 | libpython$(VERSION).dylib: $(LIBRARY_OBJS)
|
---|
| 487 | $(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); \
|
---|
| 488 |
|
---|
[388] | 489 |
|
---|
[2] | 490 | libpython$(VERSION).sl: $(LIBRARY_OBJS)
|
---|
[388] | 491 | $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST)
|
---|
[2] | 492 |
|
---|
[388] | 493 | # Copy up the gdb python hooks into a position where they can be automatically
|
---|
| 494 | # loaded by gdb during Lib/test/test_gdb.py
|
---|
| 495 | #
|
---|
| 496 | # Distributors are likely to want to install this somewhere else e.g. relative
|
---|
| 497 | # to the stripped DWARF data for the shared library.
|
---|
| 498 | gdbhooks: $(BUILDPYTHON)-gdb.py
|
---|
| 499 |
|
---|
| 500 | SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py
|
---|
| 501 | $(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS)
|
---|
| 502 | $(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py
|
---|
| 503 |
|
---|
[2] | 504 | # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
|
---|
| 505 | # minimal framework (not including the Lib directory and such) in the current
|
---|
| 506 | # directory.
|
---|
| 507 | RESSRCDIR=Mac/Resources/framework
|
---|
| 508 | $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
|
---|
| 509 | $(LIBRARY) \
|
---|
| 510 | $(RESSRCDIR)/Info.plist
|
---|
| 511 | $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
|
---|
[388] | 512 | $(CC) -o $(LDLIBRARY) $(LDFLAGS) -dynamiclib \
|
---|
| 513 | -all_load $(LIBRARY) -Wl,-single_module \
|
---|
| 514 | -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \
|
---|
| 515 | -compatibility_version $(VERSION) \
|
---|
| 516 | -current_version $(VERSION);
|
---|
[2] | 517 | $(INSTALL) -d -m $(DIRMODE) \
|
---|
| 518 | $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
|
---|
| 519 | $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
|
---|
| 520 | $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
|
---|
| 521 | $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
|
---|
| 522 | $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
|
---|
| 523 | $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
|
---|
| 524 | $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
|
---|
| 525 |
|
---|
| 526 | # This rule builds the Cygwin Python DLL and import library if configured
|
---|
| 527 | # for a shared core library; otherwise, this rule is a noop.
|
---|
| 528 | $(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
|
---|
| 529 | if test -n "$(DLLLIBRARY)"; then \
|
---|
[388] | 530 | $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
|
---|
[2] | 531 | $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST); \
|
---|
| 532 | else true; \
|
---|
| 533 | fi
|
---|
| 534 |
|
---|
| 535 |
|
---|
| 536 | oldsharedmods: $(SHAREDMODS)
|
---|
| 537 |
|
---|
| 538 |
|
---|
| 539 | Makefile Modules/config.c: Makefile.pre \
|
---|
| 540 | $(srcdir)/Modules/config.c.in \
|
---|
| 541 | $(MAKESETUP) \
|
---|
| 542 | Modules/Setup.config \
|
---|
| 543 | Modules/Setup \
|
---|
| 544 | Modules/Setup.local
|
---|
| 545 | $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
|
---|
| 546 | -s Modules \
|
---|
| 547 | Modules/Setup.config \
|
---|
| 548 | Modules/Setup.local \
|
---|
| 549 | Modules/Setup
|
---|
| 550 | @mv config.c Modules
|
---|
| 551 | @echo "The Makefile was updated, you may need to re-run make."
|
---|
| 552 |
|
---|
| 553 |
|
---|
| 554 | Modules/Setup: $(srcdir)/Modules/Setup.dist
|
---|
| 555 | @if test -f Modules/Setup; then \
|
---|
| 556 | echo "-----------------------------------------------"; \
|
---|
| 557 | echo "Modules/Setup.dist is newer than Modules/Setup;"; \
|
---|
| 558 | echo "check to make sure you have all the updates you"; \
|
---|
| 559 | echo "need in your Modules/Setup file."; \
|
---|
| 560 | echo "Usually, copying Modules/Setup.dist to Modules/Setup will work."; \
|
---|
| 561 | echo "-----------------------------------------------"; \
|
---|
| 562 | fi
|
---|
| 563 |
|
---|
| 564 | ############################################################################
|
---|
| 565 | # Special rules for object files
|
---|
| 566 |
|
---|
| 567 | Modules/getbuildinfo.o: $(PARSER_OBJS) \
|
---|
| 568 | $(OBJECT_OBJS) \
|
---|
| 569 | $(PYTHON_OBJS) \
|
---|
| 570 | $(MODULE_OBJS) \
|
---|
| 571 | $(SIGNAL_OBJS) \
|
---|
| 572 | $(MODOBJS) \
|
---|
| 573 | $(srcdir)/Modules/getbuildinfo.c
|
---|
[388] | 574 | $(CC) -c $(PY_CFLAGS) \
|
---|
| 575 | -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" \
|
---|
| 576 | -DHGVERSION="\"`LC_ALL=C $(HGVERSION)`\"" \
|
---|
| 577 | -DHGTAG="\"`LC_ALL=C $(HGTAG)`\"" \
|
---|
| 578 | -DHGBRANCH="\"`LC_ALL=C $(HGBRANCH)`\"" \
|
---|
| 579 | -o $@ $(srcdir)/Modules/getbuildinfo.c
|
---|
[2] | 580 |
|
---|
| 581 | Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
|
---|
| 582 | $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
|
---|
| 583 | -DPREFIX='"$(prefix)"' \
|
---|
| 584 | -DEXEC_PREFIX='"$(exec_prefix)"' \
|
---|
| 585 | -DVERSION='"$(VERSION)"' \
|
---|
| 586 | -DVPATH='"$(VPATH)"' \
|
---|
| 587 | -o $@ $(srcdir)/Modules/getpath.c
|
---|
| 588 |
|
---|
| 589 | Modules/python.o: $(srcdir)/Modules/python.c
|
---|
| 590 | $(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
|
---|
| 591 |
|
---|
[388] | 592 | Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c $(srcdir)/Modules/posixmodule.h
|
---|
[2] | 593 |
|
---|
[388] | 594 | Modules/grpmodule.o: $(srcdir)/Modules/grpmodule.c $(srcdir)/Modules/posixmodule.h
|
---|
[2] | 595 |
|
---|
[388] | 596 | Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h
|
---|
| 597 |
|
---|
| 598 | $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
|
---|
| 599 | @$(MKDIR_P) Include
|
---|
| 600 | $(MAKE) $(PGEN)
|
---|
| 601 | $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
|
---|
| 602 | $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
|
---|
| 603 | $(MAKE) $(GRAMMAR_H)
|
---|
| 604 | touch $(GRAMMAR_C)
|
---|
| 605 |
|
---|
[2] | 606 | $(PGEN): $(PGENOBJS)
|
---|
| 607 | $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
|
---|
| 608 |
|
---|
| 609 | Parser/grammar.o: $(srcdir)/Parser/grammar.c \
|
---|
| 610 | $(srcdir)/Include/token.h \
|
---|
| 611 | $(srcdir)/Include/grammar.h
|
---|
| 612 | Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c
|
---|
| 613 |
|
---|
| 614 | Parser/tokenizer_pgen.o: $(srcdir)/Parser/tokenizer.c
|
---|
| 615 |
|
---|
| 616 | Parser/pgenmain.o: $(srcdir)/Include/parsetok.h
|
---|
| 617 |
|
---|
| 618 | $(AST_H): $(AST_ASDL) $(ASDLGEN_FILES)
|
---|
[388] | 619 | $(MKDIR_P) $(AST_H_DIR)
|
---|
[2] | 620 | $(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL)
|
---|
| 621 |
|
---|
| 622 | $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
|
---|
[388] | 623 | $(MKDIR_P) $(AST_C_DIR)
|
---|
[2] | 624 | $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL)
|
---|
| 625 |
|
---|
[388] | 626 | Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
|
---|
[2] | 627 |
|
---|
| 628 | Python/getplatform.o: $(srcdir)/Python/getplatform.c
|
---|
| 629 | $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
|
---|
| 630 |
|
---|
| 631 | Python/importdl.o: $(srcdir)/Python/importdl.c
|
---|
| 632 | $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
|
---|
| 633 |
|
---|
| 634 | Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
|
---|
| 635 | $(srcdir)/Objects/unicodetype_db.h
|
---|
| 636 |
|
---|
| 637 | STRINGLIB_HEADERS= \
|
---|
| 638 | $(srcdir)/Include/bytes_methods.h \
|
---|
| 639 | $(srcdir)/Objects/stringlib/count.h \
|
---|
| 640 | $(srcdir)/Objects/stringlib/ctype.h \
|
---|
| 641 | $(srcdir)/Objects/stringlib/fastsearch.h \
|
---|
| 642 | $(srcdir)/Objects/stringlib/find.h \
|
---|
| 643 | $(srcdir)/Objects/stringlib/formatter.h \
|
---|
| 644 | $(srcdir)/Objects/stringlib/partition.h \
|
---|
[388] | 645 | $(srcdir)/Objects/stringlib/split.h \
|
---|
[2] | 646 | $(srcdir)/Objects/stringlib/stringdefs.h \
|
---|
| 647 | $(srcdir)/Objects/stringlib/string_format.h \
|
---|
| 648 | $(srcdir)/Objects/stringlib/transmogrify.h \
|
---|
| 649 | $(srcdir)/Objects/stringlib/unicodedefs.h \
|
---|
| 650 | $(srcdir)/Objects/stringlib/localeutil.h
|
---|
| 651 |
|
---|
| 652 | Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c \
|
---|
| 653 | $(STRINGLIB_HEADERS)
|
---|
| 654 |
|
---|
| 655 | Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c \
|
---|
| 656 | $(STRINGLIB_HEADERS)
|
---|
| 657 |
|
---|
| 658 | Objects/stringobject.o: $(srcdir)/Objects/stringobject.c \
|
---|
| 659 | $(STRINGLIB_HEADERS)
|
---|
| 660 |
|
---|
| 661 | Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \
|
---|
| 662 | $(STRINGLIB_HEADERS)
|
---|
| 663 |
|
---|
| 664 | Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \
|
---|
| 665 | $(STRINGLIB_HEADERS)
|
---|
| 666 |
|
---|
| 667 | ############################################################################
|
---|
| 668 | # Header files
|
---|
| 669 |
|
---|
| 670 | PYTHON_HEADERS= \
|
---|
| 671 | Include/Python-ast.h \
|
---|
| 672 | Include/Python.h \
|
---|
| 673 | Include/abstract.h \
|
---|
| 674 | Include/asdl.h \
|
---|
| 675 | Include/ast.h \
|
---|
| 676 | Include/bitset.h \
|
---|
| 677 | Include/boolobject.h \
|
---|
| 678 | Include/bytearrayobject.h \
|
---|
| 679 | Include/bytes_methods.h \
|
---|
| 680 | Include/bytesobject.h \
|
---|
| 681 | Include/bufferobject.h \
|
---|
| 682 | Include/cellobject.h \
|
---|
| 683 | Include/ceval.h \
|
---|
| 684 | Include/classobject.h \
|
---|
| 685 | Include/cobject.h \
|
---|
| 686 | Include/code.h \
|
---|
| 687 | Include/codecs.h \
|
---|
| 688 | Include/compile.h \
|
---|
| 689 | Include/complexobject.h \
|
---|
| 690 | Include/descrobject.h \
|
---|
| 691 | Include/dictobject.h \
|
---|
[388] | 692 | Include/dtoa.h \
|
---|
[2] | 693 | Include/enumobject.h \
|
---|
| 694 | Include/errcode.h \
|
---|
| 695 | Include/eval.h \
|
---|
| 696 | Include/fileobject.h \
|
---|
| 697 | Include/floatobject.h \
|
---|
| 698 | Include/frameobject.h \
|
---|
| 699 | Include/funcobject.h \
|
---|
| 700 | Include/genobject.h \
|
---|
| 701 | Include/import.h \
|
---|
| 702 | Include/intobject.h \
|
---|
| 703 | Include/intrcheck.h \
|
---|
| 704 | Include/iterobject.h \
|
---|
| 705 | Include/listobject.h \
|
---|
| 706 | Include/longintrepr.h \
|
---|
| 707 | Include/longobject.h \
|
---|
| 708 | Include/marshal.h \
|
---|
[388] | 709 | Include/memoryobject.h \
|
---|
[2] | 710 | Include/metagrammar.h \
|
---|
| 711 | Include/methodobject.h \
|
---|
| 712 | Include/modsupport.h \
|
---|
| 713 | Include/moduleobject.h \
|
---|
| 714 | Include/node.h \
|
---|
| 715 | Include/object.h \
|
---|
| 716 | Include/objimpl.h \
|
---|
| 717 | Include/opcode.h \
|
---|
| 718 | Include/osdefs.h \
|
---|
| 719 | Include/parsetok.h \
|
---|
| 720 | Include/patchlevel.h \
|
---|
| 721 | Include/pgen.h \
|
---|
| 722 | Include/pgenheaders.h \
|
---|
| 723 | Include/pyarena.h \
|
---|
[388] | 724 | Include/pycapsule.h \
|
---|
| 725 | Include/pyctype.h \
|
---|
[2] | 726 | Include/pydebug.h \
|
---|
| 727 | Include/pyerrors.h \
|
---|
| 728 | Include/pyfpe.h \
|
---|
| 729 | Include/pymath.h \
|
---|
| 730 | Include/pygetopt.h \
|
---|
| 731 | Include/pymem.h \
|
---|
| 732 | Include/pyport.h \
|
---|
| 733 | Include/pystate.h \
|
---|
| 734 | Include/pystrcmp.h \
|
---|
| 735 | Include/pystrtod.h \
|
---|
| 736 | Include/pythonrun.h \
|
---|
| 737 | Include/pythread.h \
|
---|
| 738 | Include/rangeobject.h \
|
---|
| 739 | Include/setobject.h \
|
---|
| 740 | Include/sliceobject.h \
|
---|
| 741 | Include/stringobject.h \
|
---|
| 742 | Include/structmember.h \
|
---|
| 743 | Include/structseq.h \
|
---|
| 744 | Include/symtable.h \
|
---|
| 745 | Include/sysmodule.h \
|
---|
| 746 | Include/traceback.h \
|
---|
| 747 | Include/tupleobject.h \
|
---|
| 748 | Include/ucnhash.h \
|
---|
| 749 | Include/unicodeobject.h \
|
---|
| 750 | Include/warnings.h \
|
---|
| 751 | Include/weakrefobject.h \
|
---|
| 752 | pyconfig.h \
|
---|
| 753 | $(PARSER_HEADERS)
|
---|
| 754 |
|
---|
| 755 | $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
|
---|
| 756 |
|
---|
| 757 |
|
---|
| 758 | ######################################################################
|
---|
| 759 |
|
---|
| 760 | # Test the interpreter (twice, once without .pyc files, once with)
|
---|
| 761 | # In the past, we've had problems where bugs in the marshalling or
|
---|
| 762 | # elsewhere caused bytecode read from .pyc files to behave differently
|
---|
| 763 | # than bytecode generated directly from a .py source file. Sometimes
|
---|
[388] | 764 | # the bytecode read from a .pyc file had the bug, sometimes the directly
|
---|
[2] | 765 | # generated bytecode. This is sometimes a very shy bug needing a lot of
|
---|
| 766 | # sample data.
|
---|
| 767 |
|
---|
| 768 | TESTOPTS= -l $(EXTRATESTOPTS)
|
---|
| 769 | TESTPROG= $(srcdir)/Lib/test/regrtest.py
|
---|
[388] | 770 | TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
|
---|
[2] | 771 | test: all platform
|
---|
| 772 | -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
|
---|
| 773 | -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
|
---|
| 774 | $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
|
---|
| 775 |
|
---|
| 776 | testall: all platform
|
---|
| 777 | -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
|
---|
| 778 | $(TESTPYTHON) $(srcdir)/Lib/compileall.py
|
---|
| 779 | -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
|
---|
[388] | 780 | -$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
|
---|
| 781 | $(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
|
---|
[2] | 782 |
|
---|
| 783 | # Run the unitests for both architectures in a Universal build on OSX
|
---|
| 784 | # Must be run on an Intel box.
|
---|
| 785 | testuniversal: all platform
|
---|
| 786 | if [ `arch` != 'i386' ];then \
|
---|
| 787 | echo "This can only be used on OSX/i386" ;\
|
---|
| 788 | exit 1 ;\
|
---|
| 789 | fi
|
---|
| 790 | -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
|
---|
[388] | 791 | -$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
|
---|
| 792 | $(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
|
---|
| 793 | $(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E -tt $(TESTPROG) -uall $(TESTOPTS)
|
---|
[2] | 794 |
|
---|
| 795 |
|
---|
| 796 | # Like testall, but with a single pass only
|
---|
| 797 | # run an optional script to include some information about the build environment
|
---|
| 798 | buildbottest: all platform
|
---|
| 799 | -@if which pybuildbot.identify >/dev/null 2>&1; then \
|
---|
| 800 | pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
|
---|
| 801 | fi
|
---|
[388] | 802 | $(TESTPYTHON) -R $(TESTPROG) -uall -rwW $(TESTOPTS)
|
---|
[2] | 803 |
|
---|
[388] | 804 | QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3 \
|
---|
| 805 | test_multibytecodec test_urllib2_localnet test_itertools \
|
---|
| 806 | test_multiprocessing test_mailbox test_socket test_poll \
|
---|
| 807 | test_select test_zipfile
|
---|
[2] | 808 | quicktest: all platform
|
---|
| 809 | -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
|
---|
| 810 | -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
|
---|
| 811 | $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
|
---|
| 812 |
|
---|
| 813 | MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
|
---|
| 814 | test_longexp
|
---|
| 815 | memtest: all platform
|
---|
| 816 | -rm -f $(srcdir)/Lib/test/*.py[co]
|
---|
| 817 | -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
|
---|
| 818 | $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
|
---|
| 819 |
|
---|
| 820 | # Install everything
|
---|
| 821 | install: @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@
|
---|
| 822 |
|
---|
| 823 | # Install almost everything without disturbing previous versions
|
---|
[388] | 824 | altinstall: @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall \
|
---|
| 825 | libainstall altmaninstall \
|
---|
[2] | 826 | sharedinstall oldsharedinstall @FRAMEWORKALTINSTALLLAST@
|
---|
| 827 |
|
---|
| 828 | # Install shared libraries enabled by Setup
|
---|
| 829 | DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
|
---|
| 830 |
|
---|
| 831 | oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
|
---|
| 832 | @for i in X $(SHAREDMODS); do \
|
---|
| 833 | if test $$i != X; then \
|
---|
| 834 | echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
|
---|
| 835 | $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
|
---|
| 836 | fi; \
|
---|
| 837 | done
|
---|
| 838 |
|
---|
| 839 | $(DESTSHARED):
|
---|
| 840 | @for i in $(DESTDIRS); \
|
---|
| 841 | do \
|
---|
| 842 | if test ! -d $(DESTDIR)$$i; then \
|
---|
| 843 | echo "Creating directory $$i"; \
|
---|
| 844 | $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
|
---|
| 845 | else true; \
|
---|
| 846 | fi; \
|
---|
| 847 | done
|
---|
| 848 |
|
---|
| 849 |
|
---|
[388] | 850 | # Install the interpreter by creating a symlink chain:
|
---|
| 851 | # $(PYTHON) -> python2 -> python$(VERSION))
|
---|
| 852 | # Also create equivalent chains for other installed files
|
---|
[2] | 853 | bininstall: altbininstall
|
---|
| 854 | -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON); \
|
---|
| 855 | then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
|
---|
| 856 | else true; \
|
---|
| 857 | fi
|
---|
[388] | 858 | (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(EXE) $(PYTHON))
|
---|
| 859 | -rm -f $(DESTDIR)$(BINDIR)/python2$(EXE)
|
---|
| 860 | (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python2$(EXE))
|
---|
| 861 | -rm -f $(DESTDIR)$(BINDIR)/python2-config
|
---|
| 862 | (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python2-config)
|
---|
[2] | 863 | -rm -f $(DESTDIR)$(BINDIR)/python-config
|
---|
[388] | 864 | (cd $(DESTDIR)$(BINDIR); $(LN) -s python2-config python-config)
|
---|
| 865 | -test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC)
|
---|
| 866 | -rm -f $(DESTDIR)$(LIBPC)/python2.pc
|
---|
| 867 | (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python2.pc)
|
---|
| 868 | -rm -f $(DESTDIR)$(LIBPC)/python.pc
|
---|
| 869 | (cd $(DESTDIR)$(LIBPC); $(LN) -s python2.pc python.pc)
|
---|
[2] | 870 |
|
---|
| 871 | # Install the interpreter with $(VERSION) affixed
|
---|
| 872 | # This goes into $(exec_prefix)
|
---|
| 873 | altbininstall: $(BUILDPYTHON)
|
---|
| 874 | @for i in $(BINDIR) $(LIBDIR); \
|
---|
| 875 | do \
|
---|
| 876 | if test ! -d $(DESTDIR)$$i; then \
|
---|
| 877 | echo "Creating directory $$i"; \
|
---|
| 878 | $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
|
---|
| 879 | else true; \
|
---|
| 880 | fi; \
|
---|
| 881 | done
|
---|
| 882 | $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
|
---|
| 883 | if test -f $(LDLIBRARY); then \
|
---|
| 884 | if test -n "$(DLLLIBRARY)" ; then \
|
---|
| 885 | $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
|
---|
| 886 | else \
|
---|
| 887 | $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
|
---|
| 888 | if test $(LDLIBRARY) != $(INSTSONAME); then \
|
---|
| 889 | (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \
|
---|
| 890 | fi \
|
---|
| 891 | fi; \
|
---|
| 892 | else true; \
|
---|
| 893 | fi
|
---|
| 894 |
|
---|
[388] | 895 | # Install the versioned manual page
|
---|
| 896 | altmaninstall:
|
---|
[2] | 897 | @for i in $(MANDIR) $(MANDIR)/man1; \
|
---|
| 898 | do \
|
---|
| 899 | if test ! -d $(DESTDIR)$$i; then \
|
---|
| 900 | echo "Creating directory $$i"; \
|
---|
| 901 | $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
|
---|
| 902 | else true; \
|
---|
| 903 | fi; \
|
---|
| 904 | done
|
---|
| 905 | $(INSTALL_DATA) $(srcdir)/Misc/python.man \
|
---|
[388] | 906 | $(DESTDIR)$(MANDIR)/man1/python$(VERSION).1
|
---|
[2] | 907 |
|
---|
[388] | 908 | # Install the unversioned manual pages
|
---|
| 909 | maninstall: altmaninstall
|
---|
| 910 | -rm -f $(DESTDIR)$(MANDIR)/man1/python2.1
|
---|
| 911 | (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python$(VERSION).1 python2.1)
|
---|
| 912 | -rm -f $(DESTDIR)$(MANDIR)/man1/python.1
|
---|
| 913 | (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python2.1 python.1)
|
---|
| 914 |
|
---|
[2] | 915 | # Install the library
|
---|
| 916 | PLATDIR= plat-$(MACHDEP)
|
---|
| 917 | EXTRAPLATDIR= @EXTRAPLATDIR@
|
---|
| 918 | EXTRAMACHDEPPATH=@EXTRAMACHDEPPATH@
|
---|
| 919 | MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR)
|
---|
| 920 | XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
|
---|
| 921 | PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
|
---|
| 922 | plat-mac/lib-scriptpackages/_builtinSuites \
|
---|
| 923 | plat-mac/lib-scriptpackages/CodeWarrior \
|
---|
| 924 | plat-mac/lib-scriptpackages/Explorer \
|
---|
| 925 | plat-mac/lib-scriptpackages/Finder \
|
---|
| 926 | plat-mac/lib-scriptpackages/Netscape \
|
---|
| 927 | plat-mac/lib-scriptpackages/StdSuites \
|
---|
| 928 | plat-mac/lib-scriptpackages/SystemEvents \
|
---|
[388] | 929 | plat-mac/lib-scriptpackages/Terminal
|
---|
[2] | 930 | PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
|
---|
[388] | 931 | LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \
|
---|
| 932 | lib-tk/test/test_ttk site-packages test test/audiodata test/data \
|
---|
| 933 | test/cjkencodings test/decimaltestdata test/xmltestdata test/subprocessdata \
|
---|
| 934 | test/tracedmodules \
|
---|
[2] | 935 | encodings compiler hotshot \
|
---|
| 936 | email email/mime email/test email/test/data \
|
---|
| 937 | json json/tests \
|
---|
| 938 | sqlite3 sqlite3/test \
|
---|
[388] | 939 | logging bsddb bsddb/test csv importlib wsgiref \
|
---|
[2] | 940 | lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
|
---|
[388] | 941 | lib2to3/tests/data lib2to3/tests/data/fixers lib2to3/tests/data/fixers/myfixes \
|
---|
[2] | 942 | ctypes ctypes/test ctypes/macholib idlelib idlelib/Icons \
|
---|
| 943 | distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
|
---|
| 944 | multiprocessing multiprocessing/dummy \
|
---|
[388] | 945 | unittest unittest/test \
|
---|
[2] | 946 | lib-old \
|
---|
[388] | 947 | curses pydoc_data $(MACHDEPS)
|
---|
| 948 | libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
|
---|
[2] | 949 | @for i in $(SCRIPTDIR) $(LIBDEST); \
|
---|
| 950 | do \
|
---|
| 951 | if test ! -d $(DESTDIR)$$i; then \
|
---|
| 952 | echo "Creating directory $$i"; \
|
---|
| 953 | $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
|
---|
| 954 | else true; \
|
---|
| 955 | fi; \
|
---|
| 956 | done
|
---|
| 957 | @for d in $(LIBSUBDIRS); \
|
---|
| 958 | do \
|
---|
| 959 | a=$(srcdir)/Lib/$$d; \
|
---|
| 960 | if test ! -d $$a; then continue; else true; fi; \
|
---|
| 961 | b=$(LIBDEST)/$$d; \
|
---|
| 962 | if test ! -d $(DESTDIR)$$b; then \
|
---|
| 963 | echo "Creating directory $$b"; \
|
---|
| 964 | $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
|
---|
| 965 | else true; \
|
---|
| 966 | fi; \
|
---|
| 967 | done
|
---|
[388] | 968 | @for i in $(srcdir)/Lib/*.py `cat pybuilddir.txt`/_sysconfigdata.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \
|
---|
[2] | 969 | do \
|
---|
| 970 | if test -x $$i; then \
|
---|
| 971 | $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
|
---|
| 972 | echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
|
---|
| 973 | else \
|
---|
| 974 | $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
|
---|
| 975 | echo $(INSTALL_DATA) $$i $(LIBDEST); \
|
---|
| 976 | fi; \
|
---|
| 977 | done
|
---|
| 978 | @for d in $(LIBSUBDIRS); \
|
---|
| 979 | do \
|
---|
| 980 | a=$(srcdir)/Lib/$$d; \
|
---|
| 981 | if test ! -d $$a; then continue; else true; fi; \
|
---|
| 982 | if test `ls $$a | wc -l` -lt 1; then continue; fi; \
|
---|
| 983 | b=$(LIBDEST)/$$d; \
|
---|
| 984 | for i in $$a/*; \
|
---|
| 985 | do \
|
---|
| 986 | case $$i in \
|
---|
| 987 | *CVS) ;; \
|
---|
| 988 | *.py[co]) ;; \
|
---|
| 989 | *.orig) ;; \
|
---|
| 990 | *~) ;; \
|
---|
| 991 | *) \
|
---|
| 992 | if test -d $$i; then continue; fi; \
|
---|
| 993 | if test -x $$i; then \
|
---|
| 994 | echo $(INSTALL_SCRIPT) $$i $$b; \
|
---|
| 995 | $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
|
---|
| 996 | else \
|
---|
| 997 | echo $(INSTALL_DATA) $$i $$b; \
|
---|
| 998 | $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
|
---|
| 999 | fi;; \
|
---|
| 1000 | esac; \
|
---|
| 1001 | done; \
|
---|
| 1002 | done
|
---|
| 1003 | $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
|
---|
[388] | 1004 | if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
|
---|
| 1005 | $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
|
---|
| 1006 | $(DESTDIR)$(LIBDEST)/distutils/tests ; \
|
---|
| 1007 | fi
|
---|
[2] | 1008 | PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
---|
[388] | 1009 | $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
|
---|
[2] | 1010 | -d $(LIBDEST) -f \
|
---|
[388] | 1011 | -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
|
---|
| 1012 | $(DESTDIR)$(LIBDEST)
|
---|
[2] | 1013 | PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
---|
[388] | 1014 | $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
|
---|
[2] | 1015 | -d $(LIBDEST) -f \
|
---|
[388] | 1016 | -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
|
---|
| 1017 | $(DESTDIR)$(LIBDEST)
|
---|
[2] | 1018 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
---|
[388] | 1019 | $(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
|
---|
[2] | 1020 | -d $(LIBDEST)/site-packages -f \
|
---|
| 1021 | -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
|
---|
| 1022 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
---|
[388] | 1023 | $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
|
---|
[2] | 1024 | -d $(LIBDEST)/site-packages -f \
|
---|
| 1025 | -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
|
---|
| 1026 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
---|
[388] | 1027 | $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
|
---|
| 1028 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
|
---|
| 1029 | $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
|
---|
[2] | 1030 |
|
---|
| 1031 | # Create the PLATDIR source directory, if one wasn't distributed..
|
---|
| 1032 | $(srcdir)/Lib/$(PLATDIR):
|
---|
| 1033 | mkdir $(srcdir)/Lib/$(PLATDIR)
|
---|
| 1034 | cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
|
---|
| 1035 | export PATH; PATH="`pwd`:$$PATH"; \
|
---|
[388] | 1036 | export PYTHONPATH; PYTHONPATH="$(srcdir)/Lib:$(abs_builddir)/`cat pybuilddir.txt`"; \
|
---|
[2] | 1037 | export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
|
---|
| 1038 | export EXE; EXE="$(BUILDEXE)"; \
|
---|
[388] | 1039 | if [ -n "$(MULTIARCH)" ]; then export MULTIARCH; MULTIARCH=$(MULTIARCH); fi; \
|
---|
| 1040 | export PYTHON_FOR_BUILD; \
|
---|
| 1041 | if [ "$(build)" = "$(host)" ]; then \
|
---|
| 1042 | PYTHON_FOR_BUILD="$(BUILDPYTHON)"; \
|
---|
| 1043 | else \
|
---|
| 1044 | PYTHON_FOR_BUILD="$(PYTHON_FOR_BUILD)"; \
|
---|
| 1045 | fi; \
|
---|
[2] | 1046 | cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
|
---|
| 1047 |
|
---|
[388] | 1048 | python-config: $(srcdir)/Misc/python-config.in
|
---|
| 1049 | # Substitution happens here, as the completely-expanded BINDIR
|
---|
| 1050 | # is not available in configure
|
---|
| 1051 | sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
|
---|
| 1052 |
|
---|
[2] | 1053 | # Install the include files
|
---|
| 1054 | INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
|
---|
| 1055 | inclinstall:
|
---|
| 1056 | @for i in $(INCLDIRSTOMAKE); \
|
---|
| 1057 | do \
|
---|
| 1058 | if test ! -d $(DESTDIR)$$i; then \
|
---|
| 1059 | echo "Creating directory $$i"; \
|
---|
| 1060 | $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
|
---|
| 1061 | else true; \
|
---|
| 1062 | fi; \
|
---|
| 1063 | done
|
---|
| 1064 | @for i in $(srcdir)/Include/*.h; \
|
---|
| 1065 | do \
|
---|
| 1066 | echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
|
---|
| 1067 | $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
|
---|
| 1068 | done
|
---|
| 1069 | $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
|
---|
| 1070 |
|
---|
| 1071 | # Install the library and miscellaneous stuff needed for extending/embedding
|
---|
| 1072 | # This goes into $(exec_prefix)
|
---|
| 1073 | LIBPL= $(LIBP)/config
|
---|
[388] | 1074 |
|
---|
| 1075 | # pkgconfig directory
|
---|
| 1076 | LIBPC= $(LIBDIR)/pkgconfig
|
---|
| 1077 |
|
---|
| 1078 | libainstall: all python-config
|
---|
| 1079 | @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
|
---|
[2] | 1080 | do \
|
---|
| 1081 | if test ! -d $(DESTDIR)$$i; then \
|
---|
| 1082 | echo "Creating directory $$i"; \
|
---|
| 1083 | $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
|
---|
| 1084 | else true; \
|
---|
| 1085 | fi; \
|
---|
| 1086 | done
|
---|
| 1087 | @if test -d $(LIBRARY); then :; else \
|
---|
| 1088 | if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
|
---|
| 1089 | if test "$(SO)" = .dll; then \
|
---|
| 1090 | $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
|
---|
| 1091 | else \
|
---|
| 1092 | $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
|
---|
| 1093 | $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
|
---|
| 1094 | fi; \
|
---|
| 1095 | else \
|
---|
| 1096 | echo Skip install of $(LIBRARY) - use make frameworkinstall; \
|
---|
| 1097 | fi; \
|
---|
| 1098 | fi
|
---|
| 1099 | $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
|
---|
| 1100 | $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
|
---|
| 1101 | $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
|
---|
| 1102 | $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
|
---|
| 1103 | $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
|
---|
| 1104 | $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
|
---|
| 1105 | $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
|
---|
[388] | 1106 | $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
|
---|
[2] | 1107 | $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
|
---|
| 1108 | $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
|
---|
| 1109 | $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
|
---|
| 1110 | rm python-config
|
---|
| 1111 | @if [ -s Modules/python.exp -a \
|
---|
| 1112 | "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
|
---|
| 1113 | echo; echo "Installing support files for building shared extension modules on AIX:"; \
|
---|
| 1114 | $(INSTALL_DATA) Modules/python.exp \
|
---|
| 1115 | $(DESTDIR)$(LIBPL)/python.exp; \
|
---|
| 1116 | echo; echo "$(LIBPL)/python.exp"; \
|
---|
| 1117 | $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \
|
---|
| 1118 | $(DESTDIR)$(LIBPL)/makexp_aix; \
|
---|
| 1119 | echo "$(LIBPL)/makexp_aix"; \
|
---|
| 1120 | $(INSTALL_SCRIPT) $(srcdir)/Modules/ld_so_aix \
|
---|
| 1121 | $(DESTDIR)$(LIBPL)/ld_so_aix; \
|
---|
| 1122 | echo "$(LIBPL)/ld_so_aix"; \
|
---|
| 1123 | echo; echo "See Misc/AIX-NOTES for details."; \
|
---|
| 1124 | else true; \
|
---|
| 1125 | fi
|
---|
| 1126 | @case "$(MACHDEP)" in beos*) \
|
---|
| 1127 | echo; echo "Installing support files for building shared extension modules on BeOS:"; \
|
---|
| 1128 | $(INSTALL_DATA) Misc/BeOS-NOTES $(DESTDIR)$(LIBPL)/README; \
|
---|
| 1129 | echo; echo "$(LIBPL)/README"; \
|
---|
| 1130 | $(INSTALL_SCRIPT) Modules/ar_beos $(DESTDIR)$(LIBPL)/ar_beos; \
|
---|
| 1131 | echo "$(LIBPL)/ar_beos"; \
|
---|
| 1132 | $(INSTALL_SCRIPT) Modules/ld_so_beos $(DESTDIR)$(LIBPL)/ld_so_beos; \
|
---|
| 1133 | echo "$(LIBPL)/ld_so_beos"; \
|
---|
| 1134 | echo; echo "See Misc/BeOS-NOTES for details."; \
|
---|
| 1135 | ;; \
|
---|
| 1136 | esac
|
---|
| 1137 |
|
---|
| 1138 | # Install the dynamically loadable modules
|
---|
| 1139 | # This goes into $(exec_prefix)
|
---|
[388] | 1140 | sharedinstall: sharedmods
|
---|
| 1141 | $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
|
---|
[2] | 1142 | --prefix=$(prefix) \
|
---|
| 1143 | --install-scripts=$(BINDIR) \
|
---|
| 1144 | --install-platlib=$(DESTSHARED) \
|
---|
[388] | 1145 | --root=$(DESTDIR)/
|
---|
| 1146 | -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata.py*
|
---|
[2] | 1147 |
|
---|
| 1148 | # Here are a couple of targets for MacOSX again, to install a full
|
---|
| 1149 | # framework-based Python. frameworkinstall installs everything, the
|
---|
| 1150 | # subtargets install specific parts. Much of the actual work is offloaded to
|
---|
| 1151 | # the Makefile in Mac
|
---|
| 1152 | #
|
---|
| 1153 | #
|
---|
| 1154 | # This target is here for backward compatiblity, previous versions of Python
|
---|
| 1155 | # hadn't integrated framework installation in the normal install process.
|
---|
| 1156 | frameworkinstall: install
|
---|
| 1157 |
|
---|
| 1158 | # On install, we re-make the framework
|
---|
| 1159 | # structure in the install location, /Library/Frameworks/ or the argument to
|
---|
| 1160 | # --enable-framework. If --enable-framework has been specified then we have
|
---|
| 1161 | # automatically set prefix to the location deep down in the framework, so we
|
---|
| 1162 | # only have to cater for the structural bits of the framework.
|
---|
| 1163 |
|
---|
| 1164 | frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
|
---|
| 1165 |
|
---|
| 1166 | frameworkinstallstructure: $(LDLIBRARY)
|
---|
| 1167 | @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
|
---|
| 1168 | echo Not configured with --enable-framework; \
|
---|
| 1169 | exit 1; \
|
---|
| 1170 | else true; \
|
---|
| 1171 | fi
|
---|
| 1172 | @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
|
---|
| 1173 | if test ! -d $(DESTDIR)$$i; then \
|
---|
| 1174 | echo "Creating directory $(DESTDIR)$$i"; \
|
---|
| 1175 | $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
|
---|
| 1176 | else true; \
|
---|
| 1177 | fi; \
|
---|
| 1178 | done
|
---|
| 1179 | $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
|
---|
| 1180 | sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
|
---|
| 1181 | $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
|
---|
| 1182 | $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
|
---|
| 1183 | $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
|
---|
| 1184 | $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
|
---|
| 1185 | $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
|
---|
| 1186 |
|
---|
| 1187 | # This installs Mac/Lib into the framework
|
---|
| 1188 | # Install a number of symlinks to keep software that expects a normal unix
|
---|
| 1189 | # install (which includes python-config) happy.
|
---|
| 1190 | frameworkinstallmaclib:
|
---|
| 1191 | ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a"
|
---|
| 1192 | ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).dylib"
|
---|
[388] | 1193 | ln -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(VERSION).dylib"
|
---|
[2] | 1194 | cd Mac && $(MAKE) installmacsubtree DESTDIR="$(DESTDIR)"
|
---|
| 1195 |
|
---|
| 1196 | # This installs the IDE, the Launcher and other apps into /Applications
|
---|
| 1197 | frameworkinstallapps:
|
---|
| 1198 | cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
|
---|
| 1199 |
|
---|
| 1200 | # This install the unix python and pythonw tools in /usr/local/bin
|
---|
| 1201 | frameworkinstallunixtools:
|
---|
| 1202 | cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
|
---|
| 1203 |
|
---|
| 1204 | frameworkaltinstallunixtools:
|
---|
| 1205 | cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"
|
---|
| 1206 |
|
---|
| 1207 | # This installs the Demos and Tools into the applications directory.
|
---|
| 1208 | # It is not part of a normal frameworkinstall
|
---|
| 1209 | frameworkinstallextras:
|
---|
| 1210 | cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)"
|
---|
| 1211 |
|
---|
| 1212 | # This installs a few of the useful scripts in Tools/scripts
|
---|
| 1213 | scriptsinstall:
|
---|
| 1214 | SRCDIR=$(srcdir) $(RUNSHARED) \
|
---|
[388] | 1215 | $(PYTHON_FOR_BUILD) $(srcdir)/Tools/scripts/setup.py install \
|
---|
[2] | 1216 | --prefix=$(prefix) \
|
---|
| 1217 | --install-scripts=$(BINDIR) \
|
---|
[388] | 1218 | --root=$(DESTDIR)/
|
---|
[2] | 1219 |
|
---|
| 1220 | # Build the toplevel Makefile
|
---|
| 1221 | Makefile.pre: Makefile.pre.in config.status
|
---|
| 1222 | CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
|
---|
| 1223 | $(MAKE) -f Makefile.pre Makefile
|
---|
| 1224 |
|
---|
| 1225 | # Run the configure script.
|
---|
| 1226 | config.status: $(srcdir)/configure
|
---|
| 1227 | $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
|
---|
| 1228 |
|
---|
| 1229 | .PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
|
---|
| 1230 |
|
---|
| 1231 | # Some make's put the object file in the current directory
|
---|
| 1232 | .c.o:
|
---|
| 1233 | $(CC) -c $(PY_CFLAGS) -o $@ $<
|
---|
| 1234 |
|
---|
| 1235 | # Run reindent on the library
|
---|
| 1236 | reindent:
|
---|
| 1237 | ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
|
---|
| 1238 |
|
---|
| 1239 | # Rerun configure with the same options as it was run last time,
|
---|
| 1240 | # provided the config.status script exists
|
---|
| 1241 | recheck:
|
---|
| 1242 | $(SHELL) config.status --recheck
|
---|
| 1243 | $(SHELL) config.status
|
---|
| 1244 |
|
---|
[388] | 1245 | # Rebuild the configure script from configure.ac; also rebuild pyconfig.h.in
|
---|
[2] | 1246 | autoconf:
|
---|
| 1247 | (cd $(srcdir); autoconf)
|
---|
| 1248 | (cd $(srcdir); autoheader)
|
---|
| 1249 |
|
---|
| 1250 | # Create a tags file for vi
|
---|
| 1251 | tags::
|
---|
| 1252 | cd $(srcdir); \
|
---|
| 1253 | ctags -w -t Include/*.h; \
|
---|
| 1254 | for i in $(SRCDIRS); do ctags -w -t -a $$i/*.[ch]; \
|
---|
| 1255 | done; \
|
---|
| 1256 | sort -o tags tags
|
---|
| 1257 |
|
---|
| 1258 | # Create a tags file for GNU Emacs
|
---|
| 1259 | TAGS::
|
---|
| 1260 | cd $(srcdir); \
|
---|
| 1261 | etags Include/*.h; \
|
---|
| 1262 | for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
|
---|
| 1263 |
|
---|
[388] | 1264 | # Touch generated files
|
---|
| 1265 | touch:
|
---|
| 1266 | touch Include/Python-ast.h Python/Python-ast.c
|
---|
| 1267 |
|
---|
[2] | 1268 | # Sanitation targets -- clean leaves libraries, executables and tags
|
---|
| 1269 | # files, which clobber removes as well
|
---|
| 1270 | pycremoval:
|
---|
| 1271 | find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
|
---|
| 1272 |
|
---|
| 1273 | clean: pycremoval
|
---|
[388] | 1274 | find . -name '*.[oa]' -exec rm -f {} ';'
|
---|
[2] | 1275 | find . -name '*.s[ol]' -exec rm -f {} ';'
|
---|
[388] | 1276 | find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
|
---|
| 1277 | find build -name 'fficonfig.h' -exec rm -f {} ';' || true
|
---|
| 1278 | find build -name 'fficonfig.py' -exec rm -f {} ';' || true
|
---|
[2] | 1279 | -rm -f Lib/lib2to3/*Grammar*.pickle
|
---|
| 1280 |
|
---|
| 1281 | profile-removal:
|
---|
| 1282 | find . -name '*.gc??' -exec rm -f {} ';'
|
---|
| 1283 |
|
---|
| 1284 | clobber: clean profile-removal
|
---|
| 1285 | -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
|
---|
| 1286 | tags TAGS \
|
---|
| 1287 | config.cache config.log pyconfig.h Modules/config.c
|
---|
| 1288 | -rm -rf build platform
|
---|
| 1289 | -rm -rf $(PYTHONFRAMEWORKDIR)
|
---|
| 1290 |
|
---|
| 1291 | # Make things extra clean, before making a distribution:
|
---|
| 1292 | # remove all generated files, even Makefile[.pre]
|
---|
| 1293 | # Keep configure and Python-ast.[ch], it's possible they can't be generated
|
---|
| 1294 | distclean: clobber
|
---|
[388] | 1295 | for file in Lib/test/data/* ; do \
|
---|
| 1296 | if test "$$file" != "Lib/test/data/README"; then rm "$$file"; fi; \
|
---|
| 1297 | done
|
---|
[2] | 1298 | -rm -f core Makefile Makefile.pre config.status \
|
---|
[388] | 1299 | Modules/Setup Modules/Setup.local Modules/Setup.config \
|
---|
| 1300 | Modules/ld_so_aix Modules/python.exp Misc/python.pc
|
---|
| 1301 | -rm -f python*-gdb.py
|
---|
| 1302 | -rm -f pybuilddir.txt
|
---|
| 1303 | find $(srcdir)/[a-zA-Z]* '(' -name '*.fdc' -o -name '*~' \
|
---|
| 1304 | -o -name '[@,#]*' -o -name '*.old' \
|
---|
| 1305 | -o -name '*.orig' -o -name '*.rej' \
|
---|
| 1306 | -o -name '*.bak' ')' \
|
---|
| 1307 | -exec rm -f {} ';'
|
---|
[2] | 1308 |
|
---|
| 1309 | # Check for smelly exported symbols (not starting with Py/_Py)
|
---|
| 1310 | smelly: all
|
---|
| 1311 | nm -p $(LIBRARY) | \
|
---|
| 1312 | sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
|
---|
| 1313 |
|
---|
| 1314 | # Find files with funny names
|
---|
| 1315 | funny:
|
---|
[388] | 1316 | find $(SUBDIRS) $(SUBDIRSTOO) -type d \
|
---|
[2] | 1317 | -o -name '*.[chs]' \
|
---|
| 1318 | -o -name '*.py' \
|
---|
| 1319 | -o -name '*.doc' \
|
---|
| 1320 | -o -name '*.sty' \
|
---|
| 1321 | -o -name '*.bib' \
|
---|
| 1322 | -o -name '*.dat' \
|
---|
| 1323 | -o -name '*.el' \
|
---|
| 1324 | -o -name '*.fd' \
|
---|
| 1325 | -o -name '*.in' \
|
---|
| 1326 | -o -name '*.tex' \
|
---|
| 1327 | -o -name '*,[vpt]' \
|
---|
| 1328 | -o -name 'Setup' \
|
---|
| 1329 | -o -name 'Setup.*' \
|
---|
| 1330 | -o -name README \
|
---|
| 1331 | -o -name Makefile \
|
---|
| 1332 | -o -name ChangeLog \
|
---|
| 1333 | -o -name Repository \
|
---|
| 1334 | -o -name Root \
|
---|
| 1335 | -o -name Entries \
|
---|
| 1336 | -o -name Tag \
|
---|
| 1337 | -o -name tags \
|
---|
| 1338 | -o -name TAGS \
|
---|
| 1339 | -o -name .cvsignore \
|
---|
| 1340 | -o -name MANIFEST \
|
---|
| 1341 | -o -print
|
---|
| 1342 |
|
---|
| 1343 | # Perform some verification checks on any modified files.
|
---|
| 1344 | patchcheck:
|
---|
| 1345 | $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
|
---|
| 1346 |
|
---|
| 1347 | # Dependencies
|
---|
| 1348 |
|
---|
| 1349 | Python/thread.o: @THREADHEADERS@
|
---|
| 1350 |
|
---|
| 1351 | # Declare targets that aren't real files
|
---|
| 1352 | .PHONY: all build_all sharedmods oldsharedmods test quicktest memtest
|
---|
| 1353 | .PHONY: install altinstall oldsharedinstall bininstall altbininstall
|
---|
| 1354 | .PHONY: maninstall libinstall inclinstall libainstall sharedinstall
|
---|
| 1355 | .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
|
---|
| 1356 | .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
|
---|
[388] | 1357 | .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
|
---|
| 1358 | .PHONY: smelly funny patchcheck touch altmaninstall
|
---|
| 1359 | .PHONY: gdbhooks
|
---|
[2] | 1360 |
|
---|
| 1361 | # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
|
---|