]> git.ipfire.org Git - thirdparty/Python/cpython.git/blob - Makefile.pre.in
gh-94673: Fix compiler warning in typeobject.c (#117980)
[thirdparty/Python/cpython.git] / Makefile.pre.in
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 MODBUILT_NAMES= _MODBUILT_NAMES_
24 MODSHARED_NAMES= _MODSHARED_NAMES_
25 MODDISABLED_NAMES= _MODDISABLED_NAMES_
26 MODOBJS= _MODOBJS_
27 MODLIBS= _MODLIBS_
28
29 # === Variables set by configure
30 VERSION= @VERSION@
31 srcdir= @srcdir@
32 VPATH= @srcdir@
33 abs_srcdir= @abs_srcdir@
34 abs_builddir= @abs_builddir@
35
36
37 CC= @CC@
38 CXX= @CXX@
39 LINKCC= @LINKCC@
40 AR= @AR@
41 READELF= @READELF@
42 SOABI= @SOABI@
43 LDVERSION= @LDVERSION@
44 MODULE_LDFLAGS=@MODULE_LDFLAGS@
45 GITVERSION= @GITVERSION@
46 GITTAG= @GITTAG@
47 GITBRANCH= @GITBRANCH@
48 PGO_PROF_GEN_FLAG=@PGO_PROF_GEN_FLAG@
49 PGO_PROF_USE_FLAG=@PGO_PROF_USE_FLAG@
50 LLVM_PROF_MERGER=@LLVM_PROF_MERGER@
51 LLVM_PROF_FILE=@LLVM_PROF_FILE@
52 LLVM_PROF_ERR=@LLVM_PROF_ERR@
53 DTRACE= @DTRACE@
54 DFLAGS= @DFLAGS@
55 DTRACE_HEADERS= @DTRACE_HEADERS@
56 DTRACE_OBJS= @DTRACE_OBJS@
57 DSYMUTIL= @DSYMUTIL@
58 DSYMUTIL_PATH= @DSYMUTIL_PATH@
59
60 GNULD= @GNULD@
61
62 # Shell used by make (some versions default to the login shell, which is bad)
63 SHELL= /bin/sh -e
64
65 # Use this to make a link between python$(VERSION) and python in $(BINDIR)
66 LN= @LN@
67
68 # Portable install script (configure doesn't always guess right)
69 INSTALL= @INSTALL@
70 INSTALL_PROGRAM=@INSTALL_PROGRAM@
71 INSTALL_SCRIPT= @INSTALL_SCRIPT@
72 INSTALL_DATA= @INSTALL_DATA@
73 # Shared libraries must be installed with executable mode on some systems;
74 # rather than figuring out exactly which, we always give them executable mode.
75 INSTALL_SHARED= ${INSTALL} -m 755
76
77 MKDIR_P= @MKDIR_P@
78
79 MAKESETUP= $(srcdir)/Modules/makesetup
80
81 # Compiler options
82 OPT= @OPT@
83 BASECFLAGS= @BASECFLAGS@
84 BASECPPFLAGS= @BASECPPFLAGS@
85 CONFIGURE_CFLAGS= @CFLAGS@
86 # CFLAGS_NODIST is used for building the interpreter and stdlib C extensions.
87 # Use it when a compiler flag should _not_ be part of the distutils CFLAGS
88 # once Python is installed (Issue #21121).
89 CONFIGURE_CFLAGS_NODIST=@CFLAGS_NODIST@
90 # LDFLAGS_NODIST is used in the same manner as CFLAGS_NODIST.
91 # Use it when a linker flag should _not_ be part of the distutils LDFLAGS
92 # once Python is installed (bpo-35257)
93 CONFIGURE_LDFLAGS_NODIST=@LDFLAGS_NODIST@
94 # LDFLAGS_NOLTO is an extra flag to disable lto. It is used to speed up building
95 # of _bootstrap_python and _freeze_module tools, which don't need LTO.
96 CONFIGURE_LDFLAGS_NOLTO=@LDFLAGS_NOLTO@
97 CONFIGURE_CPPFLAGS= @CPPFLAGS@
98 CONFIGURE_LDFLAGS= @LDFLAGS@
99 # Avoid assigning CFLAGS, LDFLAGS, etc. so users can use them on the
100 # command line to append to these values without stomping the pre-set
101 # values.
102 PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
103 PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/internal -I$(srcdir)/Include/internal/mimalloc
104 # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
105 # be able to build extension modules using the directories specified in the
106 # environment variables
107 PY_CPPFLAGS= $(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS)
108 PY_LDFLAGS= $(CONFIGURE_LDFLAGS) $(LDFLAGS)
109 PY_LDFLAGS_NODIST=$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)
110 PY_LDFLAGS_NOLTO=$(PY_LDFLAGS) $(CONFIGURE_LDFLAGS_NOLTO) $(LDFLAGS_NODIST)
111 NO_AS_NEEDED= @NO_AS_NEEDED@
112 CCSHARED= @CCSHARED@
113 # LINKFORSHARED are the flags passed to the $(CC) command that links
114 # the python executable -- this is only needed for a few systems
115 LINKFORSHARED= @LINKFORSHARED@
116 ARFLAGS= @ARFLAGS@
117 # Extra C flags added for building the interpreter object files.
118 CFLAGSFORSHARED=@CFLAGSFORSHARED@
119 # C flags used for building the interpreter object files
120 PY_STDMODULE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED)
121 PY_BUILTIN_MODULE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN
122 PY_CORE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE
123 # Linker flags used for building the interpreter object files
124 PY_CORE_LDFLAGS=$(PY_LDFLAGS) $(PY_LDFLAGS_NODIST)
125 # Strict or non-strict aliasing flags used to compile dtoa.c, see above
126 CFLAGS_ALIASING=@CFLAGS_ALIASING@
127
128
129 # Machine-dependent subdirectories
130 MACHDEP= @MACHDEP@
131
132 # Multiarch directory (may be empty)
133 MULTIARCH= @MULTIARCH@
134 MULTIARCH_CPPFLAGS = @MULTIARCH_CPPFLAGS@
135
136 # Install prefix for architecture-independent files
137 prefix= @prefix@
138
139 # Install prefix for architecture-dependent files
140 exec_prefix= @exec_prefix@
141
142 # Install prefix for data files
143 datarootdir= @datarootdir@
144
145 # Expanded directories
146 BINDIR= @bindir@
147 LIBDIR= @libdir@
148 MANDIR= @mandir@
149 INCLUDEDIR= @includedir@
150 CONFINCLUDEDIR= $(exec_prefix)/include
151 PLATLIBDIR= @PLATLIBDIR@
152 SCRIPTDIR= $(prefix)/$(PLATLIBDIR)
153 ABIFLAGS= @ABIFLAGS@
154 # executable name for shebangs
155 EXENAME= $(BINDIR)/python$(LDVERSION)$(EXE)
156 # Variable used by ensurepip
157 WHEEL_PKG_DIR= @WHEEL_PKG_DIR@
158
159 # Detailed destination directories
160 BINLIBDEST= @BINLIBDEST@
161 LIBDEST= $(SCRIPTDIR)/python$(VERSION)
162 INCLUDEPY= $(INCLUDEDIR)/python$(LDVERSION)
163 CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION)
164
165 # Symbols used for using shared libraries
166 SHLIB_SUFFIX= @SHLIB_SUFFIX@
167 EXT_SUFFIX= @EXT_SUFFIX@
168 LDSHARED= @LDSHARED@ $(PY_LDFLAGS)
169 BLDSHARED= @BLDSHARED@ $(PY_CORE_LDFLAGS)
170 LDCXXSHARED= @LDCXXSHARED@
171 DESTSHARED= $(BINLIBDEST)/lib-dynload
172
173 # List of exported symbols for AIX
174 EXPORTSYMS= @EXPORTSYMS@
175 EXPORTSFROM= @EXPORTSFROM@
176
177 # Executable suffix (.exe on Windows and Mac OS X)
178 EXE= @EXEEXT@
179 BUILDEXE= @BUILDEXEEXT@
180
181 # Short name and location for Mac OS X Python framework
182 UNIVERSALSDK=@UNIVERSALSDK@
183 PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
184 PYTHONFRAMEWORKDIR= @PYTHONFRAMEWORKDIR@
185 PYTHONFRAMEWORKPREFIX= @PYTHONFRAMEWORKPREFIX@
186 PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
187 PYTHONFRAMEWORKINSTALLNAMEPREFIX= @PYTHONFRAMEWORKINSTALLNAMEPREFIX@
188 RESSRCDIR= @RESSRCDIR@
189 # macOS deployment target selected during configure, to be checked
190 # by distutils. The export statement is needed to ensure that the
191 # deployment target is active during build.
192 MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
193 @EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
194
195 # iOS Deployment target selected during configure. Unlike macOS, the iOS
196 # deployment target is controlled using `-mios-version-min` arguments added to
197 # CFLAGS and LDFLAGS by the configure script. This variable is not used during
198 # the build, and is only listed here so it will be included in sysconfigdata.
199 IPHONEOS_DEPLOYMENT_TARGET=@IPHONEOS_DEPLOYMENT_TARGET@
200
201 # Option to install to strip binaries
202 STRIPFLAG=-s
203
204 # Flags to lipo to produce a 32-bit-only universal executable
205 LIPO_32BIT_FLAGS=@LIPO_32BIT_FLAGS@
206
207 # Flags to lipo to produce an intel-64-only universal executable
208 LIPO_INTEL64_FLAGS=@LIPO_INTEL64_FLAGS@
209
210 # Environment to run shared python without installed libraries
211 RUNSHARED= @RUNSHARED@
212
213 # ensurepip options
214 ENSUREPIP= @ENSUREPIP@
215
216 # Internal static libraries
217 LIBMPDEC_A= Modules/_decimal/libmpdec/libmpdec.a
218 LIBEXPAT_A= Modules/expat/libexpat.a
219 LIBHACL_SHA2_A= Modules/_hacl/libHacl_Hash_SHA2.a
220
221 # Module state, compiler flags and linker flags
222 # Empty CFLAGS and LDFLAGS are omitted.
223 # states:
224 # * yes: module is available
225 # * missing: build dependency is missing
226 # * disabled: module is disabled
227 # * n/a: module is not available on the current platform
228 # MODULE_EGG_STATE=yes # yes, missing, disabled, n/a
229 # MODULE_EGG_CFLAGS=
230 # MODULE_EGG_LDFLAGS=
231 @MODULE_BLOCK@
232
233 # Default zoneinfo.TZPATH. Added here to expose it in sysconfig.get_config_var
234 TZPATH=@TZPATH@
235
236 # Modes for directories, executables and data files created by the
237 # install process. Default to user-only-writable for all file types.
238 DIRMODE= 755
239 EXEMODE= 755
240 FILEMODE= 644
241
242 # configure script arguments
243 CONFIG_ARGS= @CONFIG_ARGS@
244
245
246 # Subdirectories with code
247 SRCDIRS= @SRCDIRS@
248
249 # Other subdirectories
250 SUBDIRSTOO= Include Lib Misc
251
252 # assets for Emscripten browser builds
253 WASM_ASSETS_DIR=.$(prefix)
254 WASM_STDLIB=$(WASM_ASSETS_DIR)/lib/python$(VERSION)/os.py
255
256 # Files and directories to be distributed
257 CONFIGFILES= configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in
258 DISTFILES= README.rst ChangeLog $(CONFIGFILES)
259 DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
260 DIST= $(DISTFILES) $(DISTDIRS)
261
262
263 LIBRARY= @LIBRARY@
264 LDLIBRARY= @LDLIBRARY@
265 BLDLIBRARY= @BLDLIBRARY@
266 PY3LIBRARY= @PY3LIBRARY@
267 DLLLIBRARY= @DLLLIBRARY@
268 LDLIBRARYDIR= @LDLIBRARYDIR@
269 INSTSONAME= @INSTSONAME@
270 LIBRARY_DEPS= @LIBRARY_DEPS@
271 LINK_PYTHON_DEPS=@LINK_PYTHON_DEPS@
272 PY_ENABLE_SHARED= @PY_ENABLE_SHARED@
273 STATIC_LIBPYTHON= @STATIC_LIBPYTHON@
274
275
276 LIBS= @LIBS@
277 LIBM= @LIBM@
278 LIBC= @LIBC@
279 SYSLIBS= $(LIBM) $(LIBC)
280 SHLIBS= @SHLIBS@
281
282 DLINCLDIR= @DLINCLDIR@
283 DYNLOADFILE= @DYNLOADFILE@
284 MACHDEP_OBJS= @MACHDEP_OBJS@
285 LIBOBJDIR= Python/
286 LIBOBJS= @LIBOBJS@
287
288 PYTHON= python$(EXE)
289 BUILDPYTHON= python$(BUILDEXE)
290
291 HOSTRUNNER= @HOSTRUNNER@
292
293 PYTHON_FOR_REGEN?=@PYTHON_FOR_REGEN@
294 UPDATE_FILE=$(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/update_file.py
295 PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
296 # Single-platform builds depend on $(BUILDPYTHON). Cross builds use an
297 # external "build Python" and have an empty PYTHON_FOR_BUILD_DEPS.
298 PYTHON_FOR_BUILD_DEPS=@PYTHON_FOR_BUILD_DEPS@
299
300 # Single-platform builds use Programs/_freeze_module.c for bootstrapping and
301 # ./_bootstrap_python Programs/_freeze_module.py for remaining modules
302 # Cross builds use an external "build Python" for all modules.
303 PYTHON_FOR_FREEZE=@PYTHON_FOR_FREEZE@
304 FREEZE_MODULE_BOOTSTRAP=@FREEZE_MODULE_BOOTSTRAP@
305 FREEZE_MODULE_BOOTSTRAP_DEPS=@FREEZE_MODULE_BOOTSTRAP_DEPS@
306 FREEZE_MODULE=@FREEZE_MODULE@
307 FREEZE_MODULE_DEPS=@FREEZE_MODULE_DEPS@
308
309 _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
310 BUILD_GNU_TYPE= @build@
311 HOST_GNU_TYPE= @host@
312
313 # The task to run while instrumented when building the profile-opt target.
314 # To speed up profile generation, we don't run the full unit test suite
315 # by default. The default is "-m test --pgo". To run more tests, use
316 # PROFILE_TASK="-m test --pgo-extended"
317 PROFILE_TASK= @PROFILE_TASK@
318
319 # report files for gcov / lcov coverage report
320 COVERAGE_INFO= $(abs_builddir)/coverage.info
321 COVERAGE_REPORT=$(abs_builddir)/lcov-report
322 COVERAGE_LCOV_OPTIONS=--rc lcov_branch_coverage=1
323 COVERAGE_REPORT_OPTIONS=--rc lcov_branch_coverage=1 --branch-coverage --title "CPython $(VERSION) LCOV report [commit $(shell $(GITVERSION))]"
324
325
326 # === Definitions added by makesetup ===
327
328
329 ##########################################################################
330 # Modules
331 MODULE_OBJS= \
332 Modules/config.o \
333 Modules/main.o \
334 Modules/gcmodule.o
335
336 IO_H= Modules/_io/_iomodule.h
337
338 IO_OBJS= \
339 Modules/_io/_iomodule.o \
340 Modules/_io/iobase.o \
341 Modules/_io/fileio.o \
342 Modules/_io/bufferedio.o \
343 Modules/_io/textio.o \
344 Modules/_io/bytesio.o \
345 Modules/_io/stringio.o
346
347
348 ##########################################################################
349 # mimalloc
350
351 MIMALLOC_HEADERS= \
352 $(srcdir)/Include/internal/pycore_mimalloc.h \
353 $(srcdir)/Include/internal/mimalloc/mimalloc.h \
354 $(srcdir)/Include/internal/mimalloc/mimalloc/atomic.h \
355 $(srcdir)/Include/internal/mimalloc/mimalloc/internal.h \
356 $(srcdir)/Include/internal/mimalloc/mimalloc/prim.h \
357 $(srcdir)/Include/internal/mimalloc/mimalloc/track.h \
358 $(srcdir)/Include/internal/mimalloc/mimalloc/types.h
359
360
361 ##########################################################################
362 # Parser
363
364 PEGEN_OBJS= \
365 Parser/pegen.o \
366 Parser/pegen_errors.o \
367 Parser/action_helpers.o \
368 Parser/parser.o \
369 Parser/string_parser.o \
370 Parser/peg_api.o
371
372 TOKENIZER_OBJS= \
373 Parser/lexer/buffer.o \
374 Parser/lexer/lexer.o \
375 Parser/lexer/state.o \
376 Parser/tokenizer/file_tokenizer.o \
377 Parser/tokenizer/readline_tokenizer.o \
378 Parser/tokenizer/string_tokenizer.o \
379 Parser/tokenizer/utf8_tokenizer.o \
380 Parser/tokenizer/helpers.o
381
382 PEGEN_HEADERS= \
383 $(srcdir)/Include/internal/pycore_parser.h \
384 $(srcdir)/Parser/pegen.h \
385 $(srcdir)/Parser/string_parser.h
386
387 TOKENIZER_HEADERS= \
388 Parser/lexer/buffer.h \
389 Parser/lexer/lexer.h \
390 Parser/lexer/state.h \
391 Parser/tokenizer/tokenizer.h \
392 Parser/tokenizer/helpers.h
393
394 POBJS= \
395 Parser/token.o \
396
397 PARSER_OBJS= $(POBJS) $(PEGEN_OBJS) $(TOKENIZER_OBJS) Parser/myreadline.o
398
399 PARSER_HEADERS= \
400 $(PEGEN_HEADERS) \
401 $(TOKENIZER_HEADERS)
402
403 ##########################################################################
404 # Python
405
406 PYTHON_OBJS= \
407 Python/_warnings.o \
408 Python/Python-ast.o \
409 Python/Python-tokenize.o \
410 Python/asdl.o \
411 Python/assemble.o \
412 Python/ast.o \
413 Python/ast_opt.o \
414 Python/ast_unparse.o \
415 Python/bltinmodule.o \
416 Python/brc.o \
417 Python/ceval.o \
418 Python/codecs.o \
419 Python/compile.o \
420 Python/context.o \
421 Python/critical_section.o \
422 Python/crossinterp.o \
423 Python/dynamic_annotations.o \
424 Python/errors.o \
425 Python/flowgraph.o \
426 Python/frame.o \
427 Python/frozenmain.o \
428 Python/future.o \
429 Python/gc.o \
430 Python/gc_free_threading.o \
431 Python/gc_gil.o \
432 Python/getargs.o \
433 Python/getcompiler.o \
434 Python/getcopyright.o \
435 Python/getplatform.o \
436 Python/getversion.o \
437 Python/ceval_gil.o \
438 Python/hamt.o \
439 Python/hashtable.o \
440 Python/import.o \
441 Python/importdl.o \
442 Python/initconfig.o \
443 Python/interpconfig.o \
444 Python/instrumentation.o \
445 Python/instruction_sequence.o \
446 Python/intrinsics.o \
447 Python/jit.o \
448 Python/legacy_tracing.o \
449 Python/lock.o \
450 Python/marshal.o \
451 Python/modsupport.o \
452 Python/mysnprintf.o \
453 Python/mystrtoul.o \
454 Python/object_stack.o \
455 Python/optimizer.o \
456 Python/optimizer_analysis.o \
457 Python/optimizer_symbols.o \
458 Python/parking_lot.o \
459 Python/pathconfig.o \
460 Python/preconfig.o \
461 Python/pyarena.o \
462 Python/pyctype.o \
463 Python/pyfpe.o \
464 Python/pyhash.o \
465 Python/pylifecycle.o \
466 Python/pymath.o \
467 Python/pystate.o \
468 Python/pythonrun.o \
469 Python/pytime.o \
470 Python/qsbr.o \
471 Python/bootstrap_hash.o \
472 Python/specialize.o \
473 Python/structmember.o \
474 Python/symtable.o \
475 Python/sysmodule.o \
476 Python/thread.o \
477 Python/traceback.o \
478 Python/tracemalloc.o \
479 Python/getopt.o \
480 Python/pystrcmp.o \
481 Python/pystrtod.o \
482 Python/pystrhex.o \
483 Python/dtoa.o \
484 Python/formatter_unicode.o \
485 Python/fileutils.o \
486 Python/suggestions.o \
487 Python/perf_trampoline.o \
488 Python/$(DYNLOADFILE) \
489 $(LIBOBJS) \
490 $(MACHDEP_OBJS) \
491 $(DTRACE_OBJS) \
492 @PLATFORM_OBJS@
493
494
495 ##########################################################################
496 # Objects
497 OBJECT_OBJS= \
498 Objects/abstract.o \
499 Objects/boolobject.o \
500 Objects/bytes_methods.o \
501 Objects/bytearrayobject.o \
502 Objects/bytesobject.o \
503 Objects/call.o \
504 Objects/capsule.o \
505 Objects/cellobject.o \
506 Objects/classobject.o \
507 Objects/codeobject.o \
508 Objects/complexobject.o \
509 Objects/descrobject.o \
510 Objects/enumobject.o \
511 Objects/exceptions.o \
512 Objects/genericaliasobject.o \
513 Objects/genobject.o \
514 Objects/fileobject.o \
515 Objects/floatobject.o \
516 Objects/frameobject.o \
517 Objects/funcobject.o \
518 Objects/iterobject.o \
519 Objects/listobject.o \
520 Objects/longobject.o \
521 Objects/dictobject.o \
522 Objects/odictobject.o \
523 Objects/memoryobject.o \
524 Objects/methodobject.o \
525 Objects/moduleobject.o \
526 Objects/namespaceobject.o \
527 Objects/object.o \
528 Objects/obmalloc.o \
529 Objects/picklebufobject.o \
530 Objects/rangeobject.o \
531 Objects/setobject.o \
532 Objects/sliceobject.o \
533 Objects/structseq.o \
534 Objects/tupleobject.o \
535 Objects/typeobject.o \
536 Objects/typevarobject.o \
537 Objects/unicodeobject.o \
538 Objects/unicodectype.o \
539 Objects/unionobject.o \
540 Objects/weakrefobject.o \
541 @PERF_TRAMPOLINE_OBJ@
542
543 ##########################################################################
544 # objects that get linked into the Python library
545 LIBRARY_OBJS_OMIT_FROZEN= \
546 Modules/getbuildinfo.o \
547 $(PARSER_OBJS) \
548 $(OBJECT_OBJS) \
549 $(PYTHON_OBJS) \
550 $(MODULE_OBJS) \
551 $(MODOBJS)
552
553 LIBRARY_OBJS= \
554 $(LIBRARY_OBJS_OMIT_FROZEN) \
555 Modules/getpath.o \
556 Python/frozen.o
557
558 LINK_PYTHON_OBJS=@LINK_PYTHON_OBJS@
559
560 ##########################################################################
561 # DTrace
562
563 # On some systems, object files that reference DTrace probes need to be modified
564 # in-place by dtrace(1).
565 DTRACE_DEPS = \
566 Python/ceval.o Python/gc.o Python/import.o Python/sysmodule.o
567
568 ##########################################################################
569 # decimal's libmpdec
570
571 LIBMPDEC_OBJS= \
572 Modules/_decimal/libmpdec/basearith.o \
573 Modules/_decimal/libmpdec/constants.o \
574 Modules/_decimal/libmpdec/context.o \
575 Modules/_decimal/libmpdec/convolute.o \
576 Modules/_decimal/libmpdec/crt.o \
577 Modules/_decimal/libmpdec/difradix2.o \
578 Modules/_decimal/libmpdec/fnt.o \
579 Modules/_decimal/libmpdec/fourstep.o \
580 Modules/_decimal/libmpdec/io.o \
581 Modules/_decimal/libmpdec/mpalloc.o \
582 Modules/_decimal/libmpdec/mpdecimal.o \
583 Modules/_decimal/libmpdec/numbertheory.o \
584 Modules/_decimal/libmpdec/sixstep.o \
585 Modules/_decimal/libmpdec/transpose.o
586 # _decimal does not use signaling API
587 # Modules/_decimal/libmpdec/mpsignal.o
588
589 LIBMPDEC_HEADERS= \
590 $(srcdir)/Modules/_decimal/libmpdec/basearith.h \
591 $(srcdir)/Modules/_decimal/libmpdec/bits.h \
592 $(srcdir)/Modules/_decimal/libmpdec/constants.h \
593 $(srcdir)/Modules/_decimal/libmpdec/convolute.h \
594 $(srcdir)/Modules/_decimal/libmpdec/crt.h \
595 $(srcdir)/Modules/_decimal/libmpdec/difradix2.h \
596 $(srcdir)/Modules/_decimal/libmpdec/fnt.h \
597 $(srcdir)/Modules/_decimal/libmpdec/fourstep.h \
598 $(srcdir)/Modules/_decimal/libmpdec/io.h \
599 $(srcdir)/Modules/_decimal/libmpdec/mpalloc.h \
600 $(srcdir)/Modules/_decimal/libmpdec/mpdecimal.h \
601 $(srcdir)/Modules/_decimal/libmpdec/numbertheory.h \
602 $(srcdir)/Modules/_decimal/libmpdec/sixstep.h \
603 $(srcdir)/Modules/_decimal/libmpdec/transpose.h \
604 $(srcdir)/Modules/_decimal/libmpdec/typearith.h \
605 $(srcdir)/Modules/_decimal/libmpdec/umodarith.h
606
607 ##########################################################################
608 # pyexpat's expat library
609
610 LIBEXPAT_OBJS= \
611 Modules/expat/xmlparse.o \
612 Modules/expat/xmlrole.o \
613 Modules/expat/xmltok.o
614
615 LIBEXPAT_HEADERS= \
616 Modules/expat/ascii.h \
617 Modules/expat/asciitab.h \
618 Modules/expat/expat.h \
619 Modules/expat/expat_config.h \
620 Modules/expat/expat_external.h \
621 Modules/expat/iasciitab.h \
622 Modules/expat/internal.h \
623 Modules/expat/latin1tab.h \
624 Modules/expat/nametab.h \
625 Modules/expat/pyexpatns.h \
626 Modules/expat/siphash.h \
627 Modules/expat/utf8tab.h \
628 Modules/expat/xmlrole.h \
629 Modules/expat/xmltok.h \
630 Modules/expat/xmltok_impl.h
631
632 ##########################################################################
633 # hashlib's HACL* library
634
635 LIBHACL_SHA2_OBJS= \
636 Modules/_hacl/Hacl_Hash_SHA2.o
637
638 LIBHACL_HEADERS= \
639 Modules/_hacl/include/krml/FStar_UInt128_Verified.h \
640 Modules/_hacl/include/krml/FStar_UInt_8_16_32_64.h \
641 Modules/_hacl/include/krml/fstar_uint128_struct_endianness.h \
642 Modules/_hacl/include/krml/internal/target.h \
643 Modules/_hacl/include/krml/lowstar_endianness.h \
644 Modules/_hacl/include/krml/types.h \
645 Modules/_hacl/Hacl_Streaming_Types.h \
646 Modules/_hacl/python_hacl_namespaces.h
647
648 LIBHACL_SHA2_HEADERS= \
649 Modules/_hacl/Hacl_Hash_SHA2.h \
650 Modules/_hacl/internal/Hacl_Hash_SHA2.h \
651 $(LIBHACL_HEADERS)
652
653 #########################################################################
654 # Rules
655
656 # Default target
657 all: @DEF_MAKE_ALL_RULE@
658
659 # First target in Makefile is implicit default. So .PHONY needs to come after
660 # all.
661 .PHONY: all
662
663 # Provide quick help for common Makefile targets.
664 .PHONY: help
665 help:
666 @echo "Run 'make' to build the Python executable and extension modules"
667 @echo ""
668 @echo "or 'make <target>' where <target> is one of:"
669 @echo " test run the test suite"
670 @echo " install install built files"
671 @echo " regen-all regenerate a number of generated source files"
672 @echo " clinic run Argument Clinic over source files"
673 @echo ""
674 @echo " clean to remove build files"
675 @echo " distclean 'clean' + remove other generated files (patch, exe, etc)"
676 @echo ""
677 @echo " recheck rerun configure with last cmdline options"
678 @echo " reindent reindent .py files in Lib directory"
679 @echo " tags build a tags file (useful for Emacs and other editors)"
680 @echo " list-targets list all targets in the Makefile"
681
682 # Display a full list of Makefile targets
683 .PHONY: list-targets
684 list-targets:
685 @grep -E '^[A-Za-z][-A-Za-z0-9]+:' Makefile | awk -F : '{print $$1}'
686
687 .PHONY: build_all
688 build_all: check-clean-src $(BUILDPYTHON) platform sharedmods \
689 gdbhooks Programs/_testembed scripts checksharedmods rundsymutil
690
691 .PHONY: build_wasm
692 build_wasm: check-clean-src $(BUILDPYTHON) platform sharedmods \
693 python-config checksharedmods
694
695 # Check that the source is clean when building out of source.
696 .PHONY: check-clean-src
697 check-clean-src:
698 @if test -n "$(VPATH)" -a \( \
699 -f "$(srcdir)/$(BUILDPYTHON)" \
700 -o -f "$(srcdir)/Programs/python.o" \
701 -o -f "$(srcdir)/Python/frozen_modules/importlib._bootstrap.h" \
702 \); then \
703 echo "Error: The source directory ($(srcdir)) is not clean" ; \
704 echo "Building Python out of the source tree (in $(abs_builddir)) requires a clean source tree ($(abs_srcdir))" ; \
705 echo "Build artifacts such as .o files, executables, and Python/frozen_modules/*.h must not exist within $(srcdir)." ; \
706 echo "Try to run:" ; \
707 echo " (cd \"$(srcdir)\" && make clean || git clean -fdx -e Doc/venv)" ; \
708 exit 1; \
709 fi
710
711 # Profile generation build must start from a clean tree.
712 profile-clean-stamp:
713 $(MAKE) clean
714 touch $@
715
716 # Compile with profile generation enabled.
717 profile-gen-stamp: profile-clean-stamp
718 @if [ $(LLVM_PROF_ERR) = yes ]; then \
719 echo "Error: Cannot perform PGO build because llvm-profdata was not found in PATH" ;\
720 echo "Please add it to PATH and run ./configure again" ;\
721 exit 1;\
722 fi
723 @echo "Building with support for profile generation:"
724 $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
725 touch $@
726
727 # Run task with profile generation build to create profile information.
728 profile-run-stamp:
729 @echo "Running code to generate profile data (this can take a while):"
730 # First, we need to create a clean build with profile generation
731 # enabled.
732 $(MAKE) profile-gen-stamp
733 # Next, run the profile task to generate the profile information.
734 @ # FIXME: can't run for a cross build
735 $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK)
736 $(LLVM_PROF_MERGER)
737 # Remove profile generation binary since we are done with it.
738 $(MAKE) clean-retain-profile
739 # This is an expensive target to build and it does not have proper
740 # makefile dependency information. So, we create a "stamp" file
741 # to record its completion and avoid re-running it.
742 touch $@
743
744 # Compile Python binary with profile guided optimization.
745 # To force re-running of the profile task, remove the profile-run-stamp file.
746 .PHONY: profile-opt
747 profile-opt: profile-run-stamp
748 @echo "Rebuilding with profile guided optimizations:"
749 -rm -f profile-clean-stamp
750 $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_USE_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST)"
751
752 # List of binaries that BOLT runs on.
753 BOLT_BINARIES := @BOLT_BINARIES@
754
755 BOLT_INSTRUMENT_FLAGS := @BOLT_INSTRUMENT_FLAGS@
756 BOLT_APPLY_FLAGS := @BOLT_APPLY_FLAGS@
757
758 .PHONY: clean-bolt
759 clean-bolt:
760 # Profile data.
761 rm -f *.fdata
762 # Pristine binaries before BOLT optimization.
763 rm -f *.prebolt
764 # BOLT instrumented binaries.
765 rm -f *.bolt_inst
766
767 profile-bolt-stamp: $(BUILDPYTHON)
768 # Ensure a pristine, pre-BOLT copy of the binary and no profile data from last run.
769 for bin in $(BOLT_BINARIES); do \
770 prebolt="$${bin}.prebolt"; \
771 if [ -e "$${prebolt}" ]; then \
772 echo "Restoring pre-BOLT binary $${prebolt}"; \
773 mv "$${bin}.prebolt" "$${bin}"; \
774 fi; \
775 cp "$${bin}" "$${prebolt}"; \
776 rm -f $${bin}.bolt.*.fdata $${bin}.fdata; \
777 done
778 # Instrument each binary.
779 for bin in $(BOLT_BINARIES); do \
780 @LLVM_BOLT@ "$${bin}" -instrument -instrumentation-file-append-pid -instrumentation-file=$(abspath $${bin}.bolt) -o $${bin}.bolt_inst $(BOLT_INSTRUMENT_FLAGS); \
781 mv "$${bin}.bolt_inst" "$${bin}"; \
782 done
783 # Run instrumented binaries to collect data.
784 $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK)
785 # Merge all the data files together.
786 for bin in $(BOLT_BINARIES); do \
787 @MERGE_FDATA@ $${bin}.*.fdata > "$${bin}.fdata"; \
788 rm -f $${bin}.*.fdata; \
789 done
790 # Run bolt against the merged data to produce an optimized binary.
791 for bin in $(BOLT_BINARIES); do \
792 @LLVM_BOLT@ "$${bin}.prebolt" -o "$${bin}.bolt" -data="$${bin}.fdata" $(BOLT_APPLY_FLAGS); \
793 mv "$${bin}.bolt" "$${bin}"; \
794 done
795 touch $@
796
797 .PHONY: bolt-opt
798 bolt-opt:
799 $(MAKE) @PREBOLT_RULE@
800 $(MAKE) profile-bolt-stamp
801
802 # Compile and run with gcov
803 .PHONY: coverage
804 coverage:
805 @echo "Building with support for coverage checking:"
806 $(MAKE) clean
807 $(MAKE) @DEF_MAKE_RULE@ CFLAGS="$(CFLAGS) -O0 -pg --coverage" LDFLAGS="$(LDFLAGS) --coverage"
808
809 .PHONY: coverage-lcov
810 coverage-lcov:
811 @echo "Creating Coverage HTML report with LCOV:"
812 @rm -f $(COVERAGE_INFO)
813 @rm -rf $(COVERAGE_REPORT)
814 @lcov $(COVERAGE_LCOV_OPTIONS) --capture \
815 --directory $(abs_builddir) \
816 --base-directory $(realpath $(abs_builddir)) \
817 --path $(realpath $(abs_srcdir)) \
818 --output-file $(COVERAGE_INFO)
819 @ # remove 3rd party modules, system headers and internal files with
820 @ # debug, test or dummy functions.
821 @lcov $(COVERAGE_LCOV_OPTIONS) --remove $(COVERAGE_INFO) \
822 '*/Modules/_blake2/impl/*' \
823 '*/Modules/_ctypes/libffi*/*' \
824 '*/Modules/_decimal/libmpdec/*' \
825 '*/Modules/expat/*' \
826 '*/Modules/xx*.c' \
827 '*/Python/pyfpe.c' \
828 '*/Python/pystrcmp.c' \
829 '/usr/include/*' \
830 '/usr/local/include/*' \
831 '/usr/lib/gcc/*' \
832 --output-file $(COVERAGE_INFO)
833 @genhtml $(COVERAGE_INFO) \
834 --output-directory $(COVERAGE_REPORT) \
835 $(COVERAGE_REPORT_OPTIONS)
836 @echo
837 @echo "lcov report at $(COVERAGE_REPORT)/index.html"
838 @echo
839
840 # Force regeneration of parser and frozen modules
841 .PHONY: coverage-report
842 coverage-report: regen-token regen-frozen
843 @ # build with coverage info
844 $(MAKE) coverage
845 @ # run tests, ignore failures
846 $(TESTRUNNER) --fast-ci --timeout=$(TESTTIMEOUT) $(TESTOPTS) || true
847 @ # build lcov report
848 $(MAKE) coverage-lcov
849
850 # Run "Argument Clinic" over all source files
851 .PHONY: clinic
852 clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c
853 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --exclude Lib/test/clinic.test.c --srcdir $(srcdir)
854
855 .PHONY: clinic-tests
856 clinic-tests: check-clean-src $(srcdir)/Lib/test/clinic.test.c
857 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py -f $(srcdir)/Lib/test/clinic.test.c
858
859 # Build the interpreter
860 $(BUILDPYTHON): Programs/python.o $(LINK_PYTHON_DEPS)
861 $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS)
862
863 platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt
864 $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
865
866 # Create build directory and generate the sysconfig build-time data there.
867 # pybuilddir.txt contains the name of the build dir and is used for
868 # sys.path fixup -- see Modules/getpath.c.
869 # Since this step runs before shared modules are built, try to avoid bootstrap
870 # problems by creating a dummy pybuilddir.txt just to allow interpreter
871 # initialization to succeed. It will be overwritten by generate-posix-vars
872 # or removed in case of failure.
873 pybuilddir.txt: $(PYTHON_FOR_BUILD_DEPS)
874 @echo "none" > ./pybuilddir.txt
875 $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
876 if test $$? -ne 0 ; then \
877 echo "generate-posix-vars failed" ; \
878 rm -f ./pybuilddir.txt ; \
879 exit 1 ; \
880 fi
881
882 # blake2s is auto-generated from blake2b
883 $(srcdir)/Modules/_blake2/blake2s_impl.c: $(srcdir)/Modules/_blake2/blake2b_impl.c $(srcdir)/Modules/_blake2/blake2b2s.py
884 $(PYTHON_FOR_REGEN) $(srcdir)/Modules/_blake2/blake2b2s.py
885 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py -f $@
886
887 # Build static library
888 $(LIBRARY): $(LIBRARY_OBJS)
889 -rm -f $@
890 $(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS)
891
892 libpython$(LDVERSION).so: $(LIBRARY_OBJS) $(DTRACE_OBJS)
893 $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM)
894 if test $(INSTSONAME) != $@; then \
895 $(LN) -f $(INSTSONAME) $@; \
896 fi
897
898 libpython3.so: libpython$(LDVERSION).so
899 $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^
900
901 libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
902 $(CC) -dynamiclib $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
903
904
905 libpython$(VERSION).sl: $(LIBRARY_OBJS)
906 $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM)
907
908 # List of exported symbols for AIX
909 Modules/python.exp: $(LIBRARY)
910 $(srcdir)/Modules/makexp_aix $@ "$(EXPORTSFROM)" $?
911
912 # Copy up the gdb python hooks into a position where they can be automatically
913 # loaded by gdb during Lib/test/test_gdb.py
914 #
915 # Distributors are likely to want to install this somewhere else e.g. relative
916 # to the stripped DWARF data for the shared library.
917 .PHONY: gdbhooks
918 gdbhooks: $(BUILDPYTHON)-gdb.py
919
920 SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py
921 $(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS)
922 $(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py
923
924 # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
925 # minimal framework (not including the Lib directory and such) in the current
926 # directory.
927 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
928 $(LIBRARY) \
929 $(RESSRCDIR)/Info.plist
930 $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
931 $(CC) -o $(LDLIBRARY) $(PY_CORE_LDFLAGS) -dynamiclib \
932 -all_load $(LIBRARY) \
933 -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLNAMEPREFIX)/$(PYTHONFRAMEWORK) \
934 -compatibility_version $(VERSION) \
935 -current_version $(VERSION) \
936 -framework CoreFoundation $(LIBS);
937 $(INSTALL) -d -m $(DIRMODE) \
938 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
939 $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
940 $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
941 $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
942 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
943 $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
944
945 # This rule is for iOS, which requires an annoyingly just slighly different
946 # format for frameworks to macOS. It *doesn't* use a versioned framework, and
947 # the Info.plist must be in the root of the framework.
948 $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK): \
949 $(LIBRARY) \
950 $(RESSRCDIR)/Info.plist
951 $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)
952 $(CC) -o $(LDLIBRARY) $(PY_CORE_LDFLAGS) -dynamiclib \
953 -all_load $(LIBRARY) \
954 -install_name $(PYTHONFRAMEWORKINSTALLNAMEPREFIX)/$(PYTHONFRAMEWORK) \
955 -compatibility_version $(VERSION) \
956 -current_version $(VERSION) \
957 -framework CoreFoundation $(LIBS);
958 $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(PYTHONFRAMEWORKDIR)/Info.plist
959
960 # This rule builds the Cygwin Python DLL and import library if configured
961 # for a shared core library; otherwise, this rule is a noop.
962 $(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS)
963 if test -n "$(DLLLIBRARY)"; then \
964 $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
965 $(LIBS) $(MODLIBS) $(SYSLIBS); \
966 else true; \
967 fi
968
969 # wasm32-emscripten browser build
970 # wasm assets directory is relative to current build dir, e.g. "./usr/local".
971 # --preload-file turns a relative asset path into an absolute path.
972
973 .PHONY: wasm_stdlib
974 wasm_stdlib: $(WASM_STDLIB)
975 $(WASM_STDLIB): $(srcdir)/Lib/*.py $(srcdir)/Lib/*/*.py \
976 $(srcdir)/Tools/wasm/wasm_assets.py \
977 Makefile pybuilddir.txt Modules/Setup.local
978 $(PYTHON_FOR_BUILD) $(srcdir)/Tools/wasm/wasm_assets.py \
979 --buildroot . --prefix $(prefix)
980
981 python.html: $(srcdir)/Tools/wasm/python.html python.worker.js
982 @cp $(srcdir)/Tools/wasm/python.html $@
983
984 python.worker.js: $(srcdir)/Tools/wasm/python.worker.js
985 @cp $(srcdir)/Tools/wasm/python.worker.js $@
986
987 ############################################################################
988 # Header files
989
990 PYTHON_HEADERS= \
991 $(srcdir)/Include/Python.h \
992 $(srcdir)/Include/abstract.h \
993 $(srcdir)/Include/bltinmodule.h \
994 $(srcdir)/Include/boolobject.h \
995 $(srcdir)/Include/bytearrayobject.h \
996 $(srcdir)/Include/bytesobject.h \
997 $(srcdir)/Include/ceval.h \
998 $(srcdir)/Include/codecs.h \
999 $(srcdir)/Include/compile.h \
1000 $(srcdir)/Include/complexobject.h \
1001 $(srcdir)/Include/descrobject.h \
1002 $(srcdir)/Include/dictobject.h \
1003 $(srcdir)/Include/dynamic_annotations.h \
1004 $(srcdir)/Include/enumobject.h \
1005 $(srcdir)/Include/errcode.h \
1006 $(srcdir)/Include/exports.h \
1007 $(srcdir)/Include/fileobject.h \
1008 $(srcdir)/Include/fileutils.h \
1009 $(srcdir)/Include/floatobject.h \
1010 $(srcdir)/Include/frameobject.h \
1011 $(srcdir)/Include/genericaliasobject.h \
1012 $(srcdir)/Include/import.h \
1013 $(srcdir)/Include/intrcheck.h \
1014 $(srcdir)/Include/iterobject.h \
1015 $(srcdir)/Include/listobject.h \
1016 $(srcdir)/Include/longobject.h \
1017 $(srcdir)/Include/marshal.h \
1018 $(srcdir)/Include/memoryobject.h \
1019 $(srcdir)/Include/methodobject.h \
1020 $(srcdir)/Include/modsupport.h \
1021 $(srcdir)/Include/moduleobject.h \
1022 $(srcdir)/Include/object.h \
1023 $(srcdir)/Include/objimpl.h \
1024 $(srcdir)/Include/opcode.h \
1025 $(srcdir)/Include/opcode_ids.h \
1026 $(srcdir)/Include/osdefs.h \
1027 $(srcdir)/Include/osmodule.h \
1028 $(srcdir)/Include/patchlevel.h \
1029 $(srcdir)/Include/pyatomic.h \
1030 $(srcdir)/Include/pybuffer.h \
1031 $(srcdir)/Include/pycapsule.h \
1032 $(srcdir)/Include/pydtrace.h \
1033 $(srcdir)/Include/pyerrors.h \
1034 $(srcdir)/Include/pyexpat.h \
1035 $(srcdir)/Include/pyframe.h \
1036 $(srcdir)/Include/pyhash.h \
1037 $(srcdir)/Include/pylifecycle.h \
1038 $(srcdir)/Include/pymacconfig.h \
1039 $(srcdir)/Include/pymacro.h \
1040 $(srcdir)/Include/pymath.h \
1041 $(srcdir)/Include/pymem.h \
1042 $(srcdir)/Include/pyport.h \
1043 $(srcdir)/Include/pystate.h \
1044 $(srcdir)/Include/pystats.h \
1045 $(srcdir)/Include/pystrcmp.h \
1046 $(srcdir)/Include/pystrtod.h \
1047 $(srcdir)/Include/pythonrun.h \
1048 $(srcdir)/Include/pythread.h \
1049 $(srcdir)/Include/pytypedefs.h \
1050 $(srcdir)/Include/rangeobject.h \
1051 $(srcdir)/Include/setobject.h \
1052 $(srcdir)/Include/sliceobject.h \
1053 $(srcdir)/Include/structmember.h \
1054 $(srcdir)/Include/structseq.h \
1055 $(srcdir)/Include/sysmodule.h \
1056 $(srcdir)/Include/traceback.h \
1057 $(srcdir)/Include/tupleobject.h \
1058 $(srcdir)/Include/typeslots.h \
1059 $(srcdir)/Include/unicodeobject.h \
1060 $(srcdir)/Include/warnings.h \
1061 $(srcdir)/Include/weakrefobject.h \
1062 \
1063 pyconfig.h \
1064 $(PARSER_HEADERS) \
1065 \
1066 $(srcdir)/Include/cpython/abstract.h \
1067 $(srcdir)/Include/cpython/bytearrayobject.h \
1068 $(srcdir)/Include/cpython/bytesobject.h \
1069 $(srcdir)/Include/cpython/cellobject.h \
1070 $(srcdir)/Include/cpython/ceval.h \
1071 $(srcdir)/Include/cpython/classobject.h \
1072 $(srcdir)/Include/cpython/code.h \
1073 $(srcdir)/Include/cpython/compile.h \
1074 $(srcdir)/Include/cpython/complexobject.h \
1075 $(srcdir)/Include/cpython/context.h \
1076 $(srcdir)/Include/cpython/descrobject.h \
1077 $(srcdir)/Include/cpython/dictobject.h \
1078 $(srcdir)/Include/cpython/fileobject.h \
1079 $(srcdir)/Include/cpython/fileutils.h \
1080 $(srcdir)/Include/cpython/floatobject.h \
1081 $(srcdir)/Include/cpython/frameobject.h \
1082 $(srcdir)/Include/cpython/funcobject.h \
1083 $(srcdir)/Include/cpython/genobject.h \
1084 $(srcdir)/Include/cpython/import.h \
1085 $(srcdir)/Include/cpython/initconfig.h \
1086 $(srcdir)/Include/cpython/listobject.h \
1087 $(srcdir)/Include/cpython/longintrepr.h \
1088 $(srcdir)/Include/cpython/longobject.h \
1089 $(srcdir)/Include/cpython/memoryobject.h \
1090 $(srcdir)/Include/cpython/methodobject.h \
1091 $(srcdir)/Include/cpython/object.h \
1092 $(srcdir)/Include/cpython/objimpl.h \
1093 $(srcdir)/Include/cpython/odictobject.h \
1094 $(srcdir)/Include/cpython/optimizer.h \
1095 $(srcdir)/Include/cpython/picklebufobject.h \
1096 $(srcdir)/Include/cpython/pthread_stubs.h \
1097 $(srcdir)/Include/cpython/pyatomic.h \
1098 $(srcdir)/Include/cpython/pyatomic_gcc.h \
1099 $(srcdir)/Include/cpython/pyatomic_std.h \
1100 $(srcdir)/Include/cpython/pyctype.h \
1101 $(srcdir)/Include/cpython/pydebug.h \
1102 $(srcdir)/Include/cpython/pyerrors.h \
1103 $(srcdir)/Include/cpython/pyfpe.h \
1104 $(srcdir)/Include/cpython/pyframe.h \
1105 $(srcdir)/Include/cpython/pyhash.h \
1106 $(srcdir)/Include/cpython/pylifecycle.h \
1107 $(srcdir)/Include/cpython/pymem.h \
1108 $(srcdir)/Include/cpython/pystate.h \
1109 $(srcdir)/Include/cpython/pystats.h \
1110 $(srcdir)/Include/cpython/pythonrun.h \
1111 $(srcdir)/Include/cpython/pythread.h \
1112 $(srcdir)/Include/cpython/setobject.h \
1113 $(srcdir)/Include/cpython/sysmodule.h \
1114 $(srcdir)/Include/cpython/traceback.h \
1115 $(srcdir)/Include/cpython/tracemalloc.h \
1116 $(srcdir)/Include/cpython/tupleobject.h \
1117 $(srcdir)/Include/cpython/unicodeobject.h \
1118 $(srcdir)/Include/cpython/warnings.h \
1119 $(srcdir)/Include/cpython/weakrefobject.h \
1120 \
1121 $(MIMALLOC_HEADERS) \
1122 \
1123 $(srcdir)/Include/internal/pycore_abstract.h \
1124 $(srcdir)/Include/internal/pycore_asdl.h \
1125 $(srcdir)/Include/internal/pycore_ast.h \
1126 $(srcdir)/Include/internal/pycore_ast_state.h \
1127 $(srcdir)/Include/internal/pycore_atexit.h \
1128 $(srcdir)/Include/internal/pycore_backoff.h \
1129 $(srcdir)/Include/internal/pycore_bitutils.h \
1130 $(srcdir)/Include/internal/pycore_blocks_output_buffer.h \
1131 $(srcdir)/Include/internal/pycore_brc.h \
1132 $(srcdir)/Include/internal/pycore_bytes_methods.h \
1133 $(srcdir)/Include/internal/pycore_bytesobject.h \
1134 $(srcdir)/Include/internal/pycore_call.h \
1135 $(srcdir)/Include/internal/pycore_capsule.h \
1136 $(srcdir)/Include/internal/pycore_cell.h \
1137 $(srcdir)/Include/internal/pycore_ceval.h \
1138 $(srcdir)/Include/internal/pycore_ceval_state.h \
1139 $(srcdir)/Include/internal/pycore_code.h \
1140 $(srcdir)/Include/internal/pycore_codecs.h \
1141 $(srcdir)/Include/internal/pycore_compile.h \
1142 $(srcdir)/Include/internal/pycore_complexobject.h \
1143 $(srcdir)/Include/internal/pycore_condvar.h \
1144 $(srcdir)/Include/internal/pycore_context.h \
1145 $(srcdir)/Include/internal/pycore_critical_section.h \
1146 $(srcdir)/Include/internal/pycore_crossinterp.h \
1147 $(srcdir)/Include/internal/pycore_descrobject.h \
1148 $(srcdir)/Include/internal/pycore_dict.h \
1149 $(srcdir)/Include/internal/pycore_dict_state.h \
1150 $(srcdir)/Include/internal/pycore_dtoa.h \
1151 $(srcdir)/Include/internal/pycore_exceptions.h \
1152 $(srcdir)/Include/internal/pycore_faulthandler.h \
1153 $(srcdir)/Include/internal/pycore_fileutils.h \
1154 $(srcdir)/Include/internal/pycore_floatobject.h \
1155 $(srcdir)/Include/internal/pycore_flowgraph.h \
1156 $(srcdir)/Include/internal/pycore_format.h \
1157 $(srcdir)/Include/internal/pycore_frame.h \
1158 $(srcdir)/Include/internal/pycore_freelist.h \
1159 $(srcdir)/Include/internal/pycore_function.h \
1160 $(srcdir)/Include/internal/pycore_gc.h \
1161 $(srcdir)/Include/internal/pycore_genobject.h \
1162 $(srcdir)/Include/internal/pycore_getopt.h \
1163 $(srcdir)/Include/internal/pycore_gil.h \
1164 $(srcdir)/Include/internal/pycore_global_objects.h \
1165 $(srcdir)/Include/internal/pycore_global_objects_fini_generated.h \
1166 $(srcdir)/Include/internal/pycore_global_strings.h \
1167 $(srcdir)/Include/internal/pycore_hamt.h \
1168 $(srcdir)/Include/internal/pycore_hashtable.h \
1169 $(srcdir)/Include/internal/pycore_identifier.h \
1170 $(srcdir)/Include/internal/pycore_import.h \
1171 $(srcdir)/Include/internal/pycore_importdl.h \
1172 $(srcdir)/Include/internal/pycore_initconfig.h \
1173 $(srcdir)/Include/internal/pycore_instruments.h \
1174 $(srcdir)/Include/internal/pycore_instruction_sequence.h \
1175 $(srcdir)/Include/internal/pycore_interp.h \
1176 $(srcdir)/Include/internal/pycore_intrinsics.h \
1177 $(srcdir)/Include/internal/pycore_jit.h \
1178 $(srcdir)/Include/internal/pycore_list.h \
1179 $(srcdir)/Include/internal/pycore_llist.h \
1180 $(srcdir)/Include/internal/pycore_lock.h \
1181 $(srcdir)/Include/internal/pycore_long.h \
1182 $(srcdir)/Include/internal/pycore_memoryobject.h \
1183 $(srcdir)/Include/internal/pycore_mimalloc.h \
1184 $(srcdir)/Include/internal/pycore_modsupport.h \
1185 $(srcdir)/Include/internal/pycore_moduleobject.h \
1186 $(srcdir)/Include/internal/pycore_namespace.h \
1187 $(srcdir)/Include/internal/pycore_object.h \
1188 $(srcdir)/Include/internal/pycore_object_alloc.h \
1189 $(srcdir)/Include/internal/pycore_object_stack.h \
1190 $(srcdir)/Include/internal/pycore_object_state.h \
1191 $(srcdir)/Include/internal/pycore_obmalloc.h \
1192 $(srcdir)/Include/internal/pycore_obmalloc_init.h \
1193 $(srcdir)/Include/internal/pycore_opcode_metadata.h \
1194 $(srcdir)/Include/internal/pycore_opcode_utils.h \
1195 $(srcdir)/Include/internal/pycore_optimizer.h \
1196 $(srcdir)/Include/internal/pycore_parking_lot.h \
1197 $(srcdir)/Include/internal/pycore_parser.h \
1198 $(srcdir)/Include/internal/pycore_pathconfig.h \
1199 $(srcdir)/Include/internal/pycore_pyarena.h \
1200 $(srcdir)/Include/internal/pycore_pyatomic_ft_wrappers.h \
1201 $(srcdir)/Include/internal/pycore_pybuffer.h \
1202 $(srcdir)/Include/internal/pycore_pyerrors.h \
1203 $(srcdir)/Include/internal/pycore_pyhash.h \
1204 $(srcdir)/Include/internal/pycore_pylifecycle.h \
1205 $(srcdir)/Include/internal/pycore_pymath.h \
1206 $(srcdir)/Include/internal/pycore_pymem.h \
1207 $(srcdir)/Include/internal/pycore_pymem_init.h \
1208 $(srcdir)/Include/internal/pycore_pystate.h \
1209 $(srcdir)/Include/internal/pycore_pystats.h \
1210 $(srcdir)/Include/internal/pycore_pythonrun.h \
1211 $(srcdir)/Include/internal/pycore_pythread.h \
1212 $(srcdir)/Include/internal/pycore_qsbr.h \
1213 $(srcdir)/Include/internal/pycore_range.h \
1214 $(srcdir)/Include/internal/pycore_runtime.h \
1215 $(srcdir)/Include/internal/pycore_runtime_init.h \
1216 $(srcdir)/Include/internal/pycore_runtime_init_generated.h \
1217 $(srcdir)/Include/internal/pycore_semaphore.h \
1218 $(srcdir)/Include/internal/pycore_setobject.h \
1219 $(srcdir)/Include/internal/pycore_signal.h \
1220 $(srcdir)/Include/internal/pycore_sliceobject.h \
1221 $(srcdir)/Include/internal/pycore_strhex.h \
1222 $(srcdir)/Include/internal/pycore_structseq.h \
1223 $(srcdir)/Include/internal/pycore_symtable.h \
1224 $(srcdir)/Include/internal/pycore_sysmodule.h \
1225 $(srcdir)/Include/internal/pycore_time.h \
1226 $(srcdir)/Include/internal/pycore_token.h \
1227 $(srcdir)/Include/internal/pycore_traceback.h \
1228 $(srcdir)/Include/internal/pycore_tracemalloc.h \
1229 $(srcdir)/Include/internal/pycore_tstate.h \
1230 $(srcdir)/Include/internal/pycore_tuple.h \
1231 $(srcdir)/Include/internal/pycore_typeobject.h \
1232 $(srcdir)/Include/internal/pycore_typevarobject.h \
1233 $(srcdir)/Include/internal/pycore_ucnhash.h \
1234 $(srcdir)/Include/internal/pycore_unicodeobject.h \
1235 $(srcdir)/Include/internal/pycore_unicodeobject_generated.h \
1236 $(srcdir)/Include/internal/pycore_unionobject.h \
1237 $(srcdir)/Include/internal/pycore_uop_ids.h \
1238 $(srcdir)/Include/internal/pycore_uop_metadata.h \
1239 $(srcdir)/Include/internal/pycore_warnings.h \
1240 $(srcdir)/Include/internal/pycore_weakref.h \
1241 $(DTRACE_HEADERS) \
1242 @PLATFORM_HEADERS@ \
1243 \
1244 $(srcdir)/Python/stdlib_module_names.h
1245
1246 ##########################################################################
1247 # Build static libmpdec.a
1248 LIBMPDEC_CFLAGS=@LIBMPDEC_CFLAGS@ $(PY_STDMODULE_CFLAGS) $(CCSHARED)
1249
1250 # "%.o: %c" is not portable
1251 Modules/_decimal/libmpdec/basearith.o: $(srcdir)/Modules/_decimal/libmpdec/basearith.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
1252 $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/basearith.c
1253
1254 Modules/_decimal/libmpdec/constants.o: $(srcdir)/Modules/_decimal/libmpdec/constants.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
1255 $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/constants.c
1256
1257 Modules/_decimal/libmpdec/context.o: $(srcdir)/Modules/_decimal/libmpdec/context.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
1258 $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/context.c
1259
1260 Modules/_decimal/libmpdec/convolute.o: $(srcdir)/Modules/_decimal/libmpdec/convolute.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
1261 $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/convolute.c
1262
1263 Modules/_decimal/libmpdec/crt.o: $(srcdir)/Modules/_decimal/libmpdec/crt.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
1264 $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/crt.c
1265
1266 Modules/_decimal/libmpdec/difradix2.o: $(srcdir)/Modules/_decimal/libmpdec/difradix2.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
1267 $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/difradix2.c
1268
1269 Modules/_decimal/libmpdec/fnt.o: $(srcdir)/Modules/_decimal/libmpdec/fnt.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
1270 $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/fnt.c
1271
1272 Modules/_decimal/libmpdec/fourstep.o: $(srcdir)/Modules/_decimal/libmpdec/fourstep.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
1273 $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/fourstep.c
1274
1275 Modules/_decimal/libmpdec/io.o: $(srcdir)/Modules/_decimal/libmpdec/io.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
1276 $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/io.c
1277
1278 Modules/_decimal/libmpdec/mpalloc.o: $(srcdir)/Modules/_decimal/libmpdec/mpalloc.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
1279 $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/mpalloc.c
1280
1281 Modules/_decimal/libmpdec/mpdecimal.o: $(srcdir)/Modules/_decimal/libmpdec/mpdecimal.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
1282 $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/mpdecimal.c
1283
1284 Modules/_decimal/libmpdec/mpsignal.o: $(srcdir)/Modules/_decimal/libmpdec/mpsignal.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
1285 $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/mpsignal.c
1286
1287 Modules/_decimal/libmpdec/numbertheory.o: $(srcdir)/Modules/_decimal/libmpdec/numbertheory.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
1288 $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/numbertheory.c
1289
1290 Modules/_decimal/libmpdec/sixstep.o: $(srcdir)/Modules/_decimal/libmpdec/sixstep.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
1291 $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/sixstep.c
1292
1293 Modules/_decimal/libmpdec/transpose.o: $(srcdir)/Modules/_decimal/libmpdec/transpose.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)
1294 $(CC) -c $(LIBMPDEC_CFLAGS) -o $@ $(srcdir)/Modules/_decimal/libmpdec/transpose.c
1295
1296 $(LIBMPDEC_A): $(LIBMPDEC_OBJS)
1297 -rm -f $@
1298 $(AR) $(ARFLAGS) $@ $(LIBMPDEC_OBJS)
1299
1300 ##########################################################################
1301 # Build static libexpat.a
1302 LIBEXPAT_CFLAGS=@LIBEXPAT_CFLAGS@ $(PY_STDMODULE_CFLAGS) $(CCSHARED)
1303
1304 Modules/expat/xmlparse.o: $(srcdir)/Modules/expat/xmlparse.c $(LIBEXPAT_HEADERS) $(PYTHON_HEADERS)
1305 $(CC) -c $(LIBEXPAT_CFLAGS) -o $@ $(srcdir)/Modules/expat/xmlparse.c
1306
1307 Modules/expat/xmlrole.o: $(srcdir)/Modules/expat/xmlrole.c $(LIBEXPAT_HEADERS) $(PYTHON_HEADERS)
1308 $(CC) -c $(LIBEXPAT_CFLAGS) -o $@ $(srcdir)/Modules/expat/xmlrole.c
1309
1310 Modules/expat/xmltok.o: $(srcdir)/Modules/expat/xmltok.c $(LIBEXPAT_HEADERS) $(PYTHON_HEADERS)
1311 $(CC) -c $(LIBEXPAT_CFLAGS) -o $@ $(srcdir)/Modules/expat/xmltok.c
1312
1313 $(LIBEXPAT_A): $(LIBEXPAT_OBJS)
1314 -rm -f $@
1315 $(AR) $(ARFLAGS) $@ $(LIBEXPAT_OBJS)
1316
1317 ##########################################################################
1318 # Build HACL* static libraries for hashlib: libHacl_Hash_SHA2.a
1319 LIBHACL_CFLAGS=-I$(srcdir)/Modules/_hacl/include -D_BSD_SOURCE -D_DEFAULT_SOURCE $(PY_STDMODULE_CFLAGS) $(CCSHARED)
1320
1321 Modules/_hacl/Hacl_Hash_SHA2.o: $(srcdir)/Modules/_hacl/Hacl_Hash_SHA2.c $(LIBHACL_SHA2_HEADERS)
1322 $(CC) -c $(LIBHACL_CFLAGS) -o $@ $(srcdir)/Modules/_hacl/Hacl_Hash_SHA2.c
1323
1324 $(LIBHACL_SHA2_A): $(LIBHACL_SHA2_OBJS)
1325 -rm -f $@
1326 $(AR) $(ARFLAGS) $@ $(LIBHACL_SHA2_OBJS)
1327
1328 # create relative links from build/lib.platform/egg.so to Modules/egg.so
1329 # pybuilddir.txt is created too late. We cannot use it in Makefile
1330 # targets. ln --relative is not portable.
1331 .PHONY: sharedmods
1332 sharedmods: $(SHAREDMODS) pybuilddir.txt
1333 @target=`cat pybuilddir.txt`; \
1334 $(MKDIR_P) $$target; \
1335 for mod in X $(SHAREDMODS); do \
1336 if test $$mod != X; then \
1337 $(LN) -sf ../../$$mod $$target/`basename $$mod`; \
1338 fi; \
1339 done
1340
1341 # dependency on BUILDPYTHON ensures that the target is run last
1342 .PHONY: checksharedmods
1343 checksharedmods: sharedmods $(PYTHON_FOR_BUILD_DEPS) $(BUILDPYTHON)
1344 @$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/build/check_extension_modules.py
1345
1346 .PHONY: rundsymutil
1347 rundsymutil: sharedmods $(PYTHON_FOR_BUILD_DEPS) $(BUILDPYTHON)
1348 @if [ ! -z $(DSYMUTIL) ] ; then \
1349 echo $(DSYMUTIL_PATH) $(BUILDPYTHON); \
1350 $(DSYMUTIL_PATH) $(BUILDPYTHON); \
1351 if test -f $(LDLIBRARY); then \
1352 echo $(DSYMUTIL_PATH) $(LDLIBRARY); \
1353 $(DSYMUTIL_PATH) $(LDLIBRARY); \
1354 fi; \
1355 for mod in X $(SHAREDMODS); do \
1356 if test $$mod != X; then \
1357 echo $(DSYMUTIL_PATH) $$mod; \
1358 $(DSYMUTIL_PATH) $$mod; \
1359 fi; \
1360 done \
1361 fi
1362
1363 Modules/Setup.local:
1364 @# Create empty Setup.local when file was deleted by user
1365 echo "# Edit this file for local setup changes" > $@
1366
1367 Modules/Setup.bootstrap: $(srcdir)/Modules/Setup.bootstrap.in config.status
1368 ./config.status $@
1369
1370 Modules/Setup.stdlib: $(srcdir)/Modules/Setup.stdlib.in config.status
1371 ./config.status $@
1372
1373 Makefile Modules/config.c: Makefile.pre \
1374 $(srcdir)/Modules/config.c.in \
1375 $(MAKESETUP) \
1376 $(srcdir)/Modules/Setup \
1377 Modules/Setup.local \
1378 Modules/Setup.bootstrap \
1379 Modules/Setup.stdlib
1380 $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
1381 -s Modules \
1382 Modules/Setup.local \
1383 Modules/Setup.stdlib \
1384 Modules/Setup.bootstrap \
1385 $(srcdir)/Modules/Setup
1386 @mv config.c Modules
1387 @echo "The Makefile was updated, you may need to re-run make."
1388
1389 .PHONY: regen-test-frozenmain
1390 regen-test-frozenmain: $(BUILDPYTHON)
1391 # Regenerate Programs/test_frozenmain.h
1392 # from Programs/test_frozenmain.py
1393 # using Programs/freeze_test_frozenmain.py
1394 $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Programs/freeze_test_frozenmain.py Programs/test_frozenmain.h
1395
1396 .PHONY: regen-test-levenshtein
1397 regen-test-levenshtein:
1398 # Regenerate Lib/test/levenshtein_examples.json
1399 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/generate_levenshtein_examples.py $(srcdir)/Lib/test/levenshtein_examples.json
1400
1401 .PHONY: regen-re
1402 regen-re: $(BUILDPYTHON)
1403 # Regenerate Lib/re/_casefix.py
1404 # using Tools/build/generate_re_casefix.py
1405 $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/build/generate_re_casefix.py $(srcdir)/Lib/re/_casefix.py
1406
1407 Programs/_testembed: Programs/_testembed.o $(LINK_PYTHON_DEPS)
1408 $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS)
1409
1410 ############################################################################
1411 # "Bootstrap Python" used to run Programs/_freeze_module.py
1412
1413 BOOTSTRAP_HEADERS = \
1414 Python/frozen_modules/importlib._bootstrap.h \
1415 Python/frozen_modules/importlib._bootstrap_external.h \
1416 Python/frozen_modules/zipimport.h
1417
1418 Programs/_bootstrap_python.o: Programs/_bootstrap_python.c $(BOOTSTRAP_HEADERS) $(PYTHON_HEADERS)
1419
1420 _bootstrap_python: $(LIBRARY_OBJS_OMIT_FROZEN) Programs/_bootstrap_python.o Modules/getpath.o Modules/Setup.local
1421 $(LINKCC) $(PY_LDFLAGS_NOLTO) -o $@ $(LIBRARY_OBJS_OMIT_FROZEN) \
1422 Programs/_bootstrap_python.o Modules/getpath.o $(LIBS) $(MODLIBS) $(SYSLIBS)
1423
1424
1425 ############################################################################
1426 # frozen modules (including importlib)
1427 #
1428 # Freezing is a multi step process. It works differently for standard builds
1429 # and cross builds. Standard builds use Programs/_freeze_module and
1430 # _bootstrap_python for freezing, so users can build Python
1431 # without an existing Python installation. Cross builds cannot execute
1432 # compiled binaries and therefore rely on an external build Python
1433 # interpreter. The build interpreter must have same version and same bytecode
1434 # as the host (target) binary.
1435 #
1436 # Standard build process:
1437 # 1) compile minimal core objects for Py_Compile*() and PyMarshal_Write*().
1438 # 2) build Programs/_freeze_module binary.
1439 # 3) create frozen module headers for importlib and getpath.
1440 # 4) build _bootstrap_python binary.
1441 # 5) create remaining frozen module headers with
1442 # ``./_bootstrap_python Programs/_freeze_module.py``. The pure Python
1443 # script is used to test the cross compile code path.
1444 #
1445 # Cross compile process:
1446 # 1) create all frozen module headers with external build Python and
1447 # Programs/_freeze_module.py script.
1448 #
1449
1450 # FROZEN_FILES_* are auto-generated by Tools/build/freeze_modules.py.
1451 FROZEN_FILES_IN = \
1452 Lib/importlib/_bootstrap.py \
1453 Lib/importlib/_bootstrap_external.py \
1454 Lib/zipimport.py \
1455 Lib/abc.py \
1456 Lib/codecs.py \
1457 Lib/io.py \
1458 Lib/_collections_abc.py \
1459 Lib/_sitebuiltins.py \
1460 Lib/genericpath.py \
1461 Lib/ntpath.py \
1462 Lib/posixpath.py \
1463 Lib/os.py \
1464 Lib/site.py \
1465 Lib/stat.py \
1466 Lib/importlib/util.py \
1467 Lib/importlib/machinery.py \
1468 Lib/runpy.py \
1469 Lib/__hello__.py \
1470 Lib/__phello__/__init__.py \
1471 Lib/__phello__/ham/__init__.py \
1472 Lib/__phello__/ham/eggs.py \
1473 Lib/__phello__/spam.py \
1474 Tools/freeze/flag.py
1475 # End FROZEN_FILES_IN
1476 FROZEN_FILES_OUT = \
1477 Python/frozen_modules/importlib._bootstrap.h \
1478 Python/frozen_modules/importlib._bootstrap_external.h \
1479 Python/frozen_modules/zipimport.h \
1480 Python/frozen_modules/abc.h \
1481 Python/frozen_modules/codecs.h \
1482 Python/frozen_modules/io.h \
1483 Python/frozen_modules/_collections_abc.h \
1484 Python/frozen_modules/_sitebuiltins.h \
1485 Python/frozen_modules/genericpath.h \
1486 Python/frozen_modules/ntpath.h \
1487 Python/frozen_modules/posixpath.h \
1488 Python/frozen_modules/os.h \
1489 Python/frozen_modules/site.h \
1490 Python/frozen_modules/stat.h \
1491 Python/frozen_modules/importlib.util.h \
1492 Python/frozen_modules/importlib.machinery.h \
1493 Python/frozen_modules/runpy.h \
1494 Python/frozen_modules/__hello__.h \
1495 Python/frozen_modules/__phello__.h \
1496 Python/frozen_modules/__phello__.ham.h \
1497 Python/frozen_modules/__phello__.ham.eggs.h \
1498 Python/frozen_modules/__phello__.spam.h \
1499 Python/frozen_modules/frozen_only.h
1500 # End FROZEN_FILES_OUT
1501
1502 Programs/_freeze_module.o: Programs/_freeze_module.c Makefile
1503
1504 Modules/getpath_noop.o: $(srcdir)/Modules/getpath_noop.c Makefile
1505
1506 Programs/_freeze_module: Programs/_freeze_module.o Modules/getpath_noop.o $(LIBRARY_OBJS_OMIT_FROZEN)
1507 $(LINKCC) $(PY_CORE_LDFLAGS) -o $@ Programs/_freeze_module.o Modules/getpath_noop.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS)
1508
1509 # We manually freeze getpath.py rather than through freeze_modules
1510 Python/frozen_modules/getpath.h: Modules/getpath.py $(FREEZE_MODULE_BOOTSTRAP_DEPS)
1511 $(FREEZE_MODULE_BOOTSTRAP) getpath $(srcdir)/Modules/getpath.py Python/frozen_modules/getpath.h
1512
1513 # BEGIN: freezing modules
1514
1515 Python/frozen_modules/importlib._bootstrap.h: Lib/importlib/_bootstrap.py $(FREEZE_MODULE_BOOTSTRAP_DEPS)
1516 $(FREEZE_MODULE_BOOTSTRAP) importlib._bootstrap $(srcdir)/Lib/importlib/_bootstrap.py Python/frozen_modules/importlib._bootstrap.h
1517
1518 Python/frozen_modules/importlib._bootstrap_external.h: Lib/importlib/_bootstrap_external.py $(FREEZE_MODULE_BOOTSTRAP_DEPS)
1519 $(FREEZE_MODULE_BOOTSTRAP) importlib._bootstrap_external $(srcdir)/Lib/importlib/_bootstrap_external.py Python/frozen_modules/importlib._bootstrap_external.h
1520
1521 Python/frozen_modules/zipimport.h: Lib/zipimport.py $(FREEZE_MODULE_BOOTSTRAP_DEPS)
1522 $(FREEZE_MODULE_BOOTSTRAP) zipimport $(srcdir)/Lib/zipimport.py Python/frozen_modules/zipimport.h
1523
1524 Python/frozen_modules/abc.h: Lib/abc.py $(FREEZE_MODULE_DEPS)
1525 $(FREEZE_MODULE) abc $(srcdir)/Lib/abc.py Python/frozen_modules/abc.h
1526
1527 Python/frozen_modules/codecs.h: Lib/codecs.py $(FREEZE_MODULE_DEPS)
1528 $(FREEZE_MODULE) codecs $(srcdir)/Lib/codecs.py Python/frozen_modules/codecs.h
1529
1530 Python/frozen_modules/io.h: Lib/io.py $(FREEZE_MODULE_DEPS)
1531 $(FREEZE_MODULE) io $(srcdir)/Lib/io.py Python/frozen_modules/io.h
1532
1533 Python/frozen_modules/_collections_abc.h: Lib/_collections_abc.py $(FREEZE_MODULE_DEPS)
1534 $(FREEZE_MODULE) _collections_abc $(srcdir)/Lib/_collections_abc.py Python/frozen_modules/_collections_abc.h
1535
1536 Python/frozen_modules/_sitebuiltins.h: Lib/_sitebuiltins.py $(FREEZE_MODULE_DEPS)
1537 $(FREEZE_MODULE) _sitebuiltins $(srcdir)/Lib/_sitebuiltins.py Python/frozen_modules/_sitebuiltins.h
1538
1539 Python/frozen_modules/genericpath.h: Lib/genericpath.py $(FREEZE_MODULE_DEPS)
1540 $(FREEZE_MODULE) genericpath $(srcdir)/Lib/genericpath.py Python/frozen_modules/genericpath.h
1541
1542 Python/frozen_modules/ntpath.h: Lib/ntpath.py $(FREEZE_MODULE_DEPS)
1543 $(FREEZE_MODULE) ntpath $(srcdir)/Lib/ntpath.py Python/frozen_modules/ntpath.h
1544
1545 Python/frozen_modules/posixpath.h: Lib/posixpath.py $(FREEZE_MODULE_DEPS)
1546 $(FREEZE_MODULE) posixpath $(srcdir)/Lib/posixpath.py Python/frozen_modules/posixpath.h
1547
1548 Python/frozen_modules/os.h: Lib/os.py $(FREEZE_MODULE_DEPS)
1549 $(FREEZE_MODULE) os $(srcdir)/Lib/os.py Python/frozen_modules/os.h
1550
1551 Python/frozen_modules/site.h: Lib/site.py $(FREEZE_MODULE_DEPS)
1552 $(FREEZE_MODULE) site $(srcdir)/Lib/site.py Python/frozen_modules/site.h
1553
1554 Python/frozen_modules/stat.h: Lib/stat.py $(FREEZE_MODULE_DEPS)
1555 $(FREEZE_MODULE) stat $(srcdir)/Lib/stat.py Python/frozen_modules/stat.h
1556
1557 Python/frozen_modules/importlib.util.h: Lib/importlib/util.py $(FREEZE_MODULE_DEPS)
1558 $(FREEZE_MODULE) importlib.util $(srcdir)/Lib/importlib/util.py Python/frozen_modules/importlib.util.h
1559
1560 Python/frozen_modules/importlib.machinery.h: Lib/importlib/machinery.py $(FREEZE_MODULE_DEPS)
1561 $(FREEZE_MODULE) importlib.machinery $(srcdir)/Lib/importlib/machinery.py Python/frozen_modules/importlib.machinery.h
1562
1563 Python/frozen_modules/runpy.h: Lib/runpy.py $(FREEZE_MODULE_DEPS)
1564 $(FREEZE_MODULE) runpy $(srcdir)/Lib/runpy.py Python/frozen_modules/runpy.h
1565
1566 Python/frozen_modules/__hello__.h: Lib/__hello__.py $(FREEZE_MODULE_DEPS)
1567 $(FREEZE_MODULE) __hello__ $(srcdir)/Lib/__hello__.py Python/frozen_modules/__hello__.h
1568
1569 Python/frozen_modules/__phello__.h: Lib/__phello__/__init__.py $(FREEZE_MODULE_DEPS)
1570 $(FREEZE_MODULE) __phello__ $(srcdir)/Lib/__phello__/__init__.py Python/frozen_modules/__phello__.h
1571
1572 Python/frozen_modules/__phello__.ham.h: Lib/__phello__/ham/__init__.py $(FREEZE_MODULE_DEPS)
1573 $(FREEZE_MODULE) __phello__.ham $(srcdir)/Lib/__phello__/ham/__init__.py Python/frozen_modules/__phello__.ham.h
1574
1575 Python/frozen_modules/__phello__.ham.eggs.h: Lib/__phello__/ham/eggs.py $(FREEZE_MODULE_DEPS)
1576 $(FREEZE_MODULE) __phello__.ham.eggs $(srcdir)/Lib/__phello__/ham/eggs.py Python/frozen_modules/__phello__.ham.eggs.h
1577
1578 Python/frozen_modules/__phello__.spam.h: Lib/__phello__/spam.py $(FREEZE_MODULE_DEPS)
1579 $(FREEZE_MODULE) __phello__.spam $(srcdir)/Lib/__phello__/spam.py Python/frozen_modules/__phello__.spam.h
1580
1581 Python/frozen_modules/frozen_only.h: Tools/freeze/flag.py $(FREEZE_MODULE_DEPS)
1582 $(FREEZE_MODULE) frozen_only $(srcdir)/Tools/freeze/flag.py Python/frozen_modules/frozen_only.h
1583
1584 # END: freezing modules
1585
1586 Tools/build/freeze_modules.py: $(FREEZE_MODULE)
1587
1588 .PHONY: regen-frozen
1589 regen-frozen: Tools/build/freeze_modules.py $(FROZEN_FILES_IN)
1590 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/freeze_modules.py --frozen-modules
1591 @echo "The Makefile was updated, you may need to re-run make."
1592
1593 # We keep this renamed target around for folks with muscle memory.
1594 .PHONY: regen-importlib
1595 regen-importlib: regen-frozen
1596
1597 ############################################################################
1598 # Global objects
1599
1600 # Dependencies which can add and/or remove _Py_ID() identifiers:
1601 # - "make clinic"
1602 .PHONY: regen-global-objects
1603 regen-global-objects: $(srcdir)/Tools/build/generate_global_objects.py clinic
1604 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/generate_global_objects.py
1605
1606 ############################################################################
1607 # ABI
1608
1609 .PHONY: regen-abidump
1610 regen-abidump: all
1611 @$(MKDIR_P) $(srcdir)/Doc/data/
1612 abidw "libpython$(LDVERSION).so" --no-architecture --out-file $(srcdir)/Doc/data/python$(LDVERSION).abi.new
1613 @$(UPDATE_FILE) --create $(srcdir)/Doc/data/python$(LDVERSION).abi $(srcdir)/Doc/data/python$(LDVERSION).abi.new
1614
1615 .PHONY: check-abidump
1616 check-abidump: all
1617 abidiff $(srcdir)/Doc/data/python$(LDVERSION).abi "libpython$(LDVERSION).so" --drop-private-types --no-architecture --no-added-syms
1618
1619 .PHONY: regen-limited-abi
1620 regen-limited-abi: all
1621 $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/build/stable_abi.py --generate-all $(srcdir)/Misc/stable_abi.toml
1622
1623 ############################################################################
1624 # Regenerate Unicode Data
1625
1626 .PHONY: regen-unicodedata
1627 regen-unicodedata:
1628 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/unicode/makeunicodedata.py
1629
1630
1631 ############################################################################
1632 # Regenerate all generated files
1633
1634 # "clinic" is regenerated implicitly via "regen-global-objects".
1635 .PHONY: regen-all
1636 regen-all: regen-cases regen-typeslots \
1637 regen-token regen-ast regen-keyword regen-sre regen-frozen \
1638 regen-pegen-metaparser regen-pegen regen-test-frozenmain \
1639 regen-test-levenshtein regen-global-objects regen-jit
1640 @echo
1641 @echo "Note: make regen-stdlib-module-names, make regen-limited-abi, "
1642 @echo "make regen-configure, make regen-sbom, and make regen-unicodedata should be run manually"
1643
1644 ############################################################################
1645 # Special rules for object files
1646
1647 Modules/getbuildinfo.o: $(PARSER_OBJS) \
1648 $(OBJECT_OBJS) \
1649 $(PYTHON_OBJS) \
1650 $(MODULE_OBJS) \
1651 $(MODOBJS) \
1652 $(DTRACE_OBJS) \
1653 $(srcdir)/Modules/getbuildinfo.c
1654 $(CC) -c $(PY_CORE_CFLAGS) \
1655 -DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \
1656 -DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \
1657 -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \
1658 -o $@ $(srcdir)/Modules/getbuildinfo.c
1659
1660 Modules/getpath.o: $(srcdir)/Modules/getpath.c Python/frozen_modules/getpath.h Makefile $(PYTHON_HEADERS)
1661 $(CC) -c $(PY_CORE_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
1662 -DPREFIX='"$(prefix)"' \
1663 -DEXEC_PREFIX='"$(exec_prefix)"' \
1664 -DVERSION='"$(VERSION)"' \
1665 -DVPATH='"$(VPATH)"' \
1666 -DPLATLIBDIR='"$(PLATLIBDIR)"' \
1667 -DPYTHONFRAMEWORK='"$(PYTHONFRAMEWORK)"' \
1668 -o $@ $(srcdir)/Modules/getpath.c
1669
1670 Programs/python.o: $(srcdir)/Programs/python.c
1671 $(CC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/python.c
1672
1673 Programs/_testembed.o: $(srcdir)/Programs/_testembed.c Programs/test_frozenmain.h $(PYTHON_HEADERS)
1674 $(CC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/_testembed.c
1675
1676 Modules/_sre/sre.o: $(srcdir)/Modules/_sre/sre.c $(srcdir)/Modules/_sre/sre.h $(srcdir)/Modules/_sre/sre_constants.h $(srcdir)/Modules/_sre/sre_lib.h
1677
1678 Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c $(srcdir)/Modules/posixmodule.h
1679
1680 Modules/grpmodule.o: $(srcdir)/Modules/grpmodule.c $(srcdir)/Modules/posixmodule.h
1681
1682 Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h
1683
1684 Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c $(srcdir)/Modules/posixmodule.h
1685
1686 Modules/_xxsubinterpretersmodule.o: $(srcdir)/Modules/_xxsubinterpretersmodule.c $(srcdir)/Modules/_interpreters_common.h
1687
1688 Modules/_xxinterpqueuesmodule.o: $(srcdir)/Modules/_xxinterpqueuesmodule.c $(srcdir)/Modules/_interpreters_common.h
1689
1690 Modules/_xxinterpchannelsmodule.o: $(srcdir)/Modules/_xxinterpchannelsmodule.c $(srcdir)/Modules/_interpreters_common.h
1691
1692 Python/crossinterp.o: $(srcdir)/Python/crossinterp.c $(srcdir)/Python/crossinterp_data_lookup.h $(srcdir)/Python/crossinterp_exceptions.h
1693
1694 Python/initconfig.o: $(srcdir)/Python/initconfig.c $(srcdir)/Python/config_common.h
1695
1696 Python/interpconfig.o: $(srcdir)/Python/interpconfig.c $(srcdir)/Python/config_common.h
1697
1698 Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile
1699 $(CC) -c $(PY_CORE_CFLAGS) \
1700 -DSOABI='"$(SOABI)"' \
1701 -o $@ $(srcdir)/Python/dynload_shlib.c
1702
1703 Python/dynload_hpux.o: $(srcdir)/Python/dynload_hpux.c Makefile
1704 $(CC) -c $(PY_CORE_CFLAGS) \
1705 -DSHLIB_EXT='"$(EXT_SUFFIX)"' \
1706 -o $@ $(srcdir)/Python/dynload_hpux.c
1707
1708 Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h
1709 $(CC) -c $(PY_CORE_CFLAGS) \
1710 -DABIFLAGS='"$(ABIFLAGS)"' \
1711 $(MULTIARCH_CPPFLAGS) \
1712 -o $@ $(srcdir)/Python/sysmodule.c
1713
1714 $(IO_OBJS): $(IO_H)
1715
1716 .PHONY: regen-pegen-metaparser
1717 regen-pegen-metaparser:
1718 @$(MKDIR_P) $(srcdir)/Tools/peg_generator/pegen
1719 PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen -q python \
1720 $(srcdir)/Tools/peg_generator/pegen/metagrammar.gram \
1721 -o $(srcdir)/Tools/peg_generator/pegen/grammar_parser.py.new
1722 $(UPDATE_FILE) $(srcdir)/Tools/peg_generator/pegen/grammar_parser.py \
1723 $(srcdir)/Tools/peg_generator/pegen/grammar_parser.py.new
1724
1725 .PHONY: regen-pegen
1726 regen-pegen:
1727 @$(MKDIR_P) $(srcdir)/Parser
1728 @$(MKDIR_P) $(srcdir)/Parser/tokenizer
1729 @$(MKDIR_P) $(srcdir)/Parser/lexer
1730 PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen -q c \
1731 $(srcdir)/Grammar/python.gram \
1732 $(srcdir)/Grammar/Tokens \
1733 -o $(srcdir)/Parser/parser.c.new
1734 $(UPDATE_FILE) $(srcdir)/Parser/parser.c $(srcdir)/Parser/parser.c.new
1735
1736 .PHONY: regen-ast
1737 regen-ast:
1738 # Regenerate 3 files using using Parser/asdl_c.py:
1739 # - Include/internal/pycore_ast.h
1740 # - Include/internal/pycore_ast_state.h
1741 # - Python/Python-ast.c
1742 $(MKDIR_P) $(srcdir)/Include
1743 $(MKDIR_P) $(srcdir)/Python
1744 $(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \
1745 $(srcdir)/Parser/Python.asdl \
1746 -H $(srcdir)/Include/internal/pycore_ast.h.new \
1747 -I $(srcdir)/Include/internal/pycore_ast_state.h.new \
1748 -C $(srcdir)/Python/Python-ast.c.new
1749
1750 $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast.h $(srcdir)/Include/internal/pycore_ast.h.new
1751 $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast_state.h $(srcdir)/Include/internal/pycore_ast_state.h.new
1752 $(UPDATE_FILE) $(srcdir)/Python/Python-ast.c $(srcdir)/Python/Python-ast.c.new
1753
1754 .PHONY: regen-token
1755 regen-token:
1756 # Regenerate Doc/library/token-list.inc from Grammar/Tokens
1757 # using Tools/build/generate_token.py
1758 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/generate_token.py rst \
1759 $(srcdir)/Grammar/Tokens \
1760 $(srcdir)/Doc/library/token-list.inc
1761 # Regenerate Include/internal/pycore_token.h from Grammar/Tokens
1762 # using Tools/build/generate_token.py
1763 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/generate_token.py h \
1764 $(srcdir)/Grammar/Tokens \
1765 $(srcdir)/Include/internal/pycore_token.h
1766 # Regenerate Parser/token.c from Grammar/Tokens
1767 # using Tools/build/generate_token.py
1768 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/generate_token.py c \
1769 $(srcdir)/Grammar/Tokens \
1770 $(srcdir)/Parser/token.c
1771 # Regenerate Lib/token.py from Grammar/Tokens
1772 # using Tools/build/generate_token.py
1773 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/generate_token.py py \
1774 $(srcdir)/Grammar/Tokens \
1775 $(srcdir)/Lib/token.py
1776
1777 .PHONY: regen-keyword
1778 regen-keyword:
1779 # Regenerate Lib/keyword.py from Grammar/python.gram and Grammar/Tokens
1780 # using Tools/peg_generator/pegen
1781 PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen.keywordgen \
1782 $(srcdir)/Grammar/python.gram \
1783 $(srcdir)/Grammar/Tokens \
1784 $(srcdir)/Lib/keyword.py.new
1785 $(UPDATE_FILE) $(srcdir)/Lib/keyword.py $(srcdir)/Lib/keyword.py.new
1786
1787 .PHONY: regen-stdlib-module-names
1788 regen-stdlib-module-names: all Programs/_testembed
1789 # Regenerate Python/stdlib_module_names.h
1790 # using Tools/build/generate_stdlib_module_names.py
1791 $(RUNSHARED) ./$(BUILDPYTHON) \
1792 $(srcdir)/Tools/build/generate_stdlib_module_names.py \
1793 > $(srcdir)/Python/stdlib_module_names.h.new
1794 $(UPDATE_FILE) $(srcdir)/Python/stdlib_module_names.h $(srcdir)/Python/stdlib_module_names.h.new
1795
1796 .PHONY: regen-sre
1797 regen-sre:
1798 # Regenerate Modules/_sre/sre_constants.h and Modules/_sre/sre_targets.h
1799 # from Lib/re/_constants.py using Tools/build/generate_sre_constants.py
1800 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/generate_sre_constants.py \
1801 $(srcdir)/Lib/re/_constants.py \
1802 $(srcdir)/Modules/_sre/sre_constants.h \
1803 $(srcdir)/Modules/_sre/sre_targets.h
1804
1805 Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o: $(srcdir)/Include/internal/pycore_ast.h $(srcdir)/Include/internal/pycore_ast.h
1806
1807 Python/getplatform.o: $(srcdir)/Python/getplatform.c
1808 $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
1809
1810 Python/importdl.o: $(srcdir)/Python/importdl.c
1811 $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
1812
1813 Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
1814 $(srcdir)/Objects/unicodetype_db.h
1815
1816 BYTESTR_DEPS = \
1817 $(srcdir)/Objects/stringlib/count.h \
1818 $(srcdir)/Objects/stringlib/ctype.h \
1819 $(srcdir)/Objects/stringlib/fastsearch.h \
1820 $(srcdir)/Objects/stringlib/find.h \
1821 $(srcdir)/Objects/stringlib/join.h \
1822 $(srcdir)/Objects/stringlib/partition.h \
1823 $(srcdir)/Objects/stringlib/split.h \
1824 $(srcdir)/Objects/stringlib/stringdefs.h \
1825 $(srcdir)/Objects/stringlib/transmogrify.h
1826
1827 UNICODE_DEPS = \
1828 $(srcdir)/Objects/stringlib/asciilib.h \
1829 $(srcdir)/Objects/stringlib/codecs.h \
1830 $(srcdir)/Objects/stringlib/count.h \
1831 $(srcdir)/Objects/stringlib/fastsearch.h \
1832 $(srcdir)/Objects/stringlib/find.h \
1833 $(srcdir)/Objects/stringlib/find_max_char.h \
1834 $(srcdir)/Objects/stringlib/localeutil.h \
1835 $(srcdir)/Objects/stringlib/partition.h \
1836 $(srcdir)/Objects/stringlib/replace.h \
1837 $(srcdir)/Objects/stringlib/split.h \
1838 $(srcdir)/Objects/stringlib/ucs1lib.h \
1839 $(srcdir)/Objects/stringlib/ucs2lib.h \
1840 $(srcdir)/Objects/stringlib/ucs4lib.h \
1841 $(srcdir)/Objects/stringlib/undef.h \
1842 $(srcdir)/Objects/stringlib/unicode_format.h
1843
1844 Objects/bytes_methods.o: $(srcdir)/Objects/bytes_methods.c $(BYTESTR_DEPS)
1845 Objects/bytesobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS)
1846 Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS)
1847
1848 Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c $(UNICODE_DEPS)
1849
1850 Objects/dictobject.o: $(srcdir)/Objects/stringlib/eq.h
1851 Objects/setobject.o: $(srcdir)/Objects/stringlib/eq.h
1852
1853 Objects/obmalloc.o: $(srcdir)/Objects/mimalloc/alloc.c \
1854 $(srcdir)/Objects/mimalloc/alloc-aligned.c \
1855 $(srcdir)/Objects/mimalloc/alloc-posix.c \
1856 $(srcdir)/Objects/mimalloc/arena.c \
1857 $(srcdir)/Objects/mimalloc/bitmap.c \
1858 $(srcdir)/Objects/mimalloc/heap.c \
1859 $(srcdir)/Objects/mimalloc/init.c \
1860 $(srcdir)/Objects/mimalloc/options.c \
1861 $(srcdir)/Objects/mimalloc/os.c \
1862 $(srcdir)/Objects/mimalloc/page.c \
1863 $(srcdir)/Objects/mimalloc/random.c \
1864 $(srcdir)/Objects/mimalloc/segment.c \
1865 $(srcdir)/Objects/mimalloc/segment-map.c \
1866 $(srcdir)/Objects/mimalloc/stats.c \
1867 $(srcdir)/Objects/mimalloc/prim/prim.c \
1868 $(srcdir)/Objects/mimalloc/prim/osx/prim.c \
1869 $(srcdir)/Objects/mimalloc/prim/unix/prim.c \
1870 $(srcdir)/Objects/mimalloc/prim/wasi/prim.c
1871
1872 Objects/mimalloc/page.o: $(srcdir)/Objects/mimalloc/page-queue.c
1873
1874
1875 # Regenerate various files from Python/bytecodes.c
1876 # Pass CASESFLAG=-l to insert #line directives in the output
1877
1878 .PHONY: regen-cases
1879 regen-cases: \
1880 regen-opcode-ids regen-opcode-targets regen-uop-ids regen-opcode-metadata-py \
1881 regen-generated-cases regen-executor-cases regen-optimizer-cases \
1882 regen-opcode-metadata regen-uop-metadata
1883
1884 .PHONY: regen-opcode-ids
1885 regen-opcode-ids:
1886 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/cases_generator/opcode_id_generator.py \
1887 -o $(srcdir)/Include/opcode_ids.h.new $(srcdir)/Python/bytecodes.c
1888 $(UPDATE_FILE) $(srcdir)/Include/opcode_ids.h $(srcdir)/Include/opcode_ids.h.new
1889
1890 .PHONY: regen-opcode-targets
1891 regen-opcode-targets:
1892 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/cases_generator/target_generator.py \
1893 -o $(srcdir)/Python/opcode_targets.h.new $(srcdir)/Python/bytecodes.c
1894 $(UPDATE_FILE) $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/opcode_targets.h.new
1895
1896 .PHONY: regen-uop-ids
1897 regen-uop-ids:
1898 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/cases_generator/uop_id_generator.py \
1899 -o $(srcdir)/Include/internal/pycore_uop_ids.h.new $(srcdir)/Python/bytecodes.c
1900 $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_uop_ids.h $(srcdir)/Include/internal/pycore_uop_ids.h.new
1901
1902 .PHONY: regen-opcode-metadata-py
1903 regen-opcode-metadata-py:
1904 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/cases_generator/py_metadata_generator.py \
1905 -o $(srcdir)/Lib/_opcode_metadata.py.new $(srcdir)/Python/bytecodes.c
1906 $(UPDATE_FILE) $(srcdir)/Lib/_opcode_metadata.py $(srcdir)/Lib/_opcode_metadata.py.new
1907
1908 .PHONY: regen-generated-cases
1909 regen-generated-cases:
1910 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/cases_generator/tier1_generator.py \
1911 -o $(srcdir)/Python/generated_cases.c.h.new $(srcdir)/Python/bytecodes.c
1912 $(UPDATE_FILE) $(srcdir)/Python/generated_cases.c.h $(srcdir)/Python/generated_cases.c.h.new
1913
1914 .PHONY: regen-executor-cases
1915 regen-executor-cases:
1916 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/cases_generator/tier2_generator.py \
1917 -o $(srcdir)/Python/executor_cases.c.h.new $(srcdir)/Python/bytecodes.c
1918 $(UPDATE_FILE) $(srcdir)/Python/executor_cases.c.h $(srcdir)/Python/executor_cases.c.h.new
1919
1920 .PHONY: regen-optimizer-cases
1921 regen-optimizer-cases:
1922 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/cases_generator/optimizer_generator.py \
1923 -o $(srcdir)/Python/optimizer_cases.c.h.new \
1924 $(srcdir)/Python/optimizer_bytecodes.c \
1925 $(srcdir)/Python/bytecodes.c
1926 $(UPDATE_FILE) $(srcdir)/Python/optimizer_cases.c.h $(srcdir)/Python/optimizer_cases.c.h.new
1927
1928 .PHONY: regen-opcode-metadata
1929 regen-opcode-metadata:
1930 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/cases_generator/opcode_metadata_generator.py \
1931 -o $(srcdir)/Include/internal/pycore_opcode_metadata.h.new $(srcdir)/Python/bytecodes.c
1932 $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_opcode_metadata.h $(srcdir)/Include/internal/pycore_opcode_metadata.h.new
1933
1934 .PHONY: regen-uop-metadata
1935 regen-uop-metadata:
1936 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/cases_generator/uop_metadata_generator.py -o \
1937 $(srcdir)/Include/internal/pycore_uop_metadata.h.new $(srcdir)/Python/bytecodes.c
1938 $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_uop_metadata.h $(srcdir)/Include/internal/pycore_uop_metadata.h.new
1939
1940 Python/compile.o Python/assemble.o Python/flowgraph.o Python/instruction_sequence.o: \
1941 $(srcdir)/Include/internal/pycore_compile.h \
1942 $(srcdir)/Include/internal/pycore_flowgraph.h \
1943 $(srcdir)/Include/internal/pycore_instruction_sequence.h \
1944 $(srcdir)/Include/internal/pycore_opcode_metadata.h \
1945 $(srcdir)/Include/internal/pycore_opcode_utils.h
1946
1947 Python/ceval.o: \
1948 $(srcdir)/Python/ceval_macros.h \
1949 $(srcdir)/Python/condvar.h \
1950 $(srcdir)/Python/generated_cases.c.h \
1951 $(srcdir)/Python/executor_cases.c.h \
1952 $(srcdir)/Python/opcode_targets.h
1953
1954 Python/flowgraph.o: \
1955 $(srcdir)/Include/internal/pycore_opcode_metadata.h
1956
1957 Python/optimizer.o: \
1958 $(srcdir)/Python/executor_cases.c.h \
1959 $(srcdir)/Include/internal/pycore_opcode_metadata.h \
1960 $(srcdir)/Include/internal/pycore_optimizer.h
1961
1962 Python/optimizer_analysis.o: \
1963 $(srcdir)/Include/internal/pycore_opcode_metadata.h \
1964 $(srcdir)/Include/internal/pycore_optimizer.h \
1965 $(srcdir)/Python/optimizer_cases.c.h
1966
1967 Python/frozen.o: $(FROZEN_FILES_OUT)
1968
1969 # Generate DTrace probe macros, then rename them (PYTHON_ -> PyDTrace_) to
1970 # follow our naming conventions. dtrace(1) uses the output filename to generate
1971 # an include guard, so we can't use a pipeline to transform its output.
1972 Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d
1973 $(MKDIR_P) Include
1974 $(DTRACE) $(DFLAGS) -o $@ -h -s $<
1975 : sed in-place edit with POSIX-only tools
1976 sed 's/PYTHON_/PyDTrace_/' $@ > $@.tmp
1977 mv $@.tmp $@
1978
1979 Python/ceval.o: $(srcdir)/Include/pydtrace.h
1980 Python/gc.o: $(srcdir)/Include/pydtrace.h
1981 Python/import.o: $(srcdir)/Include/pydtrace.h
1982
1983 Python/pydtrace.o: $(srcdir)/Include/pydtrace.d $(DTRACE_DEPS)
1984 $(DTRACE) $(DFLAGS) -o $@ -G -s $< $(DTRACE_DEPS)
1985
1986 Objects/typeobject.o: Objects/typeslots.inc
1987
1988 .PHONY: regen-typeslots
1989 regen-typeslots:
1990 # Regenerate Objects/typeslots.inc from Include/typeslotsh
1991 # using Objects/typeslots.py
1992 $(PYTHON_FOR_REGEN) $(srcdir)/Objects/typeslots.py \
1993 < $(srcdir)/Include/typeslots.h \
1994 $(srcdir)/Objects/typeslots.inc.new
1995 $(UPDATE_FILE) $(srcdir)/Objects/typeslots.inc $(srcdir)/Objects/typeslots.inc.new
1996
1997 $(LIBRARY_OBJS) $(MODOBJS) Programs/python.o: $(PYTHON_HEADERS)
1998
1999
2000 ######################################################################
2001
2002 TESTOPTS= $(EXTRATESTOPTS)
2003 TESTPYTHON= $(RUNSHARED) $(PYTHON_FOR_BUILD) $(TESTPYTHONOPTS)
2004 TESTRUNNER= $(TESTPYTHON) -m test
2005 TESTTIMEOUT=
2006
2007 # Remove "test_python_*" directories of previous failed test jobs.
2008 # Pass TESTOPTS options because it can contain --tempdir option.
2009 .PHONY: cleantest
2010 cleantest: all
2011 $(TESTRUNNER) $(TESTOPTS) --cleanup
2012
2013 # Run a basic set of regression tests.
2014 # This excludes some tests that are particularly resource-intensive.
2015 # Similar to buildbottest, but use --fast-ci option, instead of --slow-ci.
2016 .PHONY: test
2017 test: all
2018 $(TESTRUNNER) --fast-ci --timeout=$(TESTTIMEOUT) $(TESTOPTS)
2019
2020 # Run the test suite for both architectures in a Universal build on OSX.
2021 # Must be run on an Intel box.
2022 .PHONY: testuniversal
2023 testuniversal: all
2024 @if [ `arch` != 'i386' ]; then \
2025 echo "This can only be used on OSX/i386" ;\
2026 exit 1 ;\
2027 fi
2028 $(TESTRUNNER) --slow-ci --timeout=$(TESTTIMEOUT) $(TESTOPTS)
2029 $(RUNSHARED) /usr/libexec/oah/translate \
2030 ./$(BUILDPYTHON) -E -m test -j 0 -u all $(TESTOPTS)
2031
2032 # Run the test suite on the iOS simulator. Must be run on a macOS machine with
2033 # a full Xcode install that has an iPhone SE (3rd edition) simulator available.
2034 # This must be run *after* a `make install` has completed the build. The
2035 # `--with-framework-name` argument *cannot* be used when configuring the build.
2036 XCFOLDER=iOSTestbed.$(MULTIARCH).$(shell date +%s)
2037 XCRESULT=$(XCFOLDER)/$(MULTIARCH).xcresult
2038 .PHONY: testios
2039 testios:
2040 @if test "$(MACHDEP)" != "ios"; then \
2041 echo "Cannot run the iOS testbed for a non-iOS build."; \
2042 exit 1;\
2043 fi
2044 @if test "$(findstring -iphonesimulator,$(MULTIARCH))" != "-iphonesimulator"; then \
2045 echo "Cannot run the iOS testbed for non-simulator builds."; \
2046 exit 1;\
2047 fi
2048 @if test $(PYTHONFRAMEWORK) != "Python"; then \
2049 echo "Cannot run the iOS testbed with a non-default framework name."; \
2050 exit 1;\
2051 fi
2052 @if ! test -d $(PYTHONFRAMEWORKPREFIX); then \
2053 echo "Cannot find a finalized iOS Python.framework. Have you run 'make install' to finalize the framework build?"; \
2054 exit 1;\
2055 fi
2056 # Copy the testbed project into the build folder
2057 cp -r $(srcdir)/iOS/testbed $(XCFOLDER)
2058 # Copy the framework from the install location to the testbed project.
2059 cp -r $(PYTHONFRAMEWORKPREFIX)/* $(XCFOLDER)/Python.xcframework/ios-arm64_x86_64-simulator
2060
2061 # Run the test suite for the Xcode project, targeting the iOS simulator.
2062 # If the suite fails, touch a file in the test folder as a marker
2063 if ! xcodebuild test -project $(XCFOLDER)/iOSTestbed.xcodeproj -scheme "iOSTestbed" -destination "platform=iOS Simulator,name=iPhone SE (3rd Generation)" -resultBundlePath $(XCRESULT) ; then \
2064 touch $(XCFOLDER)/failed; \
2065 fi
2066
2067 # Regardless of success or failure, extract and print the test output
2068 xcrun xcresulttool get --path $(XCRESULT) \
2069 --id $$( \
2070 xcrun xcresulttool get --path $(XCRESULT) --format json | \
2071 $(PYTHON_FOR_BUILD) -c "import sys, json; result = json.load(sys.stdin); print(result['actions']['_values'][0]['actionResult']['logRef']['id']['_value'])" \
2072 ) \
2073 --format json | \
2074 $(PYTHON_FOR_BUILD) -c "import sys, json; result = json.load(sys.stdin); print(result['subsections']['_values'][1]['subsections']['_values'][0]['emittedOutput']['_value'])"
2075
2076 @if test -e $(XCFOLDER)/failed ; then \
2077 exit 1; \
2078 fi
2079
2080 # Like test, but using --slow-ci which enables all test resources and use
2081 # longer timeout. Run an optional pybuildbot.identify script to include
2082 # information about the build environment.
2083 .PHONY: buildbottest
2084 buildbottest: all
2085 -@if which pybuildbot.identify >/dev/null 2>&1; then \
2086 pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
2087 fi
2088 $(TESTRUNNER) --slow-ci --timeout=$(TESTTIMEOUT) $(TESTOPTS)
2089
2090 .PHONY: pythoninfo
2091 pythoninfo: all
2092 $(RUNSHARED) $(HOSTRUNNER) ./$(BUILDPYTHON) -m test.pythoninfo
2093
2094 QUICKTESTOPTS= -x test_subprocess test_io \
2095 test_multibytecodec test_urllib2_localnet test_itertools \
2096 test_multiprocessing_fork test_multiprocessing_spawn \
2097 test_multiprocessing_forkserver \
2098 test_mailbox test_socket test_poll \
2099 test_select test_zipfile test_concurrent_futures
2100
2101 .PHONY: quicktest
2102 quicktest: all
2103 $(TESTRUNNER) --fast-ci --timeout=$(TESTTIMEOUT) $(TESTOPTS) $(QUICKTESTOPTS)
2104
2105 # SSL tests
2106 .PHONY: multisslcompile
2107 multisslcompile: all
2108 $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/ssl/multissltests.py --steps=modules
2109
2110 .PHONY: multissltest
2111 multissltest: all
2112 $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/ssl/multissltests.py
2113
2114 # All install targets use the "all" target as synchronization point to
2115 # prevent race conditions with PGO builds. PGO builds use recursive make,
2116 # which can lead to two parallel `./python setup.py build` processes that
2117 # step on each others toes.
2118 .PHONY: install
2119 install: @FRAMEWORKINSTALLFIRST@ @INSTALLTARGETS@ @FRAMEWORKINSTALLLAST@
2120 if test "x$(ENSUREPIP)" != "xno" ; then \
2121 case $(ENSUREPIP) in \
2122 upgrade) ensurepip="--upgrade" ;; \
2123 install|*) ensurepip="" ;; \
2124 esac; \
2125 $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
2126 $$ensurepip --root=$(DESTDIR)/ ; \
2127 fi
2128
2129 .PHONY: altinstall
2130 altinstall: commoninstall
2131 if test "x$(ENSUREPIP)" != "xno" ; then \
2132 case $(ENSUREPIP) in \
2133 upgrade) ensurepip="--altinstall --upgrade" ;; \
2134 install|*) ensurepip="--altinstall" ;; \
2135 esac; \
2136 $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
2137 $$ensurepip --root=$(DESTDIR)/ ; \
2138 fi
2139
2140 .PHONY: commoninstall
2141 commoninstall: check-clean-src @FRAMEWORKALTINSTALLFIRST@ \
2142 altbininstall libinstall inclinstall libainstall \
2143 sharedinstall altmaninstall @FRAMEWORKALTINSTALLLAST@
2144
2145 # Install shared libraries enabled by Setup
2146 DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
2147
2148 .PHONY: sharedinstall
2149 sharedinstall: all
2150 @for i in $(DESTDIRS); \
2151 do \
2152 if test ! -d $(DESTDIR)$$i; then \
2153 echo "Creating directory $$i"; \
2154 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
2155 else true; \
2156 fi; \
2157 done
2158 @for i in X $(SHAREDMODS); do \
2159 if test $$i != X; then \
2160 echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
2161 $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
2162 if test -d "$$i.dSYM"; then \
2163 echo $(DSYMUTIL_PATH) $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
2164 $(DSYMUTIL_PATH) $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
2165 fi; \
2166 fi; \
2167 done
2168
2169 # Install the interpreter with $(VERSION) affixed
2170 # This goes into $(exec_prefix)
2171 .PHONY: altbininstall
2172 altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@
2173 @for i in $(BINDIR) $(LIBDIR); \
2174 do \
2175 if test ! -d $(DESTDIR)$$i; then \
2176 echo "Creating directory $$i"; \
2177 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
2178 else true; \
2179 fi; \
2180 done
2181 if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
2182 $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
2183 else \
2184 $(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
2185 fi
2186 -if test "$(VERSION)" != "$(LDVERSION)"; then \
2187 if test -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) -o -h $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
2188 then rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
2189 fi; \
2190 (cd $(DESTDIR)$(BINDIR); $(LN) python$(LDVERSION)$(EXE) python$(VERSION)$(EXE)); \
2191 fi
2192 @if test "$(PY_ENABLE_SHARED)" = 1 -o "$(STATIC_LIBPYTHON)" = 1; then \
2193 if test -f $(LDLIBRARY) && test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
2194 if test -n "$(DLLLIBRARY)" ; then \
2195 $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
2196 else \
2197 $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
2198 if test $(LDLIBRARY) != $(INSTSONAME); then \
2199 (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \
2200 fi \
2201 fi; \
2202 if test -n "$(PY3LIBRARY)"; then \
2203 $(INSTALL_SHARED) $(PY3LIBRARY) $(DESTDIR)$(LIBDIR)/$(PY3LIBRARY); \
2204 fi; \
2205 else true; \
2206 fi; \
2207 fi
2208 if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
2209 rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)-32$(EXE); \
2210 lipo $(LIPO_32BIT_FLAGS) \
2211 -output $(DESTDIR)$(BINDIR)/python$(VERSION)-32$(EXE) \
2212 $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
2213 fi
2214 if test "x$(LIPO_INTEL64_FLAGS)" != "x" ; then \
2215 rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)-intel64$(EXE); \
2216 lipo $(LIPO_INTEL64_FLAGS) \
2217 -output $(DESTDIR)$(BINDIR)/python$(VERSION)-intel64$(EXE) \
2218 $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
2219 fi
2220 # Install macOS debug information (if available)
2221 if test -d "$(BUILDPYTHON).dSYM"; then \
2222 echo $(DSYMUTIL_PATH) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
2223 $(DSYMUTIL_PATH) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
2224 fi
2225 if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
2226 if test -d "$(LDLIBRARY).dSYM"; then \
2227 echo $(DSYMUTIL_PATH) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
2228 $(DSYMUTIL_PATH) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
2229 fi \
2230 else \
2231 if test -d "$(LDLIBRARY).dSYM"; then \
2232 echo $(DSYMUTIL_PATH) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(INSTSONAME); \
2233 $(DSYMUTIL_PATH) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(INSTSONAME); \
2234 fi \
2235 fi
2236
2237 .PHONY: bininstall
2238 # We depend on commoninstall here to make sure the installation is already usable
2239 # before we possibly overwrite the global 'python3' symlink to avoid causing
2240 # problems for anything else trying to run 'python3' while we install, particularly
2241 # if we're installing in parallel with -j.
2242 bininstall: commoninstall altbininstall
2243 if test ! -d $(DESTDIR)$(LIBPC); then \
2244 echo "Creating directory $(LIBPC)"; \
2245 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC); \
2246 fi
2247 -if test -f $(DESTDIR)$(BINDIR)/python3$(EXE) -o -h $(DESTDIR)$(BINDIR)/python3$(EXE); \
2248 then rm -f $(DESTDIR)$(BINDIR)/python3$(EXE); \
2249 else true; \
2250 fi
2251 (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python3$(EXE))
2252 -if test "$(VERSION)" != "$(LDVERSION)"; then \
2253 rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)-config; \
2254 (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(LDVERSION)-config python$(VERSION)-config); \
2255 rm -f $(DESTDIR)$(LIBPC)/python-$(LDVERSION).pc; \
2256 (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python-$(LDVERSION).pc); \
2257 rm -f $(DESTDIR)$(LIBPC)/python-$(LDVERSION)-embed.pc; \
2258 (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python-$(LDVERSION)-embed.pc); \
2259 fi
2260 -rm -f $(DESTDIR)$(BINDIR)/python3-config
2261 (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python3-config)
2262 -rm -f $(DESTDIR)$(LIBPC)/python3.pc
2263 (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc)
2264 -rm -f $(DESTDIR)$(LIBPC)/python3-embed.pc
2265 (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python3-embed.pc)
2266 -rm -f $(DESTDIR)$(BINDIR)/idle3
2267 (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
2268 -rm -f $(DESTDIR)$(BINDIR)/pydoc3
2269 (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
2270 if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
2271 rm -f $(DESTDIR)$(BINDIR)/python3-32$(EXE); \
2272 (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-32$(EXE) python3-32$(EXE)) \
2273 fi
2274 if test "x$(LIPO_INTEL64_FLAGS)" != "x" ; then \
2275 rm -f $(DESTDIR)$(BINDIR)/python3-intel64$(EXE); \
2276 (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-intel64$(EXE) python3-intel64$(EXE)) \
2277 fi
2278
2279 # Install the versioned manual page
2280 .PHONY: altmaninstall
2281 altmaninstall:
2282 @for i in $(MANDIR) $(MANDIR)/man1; \
2283 do \
2284 if test ! -d $(DESTDIR)$$i; then \
2285 echo "Creating directory $$i"; \
2286 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
2287 else true; \
2288 fi; \
2289 done
2290 $(INSTALL_DATA) $(srcdir)/Misc/python.man \
2291 $(DESTDIR)$(MANDIR)/man1/python$(VERSION).1
2292
2293 # Install the unversioned manual page
2294 .PHONY: maninstall
2295 maninstall: altmaninstall
2296 -rm -f $(DESTDIR)$(MANDIR)/man1/python3.1
2297 (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python$(VERSION).1 python3.1)
2298
2299 # Install the library
2300 XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
2301 LIBSUBDIRS= asyncio \
2302 collections \
2303 concurrent concurrent/futures \
2304 csv \
2305 ctypes ctypes/macholib \
2306 curses \
2307 dbm \
2308 email email/mime \
2309 encodings \
2310 ensurepip ensurepip/_bundled \
2311 html \
2312 http \
2313 idlelib idlelib/Icons \
2314 importlib importlib/resources importlib/metadata \
2315 json \
2316 logging \
2317 multiprocessing multiprocessing/dummy \
2318 pathlib \
2319 pydoc_data \
2320 re \
2321 site-packages \
2322 sqlite3 \
2323 sysconfig \
2324 tkinter \
2325 tomllib \
2326 turtledemo \
2327 unittest \
2328 urllib \
2329 venv venv/scripts venv/scripts/common venv/scripts/posix \
2330 wsgiref \
2331 $(XMLLIBSUBDIRS) \
2332 xmlrpc \
2333 zipfile zipfile/_path \
2334 zoneinfo \
2335 __phello__
2336 TESTSUBDIRS= idlelib/idle_test \
2337 test \
2338 test/archivetestdata \
2339 test/audiodata \
2340 test/certdata \
2341 test/certdata/capath \
2342 test/cjkencodings \
2343 test/configdata \
2344 test/crashers \
2345 test/data \
2346 test/decimaltestdata \
2347 test/dtracedata \
2348 test/encoded_modules \
2349 test/leakers \
2350 test/libregrtest \
2351 test/mathdata \
2352 test/regrtestdata \
2353 test/regrtestdata/import_from_tests \
2354 test/regrtestdata/import_from_tests/test_regrtest_b \
2355 test/subprocessdata \
2356 test/support \
2357 test/support/_hypothesis_stubs \
2358 test/support/interpreters \
2359 test/test_asyncio \
2360 test/test_capi \
2361 test/test_cext \
2362 test/test_concurrent_futures \
2363 test/test_cppext \
2364 test/test_ctypes \
2365 test/test_dataclasses \
2366 test/test_doctest \
2367 test/test_email \
2368 test/test_email/data \
2369 test/test_future_stmt \
2370 test/test_gdb \
2371 test/test_import \
2372 test/test_import/data \
2373 test/test_import/data/circular_imports \
2374 test/test_import/data/circular_imports/subpkg \
2375 test/test_import/data/circular_imports/subpkg2 \
2376 test/test_import/data/circular_imports/subpkg2/parent \
2377 test/test_import/data/package \
2378 test/test_import/data/package2 \
2379 test/test_import/data/unwritable \
2380 test/test_importlib \
2381 test/test_importlib/builtin \
2382 test/test_importlib/extension \
2383 test/test_importlib/frozen \
2384 test/test_importlib/import_ \
2385 test/test_importlib/metadata \
2386 test/test_importlib/metadata/data \
2387 test/test_importlib/metadata/data/sources \
2388 test/test_importlib/metadata/data/sources/example \
2389 test/test_importlib/metadata/data/sources/example/example \
2390 test/test_importlib/metadata/data/sources/example2 \
2391 test/test_importlib/metadata/data/sources/example2/example2 \
2392 test/test_importlib/namespace_pkgs \
2393 test/test_importlib/namespace_pkgs/both_portions \
2394 test/test_importlib/namespace_pkgs/both_portions/foo \
2395 test/test_importlib/namespace_pkgs/module_and_namespace_package \
2396 test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test \
2397 test/test_importlib/namespace_pkgs/not_a_namespace_pkg \
2398 test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo \
2399 test/test_importlib/namespace_pkgs/portion1 \
2400 test/test_importlib/namespace_pkgs/portion1/foo \
2401 test/test_importlib/namespace_pkgs/portion2 \
2402 test/test_importlib/namespace_pkgs/portion2/foo \
2403 test/test_importlib/namespace_pkgs/project1 \
2404 test/test_importlib/namespace_pkgs/project1/parent \
2405 test/test_importlib/namespace_pkgs/project1/parent/child \
2406 test/test_importlib/namespace_pkgs/project2 \
2407 test/test_importlib/namespace_pkgs/project2/parent \
2408 test/test_importlib/namespace_pkgs/project2/parent/child \
2409 test/test_importlib/namespace_pkgs/project3 \
2410 test/test_importlib/namespace_pkgs/project3/parent \
2411 test/test_importlib/namespace_pkgs/project3/parent/child \
2412 test/test_importlib/partial \
2413 test/test_importlib/resources \
2414 test/test_importlib/resources/data01 \
2415 test/test_importlib/resources/data01/subdirectory \
2416 test/test_importlib/resources/data02 \
2417 test/test_importlib/resources/data02/one \
2418 test/test_importlib/resources/data02/subdirectory \
2419 test/test_importlib/resources/data02/subdirectory/subsubdir \
2420 test/test_importlib/resources/data02/two \
2421 test/test_importlib/resources/data03 \
2422 test/test_importlib/resources/data03/namespace \
2423 test/test_importlib/resources/data03/namespace/portion1 \
2424 test/test_importlib/resources/data03/namespace/portion2 \
2425 test/test_importlib/resources/namespacedata01 \
2426 test/test_importlib/resources/zipdata01 \
2427 test/test_importlib/resources/zipdata02 \
2428 test/test_importlib/source \
2429 test/test_inspect \
2430 test/test_interpreters \
2431 test/test_json \
2432 test/test_module \
2433 test/test_multiprocessing_fork \
2434 test/test_multiprocessing_forkserver \
2435 test/test_multiprocessing_spawn \
2436 test/test_pathlib \
2437 test/test_peg_generator \
2438 test/test_pydoc \
2439 test/test_sqlite3 \
2440 test/test_tkinter \
2441 test/test_tomllib \
2442 test/test_tomllib/data \
2443 test/test_tomllib/data/invalid \
2444 test/test_tomllib/data/invalid/array \
2445 test/test_tomllib/data/invalid/array-of-tables \
2446 test/test_tomllib/data/invalid/boolean \
2447 test/test_tomllib/data/invalid/dates-and-times \
2448 test/test_tomllib/data/invalid/dotted-keys \
2449 test/test_tomllib/data/invalid/inline-table \
2450 test/test_tomllib/data/invalid/keys-and-vals \
2451 test/test_tomllib/data/invalid/literal-str \
2452 test/test_tomllib/data/invalid/multiline-basic-str \
2453 test/test_tomllib/data/invalid/multiline-literal-str \
2454 test/test_tomllib/data/invalid/table \
2455 test/test_tomllib/data/valid \
2456 test/test_tomllib/data/valid/array \
2457 test/test_tomllib/data/valid/dates-and-times \
2458 test/test_tomllib/data/valid/multiline-basic-str \
2459 test/test_tools \
2460 test/test_ttk \
2461 test/test_unittest \
2462 test/test_unittest/testmock \
2463 test/test_warnings \
2464 test/test_warnings/data \
2465 test/test_zipfile \
2466 test/test_zipfile/_path \
2467 test/test_zoneinfo \
2468 test/test_zoneinfo/data \
2469 test/tkinterdata \
2470 test/tokenizedata \
2471 test/tracedmodules \
2472 test/typinganndata \
2473 test/wheeldata \
2474 test/xmltestdata \
2475 test/xmltestdata/c14n-20
2476
2477 COMPILEALL_OPTS=-j0
2478
2479 TEST_MODULES=@TEST_MODULES@
2480
2481 .PHONY: libinstall
2482 libinstall: all $(srcdir)/Modules/xxmodule.c
2483 @for i in $(SCRIPTDIR) $(LIBDEST); \
2484 do \
2485 if test ! -d $(DESTDIR)$$i; then \
2486 echo "Creating directory $$i"; \
2487 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
2488 else true; \
2489 fi; \
2490 done
2491 @if test "$(TEST_MODULES)" = yes; then \
2492 subdirs="$(LIBSUBDIRS) $(TESTSUBDIRS)"; \
2493 else \
2494 subdirs="$(LIBSUBDIRS)"; \
2495 fi; \
2496 for d in $$subdirs; \
2497 do \
2498 a=$(srcdir)/Lib/$$d; \
2499 if test ! -d $$a; then continue; else true; fi; \
2500 b=$(LIBDEST)/$$d; \
2501 if test ! -d $(DESTDIR)$$b; then \
2502 echo "Creating directory $$b"; \
2503 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
2504 else true; \
2505 fi; \
2506 done
2507 @for i in $(srcdir)/Lib/*.py; \
2508 do \
2509 if test -x $$i; then \
2510 $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
2511 echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
2512 else \
2513 $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
2514 echo $(INSTALL_DATA) $$i $(LIBDEST); \
2515 fi; \
2516 done
2517 @if test "$(TEST_MODULES)" = yes; then \
2518 subdirs="$(LIBSUBDIRS) $(TESTSUBDIRS)"; \
2519 else \
2520 subdirs="$(LIBSUBDIRS)"; \
2521 fi; \
2522 for d in $$subdirs; \
2523 do \
2524 a=$(srcdir)/Lib/$$d; \
2525 if test ! -d $$a; then continue; else true; fi; \
2526 if test `ls $$a | wc -l` -lt 1; then continue; fi; \
2527 b=$(LIBDEST)/$$d; \
2528 for i in $$a/*; \
2529 do \
2530 case $$i in \
2531 *CVS) ;; \
2532 *.py[co]) ;; \
2533 *.orig) ;; \
2534 *~) ;; \
2535 *) \
2536 if test -d $$i; then continue; fi; \
2537 if test -x $$i; then \
2538 echo $(INSTALL_SCRIPT) $$i $$b; \
2539 $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
2540 else \
2541 echo $(INSTALL_DATA) $$i $$b; \
2542 $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
2543 fi;; \
2544 esac; \
2545 done; \
2546 done
2547 $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \
2548 $(DESTDIR)$(LIBDEST); \
2549 $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
2550 @ # Build PYC files for the 3 optimization levels (0, 1, 2)
2551 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
2552 $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
2553 -o 0 -o 1 -o 2 $(COMPILEALL_OPTS) -d $(LIBDEST) -f \
2554 -x 'bad_coding|badsyntax|site-packages' \
2555 $(DESTDIR)$(LIBDEST)
2556 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
2557 $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
2558 -o 0 -o 1 -o 2 $(COMPILEALL_OPTS) -d $(LIBDEST)/site-packages -f \
2559 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
2560
2561 # bpo-21536: Misc/python-config.sh is generated in the build directory
2562 # from $(srcdir)Misc/python-config.sh.in.
2563 python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
2564 @ # Substitution happens here, as the completely-expanded BINDIR
2565 @ # is not available in configure
2566 sed -e "s,@EXENAME@,$(EXENAME)," < $(srcdir)/Misc/python-config.in >python-config.py
2567 @ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
2568 LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config
2569 @ # On Darwin, always use the python version of the script, the shell
2570 @ # version doesn't use the compiler customizations that are provided
2571 @ # in python (_osx_support.py).
2572 @if test `uname -s` = Darwin; then \
2573 cp python-config.py python-config; \
2574 fi
2575
2576 # macOS' make seems to ignore a dependency on a
2577 # "$(BUILD_SCRIPTS_DIR): $(MKDIR_P) $@" rule.
2578 BUILD_SCRIPTS_DIR=build/scripts-$(VERSION)
2579 SCRIPT_IDLE=$(BUILD_SCRIPTS_DIR)/idle$(VERSION)
2580 SCRIPT_PYDOC=$(BUILD_SCRIPTS_DIR)/pydoc$(VERSION)
2581
2582 $(SCRIPT_IDLE): $(srcdir)/Tools/scripts/idle3
2583 @$(MKDIR_P) $(BUILD_SCRIPTS_DIR)
2584 sed -e "s,/usr/bin/env python3,$(EXENAME)," < $(srcdir)/Tools/scripts/idle3 > $@
2585 @chmod +x $@
2586
2587 $(SCRIPT_PYDOC): $(srcdir)/Tools/scripts/pydoc3
2588 @$(MKDIR_P) $(BUILD_SCRIPTS_DIR)
2589 sed -e "s,/usr/bin/env python3,$(EXENAME)," < $(srcdir)/Tools/scripts/pydoc3 > $@
2590 @chmod +x $@
2591
2592 .PHONY: scripts
2593 scripts: $(SCRIPT_IDLE) $(SCRIPT_PYDOC) python-config
2594
2595 # Install the include files
2596 INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
2597
2598 .PHONY: inclinstall
2599 inclinstall:
2600 @for i in $(INCLDIRSTOMAKE); \
2601 do \
2602 if test ! -d $(DESTDIR)$$i; then \
2603 echo "Creating directory $$i"; \
2604 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
2605 else true; \
2606 fi; \
2607 done
2608 @if test ! -d $(DESTDIR)$(INCLUDEPY)/cpython; then \
2609 echo "Creating directory $(DESTDIR)$(INCLUDEPY)/cpython"; \
2610 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/cpython; \
2611 else true; \
2612 fi
2613 @if test ! -d $(DESTDIR)$(INCLUDEPY)/internal; then \
2614 echo "Creating directory $(DESTDIR)$(INCLUDEPY)/internal"; \
2615 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/internal; \
2616 else true; \
2617 fi
2618 @for i in $(srcdir)/Include/*.h; \
2619 do \
2620 echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
2621 $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
2622 done
2623 @for i in $(srcdir)/Include/cpython/*.h; \
2624 do \
2625 echo $(INSTALL_DATA) $$i $(INCLUDEPY)/cpython; \
2626 $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/cpython; \
2627 done
2628 @for i in $(srcdir)/Include/internal/*.h; \
2629 do \
2630 echo $(INSTALL_DATA) $$i $(INCLUDEPY)/internal; \
2631 $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/internal; \
2632 done
2633 $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
2634
2635 # Install the library and miscellaneous stuff needed for extending/embedding
2636 # This goes into $(exec_prefix)
2637 LIBPL= @LIBPL@
2638
2639 # pkgconfig directory
2640 LIBPC= $(LIBDIR)/pkgconfig
2641
2642 .PHONY: libainstall
2643 libainstall: all scripts
2644 @for i in $(LIBDIR) $(LIBPL) $(LIBPC) $(BINDIR); \
2645 do \
2646 if test ! -d $(DESTDIR)$$i; then \
2647 echo "Creating directory $$i"; \
2648 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
2649 else true; \
2650 fi; \
2651 done
2652 @if test "$(STATIC_LIBPYTHON)" = 1; then \
2653 if test -d $(LIBRARY); then :; else \
2654 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
2655 if test "$(SHLIB_SUFFIX)" = .dll; then \
2656 $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
2657 else \
2658 $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
2659 fi; \
2660 else \
2661 echo Skip install of $(LIBRARY) - use make frameworkinstall; \
2662 fi; \
2663 fi; \
2664 $(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o; \
2665 fi
2666 $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
2667 $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
2668 $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
2669 $(INSTALL_DATA) $(srcdir)/Modules/Setup $(DESTDIR)$(LIBPL)/Setup
2670 $(INSTALL_DATA) Modules/Setup.bootstrap $(DESTDIR)$(LIBPL)/Setup.bootstrap
2671 $(INSTALL_DATA) Modules/Setup.stdlib $(DESTDIR)$(LIBPL)/Setup.stdlib
2672 $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
2673 $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
2674 $(INSTALL_DATA) Misc/python-embed.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)-embed.pc
2675 $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
2676 $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
2677 $(INSTALL_SCRIPT) python-config.py $(DESTDIR)$(LIBPL)/python-config.py
2678 $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(LDVERSION)-config
2679 $(INSTALL_SCRIPT) $(SCRIPT_IDLE) $(DESTDIR)$(BINDIR)/idle$(VERSION)
2680 $(INSTALL_SCRIPT) $(SCRIPT_PYDOC) $(DESTDIR)$(BINDIR)/pydoc$(VERSION)
2681 @if [ -s Modules/python.exp -a \
2682 "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
2683 echo; echo "Installing support files for building shared extension modules on AIX:"; \
2684 $(INSTALL_DATA) Modules/python.exp \
2685 $(DESTDIR)$(LIBPL)/python.exp; \
2686 echo; echo "$(LIBPL)/python.exp"; \
2687 $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \
2688 $(DESTDIR)$(LIBPL)/makexp_aix; \
2689 echo "$(LIBPL)/makexp_aix"; \
2690 $(INSTALL_SCRIPT) Modules/ld_so_aix \
2691 $(DESTDIR)$(LIBPL)/ld_so_aix; \
2692 echo "$(LIBPL)/ld_so_aix"; \
2693 echo; echo "See Misc/README.AIX for details."; \
2694 else true; \
2695 fi
2696
2697 # Here are a couple of targets for MacOSX again, to install a full
2698 # framework-based Python. frameworkinstall installs everything, the
2699 # subtargets install specific parts. Much of the actual work is offloaded to
2700 # the Makefile in Mac
2701 #
2702 #
2703 # This target is here for backward compatibility, previous versions of Python
2704 # hadn't integrated framework installation in the normal install process.
2705 .PHONY: frameworkinstall
2706 frameworkinstall: install
2707
2708 # On install, we re-make the framework
2709 # structure in the install location, /Library/Frameworks/ or the argument to
2710 # --enable-framework. If --enable-framework has been specified then we have
2711 # automatically set prefix to the location deep down in the framework, so we
2712 # only have to cater for the structural bits of the framework.
2713
2714 .PHONY: frameworkinstallframework
2715 frameworkinstallframework: @FRAMEWORKINSTALLFIRST@ install frameworkinstallmaclib
2716
2717 # macOS uses a versioned frameworks structure that includes a full install
2718 .PHONY: frameworkinstallversionedstructure
2719 frameworkinstallversionedstructure: $(LDLIBRARY)
2720 @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
2721 echo Not configured with --enable-framework; \
2722 exit 1; \
2723 else true; \
2724 fi
2725 @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
2726 if test ! -d $(DESTDIR)$$i; then \
2727 echo "Creating directory $(DESTDIR)$$i"; \
2728 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
2729 else true; \
2730 fi; \
2731 done
2732 $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
2733 sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
2734 $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
2735 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
2736 $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
2737 $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
2738 $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
2739
2740 # iOS/tvOS/watchOS uses a non-versioned framework with Info.plist in the
2741 # framework root, no .lproj data, and only stub compilation assistance binaries
2742 .PHONY: frameworkinstallunversionedstructure
2743 frameworkinstallunversionedstructure: $(LDLIBRARY)
2744 @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
2745 echo Not configured with --enable-framework; \
2746 exit 1; \
2747 else true; \
2748 fi
2749 if test -d $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/include; then \
2750 echo "Clearing stale header symlink directory"; \
2751 rm -rf $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/include; \
2752 fi
2753 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)
2754 sed 's/%VERSION%/'"`$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Info.plist
2755 $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
2756 $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(BINDIR)
2757 for file in $(srcdir)/$(RESSRCDIR)/bin/* ; do \
2758 $(INSTALL) -m $(EXEMODE) $$file $(DESTDIR)$(BINDIR); \
2759 done
2760
2761 # This installs Mac/Lib into the framework
2762 # Install a number of symlinks to keep software that expects a normal unix
2763 # install (which includes python-config) happy.
2764 .PHONY: frameworkinstallmaclib
2765 frameworkinstallmaclib:
2766 $(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(LDVERSION).a"
2767 $(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(LDVERSION).dylib"
2768 $(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(VERSION).a"
2769 $(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(VERSION).dylib"
2770 $(LN) -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(LDVERSION).dylib"
2771 $(LN) -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(VERSION).dylib"
2772
2773 # This installs the IDE, the Launcher and other apps into /Applications
2774 .PHONY: frameworkinstallapps
2775 frameworkinstallapps:
2776 cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
2777
2778 # Build the bootstrap executable that will spawn the interpreter inside
2779 # an app bundle within the framework. This allows the interpreter to
2780 # run OS X GUI APIs.
2781 .PHONY: frameworkpythonw
2782 frameworkpythonw:
2783 cd Mac && $(MAKE) pythonw
2784
2785 # This installs the python* and other bin symlinks in $prefix/bin or in
2786 # a bin directory relative to the framework root
2787 .PHONY: frameworkinstallunixtools
2788 frameworkinstallunixtools:
2789 cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
2790
2791 .PHONY: frameworkaltinstallunixtools
2792 frameworkaltinstallunixtools:
2793 cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"
2794
2795 # This installs the Tools into the applications directory.
2796 # It is not part of a normal frameworkinstall
2797 .PHONY: frameworkinstallextras
2798 frameworkinstallextras:
2799 cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)"
2800
2801 # On iOS, bin/lib can't live inside the framework; include needs to be called
2802 # "Headers", but *must* be in the framework, and *not* include the `python3.X`
2803 # subdirectory. The install has put these folders in the same folder as
2804 # Python.framework; Move the headers to their final framework-compatible home.
2805 .PHONY: frameworkinstallmobileheaders
2806 frameworkinstallmobileheaders: frameworkinstallunversionedstructure inclinstall
2807 if test -d $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers; then \
2808 echo "Removing old framework headers"; \
2809 rm -rf $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers; \
2810 fi
2811 mv "$(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/include/python$(LDVERSION)" "$(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers"
2812 $(LN) -fs "../$(PYTHONFRAMEWORKDIR)/Headers" "$(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/include/python$(LDVERSION)"
2813
2814 # Build the toplevel Makefile
2815 Makefile.pre: $(srcdir)/Makefile.pre.in config.status
2816 CONFIG_FILES=Makefile.pre CONFIG_HEADERS= ./config.status
2817 $(MAKE) -f Makefile.pre Makefile
2818
2819 # Run the configure script.
2820 config.status: $(srcdir)/configure
2821 $(srcdir)/configure $(CONFIG_ARGS)
2822
2823 .PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
2824
2825 Python/asm_trampoline.o: $(srcdir)/Python/asm_trampoline.S
2826 $(CC) -c $(PY_CORE_CFLAGS) -o $@ $<
2827
2828
2829 JIT_DEPS = \
2830 $(srcdir)/Tools/jit/*.c \
2831 $(srcdir)/Tools/jit/*.py \
2832 $(srcdir)/Python/executor_cases.c.h \
2833 pyconfig.h
2834
2835 jit_stencils.h: $(JIT_DEPS)
2836 @REGEN_JIT_COMMAND@
2837
2838 Python/jit.o: $(srcdir)/Python/jit.c @JIT_STENCILS_H@
2839 $(CC) -c $(PY_CORE_CFLAGS) -o $@ $<
2840
2841 .PHONY: regen-jit
2842 regen-jit:
2843 @REGEN_JIT_COMMAND@
2844
2845 # Some make's put the object file in the current directory
2846 .c.o:
2847 $(CC) -c $(PY_CORE_CFLAGS) -o $@ $<
2848
2849 # bpo-30104: dtoa.c uses union to cast double to unsigned long[2]. clang 4.0
2850 # with -O2 or higher and strict aliasing miscompiles the ratio() function
2851 # causing rounding issues. Compile dtoa.c using -fno-strict-aliasing on clang.
2852 # https://bugs.llvm.org//show_bug.cgi?id=31928
2853 Python/dtoa.o: Python/dtoa.c
2854 $(CC) -c $(PY_CORE_CFLAGS) $(CFLAGS_ALIASING) -o $@ $<
2855
2856 # Run reindent on the library
2857 .PHONY: reindent
2858 reindent:
2859 ./$(BUILDPYTHON) $(srcdir)/Tools/patchcheck/reindent.py -r $(srcdir)/Lib
2860
2861 # Rerun configure with the same options as it was run last time,
2862 # provided the config.status script exists
2863 .PHONY: recheck
2864 recheck:
2865 ./config.status --recheck
2866 ./config.status
2867
2868 # Regenerate configure and pyconfig.h.in
2869 .PHONY: autoconf
2870 autoconf:
2871 (cd $(srcdir); autoreconf -ivf -Werror)
2872
2873 .PHONY: regen-configure
2874 regen-configure:
2875 $(srcdir)/Tools/build/regen-configure.sh
2876
2877 .PHONY: regen-sbom
2878 regen-sbom:
2879 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/generate_sbom.py
2880
2881 # Create a tags file for vi
2882 tags::
2883 ctags -w $(srcdir)/Include/*.h $(srcdir)/Include/cpython/*.h $(srcdir)/Include/internal/*.h
2884 for i in $(SRCDIRS); do ctags -f tags -w -a $(srcdir)/$$i/*.[ch]; done
2885 ctags -f tags -w -a $(srcdir)/Modules/_ctypes/*.[ch]
2886 find $(srcdir)/Lib -type f -name "*.py" -not -name "test_*.py" -not -path "*/test/*" -not -path "*/tests/*" -not -path "*/*_test/*" | ctags -f tags -w -a -L -
2887 LC_ALL=C sort -o tags tags
2888
2889 # Create a tags file for GNU Emacs
2890 TAGS::
2891 cd $(srcdir); \
2892 etags Include/*.h Include/cpython/*.h Include/internal/*.h; \
2893 for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
2894 etags -a $(srcdir)/Modules/_ctypes/*.[ch]
2895 find $(srcdir)/Lib -type f -name "*.py" -not -name "test_*.py" -not -path "*/test/*" -not -path "*/tests/*" -not -path "*/*_test/*" | etags - -a
2896
2897 # Sanitation targets -- clean leaves libraries, executables and tags
2898 # files, which clobber removes as well
2899 .PHONY: pycremoval
2900 pycremoval:
2901 -find $(srcdir) -depth -name '__pycache__' -exec rm -rf {} ';'
2902 -find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
2903
2904 .PHONY: rmtestturds
2905 rmtestturds:
2906 -rm -f *BAD *GOOD *SKIPPED
2907 -rm -rf OUT
2908 -rm -f *.TXT
2909 -rm -f *.txt
2910 -rm -f gb-18030-2000.xml
2911
2912 .PHONY: docclean
2913 docclean:
2914 $(MAKE) -C $(srcdir)/Doc clean
2915
2916 # like the 'clean' target but retain the profile guided optimization (PGO)
2917 # data. The PGO data is only valid if source code remains unchanged.
2918 .PHONY: clean-retain-profile
2919 clean-retain-profile: pycremoval
2920 find . -name '*.[oa]' -exec rm -f {} ';'
2921 find . -name '*.s[ol]' -exec rm -f {} ';'
2922 find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
2923 find . -name '*.lto' -exec rm -f {} ';'
2924 find . -name '*.wasm' -exec rm -f {} ';'
2925 find . -name '*.lst' -exec rm -f {} ';'
2926 find build -name 'fficonfig.h' -exec rm -f {} ';' || true
2927 find build -name '*.py' -exec rm -f {} ';' || true
2928 find build -name '*.py[co]' -exec rm -f {} ';' || true
2929 -rm -f pybuilddir.txt
2930 -rm -f _bootstrap_python
2931 -rm -f python.html python*.js python.data python*.symbols python*.map
2932 -rm -f $(WASM_STDLIB)
2933 -rm -f Programs/_testembed Programs/_freeze_module
2934 -rm -rf Python/deepfreeze
2935 -rm -f Python/frozen_modules/*.h
2936 -rm -f Python/frozen_modules/MANIFEST
2937 -rm -f jit_stencils.h
2938 -find build -type f -a ! -name '*.gc??' -exec rm -f {} ';'
2939 -rm -f Include/pydtrace_probes.h
2940 -rm -f profile-gen-stamp
2941 -rm -rf iOS/testbed/Python.xcframework/ios-*/bin
2942 -rm -rf iOS/testbed/Python.xcframework/ios-*/lib
2943 -rm -rf iOS/testbed/Python.xcframework/ios-*/include
2944 -rm -rf iOS/testbed/Python.xcframework/ios-*/Python.framework
2945
2946 .PHONY: profile-removal
2947 profile-removal:
2948 find . -name '*.gc??' -exec rm -f {} ';'
2949 find . -name '*.profclang?' -exec rm -f {} ';'
2950 find . -name '*.dyn' -exec rm -f {} ';'
2951 rm -f $(COVERAGE_INFO)
2952 rm -rf $(COVERAGE_REPORT)
2953 rm -f profile-run-stamp
2954 rm -f profile-bolt-stamp
2955
2956 .PHONY: clean
2957 clean: clean-retain-profile clean-bolt
2958 @if test @DEF_MAKE_ALL_RULE@ = profile-opt -o @DEF_MAKE_ALL_RULE@ = bolt-opt; then \
2959 rm -f profile-gen-stamp profile-clean-stamp; \
2960 $(MAKE) profile-removal; \
2961 fi
2962
2963 .PHONY: clobber
2964 clobber: clean
2965 -rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
2966 tags TAGS \
2967 config.cache config.log pyconfig.h Modules/config.c
2968 -rm -rf build platform
2969 -rm -rf $(PYTHONFRAMEWORKDIR)
2970 -rm -rf iOS/Frameworks
2971 -rm -rf iOSTestbed.*
2972 -rm -f python-config.py python-config
2973 -rm -rf cross-build
2974
2975 # Make things extra clean, before making a distribution:
2976 # remove all generated files, even Makefile[.pre]
2977 # Keep configure and Python-ast.[ch], it's possible they can't be generated
2978 .PHONY: distclean
2979 distclean: clobber docclean
2980 for file in $(srcdir)/Lib/test/data/* ; do \
2981 if test "$$file" != "$(srcdir)/Lib/test/data/README"; then rm "$$file"; fi; \
2982 done
2983 -rm -f core Makefile Makefile.pre config.status Modules/Setup.local \
2984 Modules/Setup.bootstrap Modules/Setup.stdlib \
2985 Modules/ld_so_aix Modules/python.exp Misc/python.pc \
2986 Misc/python-embed.pc Misc/python-config.sh
2987 -rm -f python*-gdb.py
2988 # Issue #28258: set LC_ALL to avoid issues with Estonian locale.
2989 # Expansion is performed here by shell (spawned by make) itself before
2990 # arguments are passed to find. So LC_ALL=C must be set as a separate
2991 # command.
2992 LC_ALL=C; find $(srcdir)/[a-zA-Z]* '(' -name '*.fdc' -o -name '*~' \
2993 -o -name '[@,#]*' -o -name '*.old' \
2994 -o -name '*.orig' -o -name '*.rej' \
2995 -o -name '*.bak' ')' \
2996 -exec rm -f {} ';'
2997
2998 # Check that all symbols exported by libpython start with "Py" or "_Py"
2999 .PHONY: smelly
3000 smelly: all
3001 $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/build/smelly.py
3002
3003 # Check if any unsupported C global variables have been added.
3004 .PHONY: check-c-globals
3005 check-c-globals:
3006 $(PYTHON_FOR_REGEN) $(srcdir)/Tools/c-analyzer/check-c-globals.py \
3007 --format summary \
3008 --traceback
3009
3010 # Find files with funny names
3011 .PHONY: funny
3012 funny:
3013 find $(SUBDIRS) $(SUBDIRSTOO) \
3014 -type d \
3015 -o -name '*.[chs]' \
3016 -o -name '*.py' \
3017 -o -name '*.pyw' \
3018 -o -name '*.dat' \
3019 -o -name '*.el' \
3020 -o -name '*.fd' \
3021 -o -name '*.in' \
3022 -o -name '*.gif' \
3023 -o -name '*.txt' \
3024 -o -name '*.xml' \
3025 -o -name '*.xbm' \
3026 -o -name '*.xpm' \
3027 -o -name '*.uue' \
3028 -o -name '*.decTest' \
3029 -o -name '*.tmCommand' \
3030 -o -name '*.tmSnippet' \
3031 -o -name 'Setup' \
3032 -o -name 'Setup.*' \
3033 -o -name README \
3034 -o -name NEWS \
3035 -o -name HISTORY \
3036 -o -name Makefile \
3037 -o -name ChangeLog \
3038 -o -name .hgignore \
3039 -o -name MANIFEST \
3040 -o -print
3041
3042 # Perform some verification checks on any modified files.
3043 .PHONY: patchcheck
3044 patchcheck: all
3045 $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/patchcheck/patchcheck.py
3046
3047 .PHONY: check-limited-abi
3048 check-limited-abi: all
3049 $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/build/stable_abi.py --all $(srcdir)/Misc/stable_abi.toml
3050
3051 .PHONY: update-config
3052 update-config:
3053 curl -sL -o config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
3054 curl -sL -o config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
3055 chmod +x config.guess config.sub
3056
3057 # Dependencies
3058
3059 Python/thread.o: @THREADHEADERS@ $(srcdir)/Python/condvar.h
3060
3061 ##########################################################################
3062 # Module dependencies and platform-specific files
3063
3064 # force rebuild when header file or module build flavor (static/shared) is changed
3065 MODULE_DEPS_STATIC=Modules/config.c
3066 MODULE_DEPS_SHARED=@MODULE_DEPS_SHARED@
3067
3068 MODULE__CURSES_DEPS=$(srcdir)/Include/py_curses.h
3069 MODULE__CURSES_PANEL_DEPS=$(srcdir)/Include/py_curses.h
3070 MODULE__DATETIME_DEPS=$(srcdir)/Include/datetime.h
3071 MODULE_CMATH_DEPS=$(srcdir)/Modules/_math.h
3072 MODULE_MATH_DEPS=$(srcdir)/Modules/_math.h
3073 MODULE_PYEXPAT_DEPS=@LIBEXPAT_INTERNAL@
3074 MODULE_UNICODEDATA_DEPS=$(srcdir)/Modules/unicodedata_db.h $(srcdir)/Modules/unicodename_db.h
3075 MODULE__BLAKE2_DEPS=$(srcdir)/Modules/_blake2/impl/blake2-config.h $(srcdir)/Modules/_blake2/impl/blake2-impl.h $(srcdir)/Modules/_blake2/impl/blake2.h $(srcdir)/Modules/_blake2/impl/blake2b-load-sse2.h $(srcdir)/Modules/_blake2/impl/blake2b-load-sse41.h $(srcdir)/Modules/_blake2/impl/blake2b-ref.c $(srcdir)/Modules/_blake2/impl/blake2b-round.h $(srcdir)/Modules/_blake2/impl/blake2b.c $(srcdir)/Modules/_blake2/impl/blake2s-load-sse2.h $(srcdir)/Modules/_blake2/impl/blake2s-load-sse41.h $(srcdir)/Modules/_blake2/impl/blake2s-load-xop.h $(srcdir)/Modules/_blake2/impl/blake2s-ref.c $(srcdir)/Modules/_blake2/impl/blake2s-round.h $(srcdir)/Modules/_blake2/impl/blake2s.c $(srcdir)/Modules/_blake2/blake2module.h $(srcdir)/Modules/hashlib.h
3076 MODULE__CTYPES_DEPS=$(srcdir)/Modules/_ctypes/ctypes.h
3077 MODULE__CTYPES_MALLOC_CLOSURE=@MODULE__CTYPES_MALLOC_CLOSURE@
3078 MODULE__DECIMAL_DEPS=$(srcdir)/Modules/_decimal/docstrings.h @LIBMPDEC_INTERNAL@
3079 MODULE__ELEMENTTREE_DEPS=$(srcdir)/Modules/pyexpat.c @LIBEXPAT_INTERNAL@
3080 MODULE__HASHLIB_DEPS=$(srcdir)/Modules/hashlib.h
3081 MODULE__IO_DEPS=$(srcdir)/Modules/_io/_iomodule.h
3082 MODULE__MD5_DEPS=$(srcdir)/Modules/hashlib.h $(LIBHACL_HEADERS) Modules/_hacl/Hacl_Hash_MD5.h Modules/_hacl/Hacl_Hash_MD5.c
3083 MODULE__SHA1_DEPS=$(srcdir)/Modules/hashlib.h $(LIBHACL_HEADERS) Modules/_hacl/Hacl_Hash_SHA1.h Modules/_hacl/Hacl_Hash_SHA1.c
3084 MODULE__SHA2_DEPS=$(srcdir)/Modules/hashlib.h $(LIBHACL_SHA2_HEADERS) $(LIBHACL_SHA2_A)
3085 MODULE__SHA3_DEPS=$(srcdir)/Modules/hashlib.h $(LIBHACL_HEADERS) Modules/_hacl/Hacl_Hash_SHA3.h Modules/_hacl/Hacl_Hash_SHA3.c
3086 MODULE__SOCKET_DEPS=$(srcdir)/Modules/socketmodule.h $(srcdir)/Modules/addrinfo.h $(srcdir)/Modules/getaddrinfo.c $(srcdir)/Modules/getnameinfo.c
3087 MODULE__SSL_DEPS=$(srcdir)/Modules/_ssl.h $(srcdir)/Modules/_ssl/cert.c $(srcdir)/Modules/_ssl/debughelpers.c $(srcdir)/Modules/_ssl/misc.c $(srcdir)/Modules/_ssl_data_111.h $(srcdir)/Modules/_ssl_data_300.h $(srcdir)/Modules/socketmodule.h
3088 MODULE__TESTCAPI_DEPS=$(srcdir)/Modules/_testcapi/parts.h $(srcdir)/Modules/_testcapi/util.h
3089 MODULE__TESTLIMITEDCAPI_DEPS=$(srcdir)/Modules/_testlimitedcapi/testcapi_long.h $(srcdir)/Modules/_testlimitedcapi/parts.h $(srcdir)/Modules/_testlimitedcapi/util.h
3090 MODULE__TESTINTERNALCAPI_DEPS=$(srcdir)/Modules/_testinternalcapi/parts.h
3091 MODULE__SQLITE3_DEPS=$(srcdir)/Modules/_sqlite/connection.h $(srcdir)/Modules/_sqlite/cursor.h $(srcdir)/Modules/_sqlite/microprotocols.h $(srcdir)/Modules/_sqlite/module.h $(srcdir)/Modules/_sqlite/prepare_protocol.h $(srcdir)/Modules/_sqlite/row.h $(srcdir)/Modules/_sqlite/util.h
3092
3093 CODECS_COMMON_HEADERS=$(srcdir)/Modules/cjkcodecs/multibytecodec.h $(srcdir)/Modules/cjkcodecs/cjkcodecs.h
3094 MODULE__CODECS_CN_DEPS=$(srcdir)/Modules/cjkcodecs/mappings_cn.h $(CODECS_COMMON_HEADERS)
3095 MODULE__CODECS_HK_DEPS=$(srcdir)/Modules/cjkcodecs/mappings_hk.h $(CODECS_COMMON_HEADERS)
3096 MODULE__CODECS_ISO2022_DEPS=$(srcdir)/Modules/cjkcodecs/mappings_jisx0213_pair.h $(srcdir)/Modules/cjkcodecs/alg_jisx0201.h $(srcdir)/Modules/cjkcodecs/emu_jisx0213_2000.h $(CODECS_COMMON_HEADERS)
3097 MODULE__CODECS_JP_DEPS=$(srcdir)/Modules/cjkcodecs/mappings_jisx0213_pair.h $(srcdir)/Modules/cjkcodecs/alg_jisx0201.h $(srcdir)/Modules/cjkcodecs/emu_jisx0213_2000.h $(srcdir)/Modules/cjkcodecs/mappings_jp.h $(CODECS_COMMON_HEADERS)
3098 MODULE__CODECS_KR_DEPS=$(srcdir)/Modules/cjkcodecs/mappings_kr.h $(CODECS_COMMON_HEADERS)
3099 MODULE__CODECS_TW_DEPS=$(srcdir)/Modules/cjkcodecs/mappings_tw.h $(CODECS_COMMON_HEADERS)
3100 MODULE__MULTIBYTECODEC_DEPS=$(srcdir)/Modules/cjkcodecs/multibytecodec.h
3101
3102 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
3103 # Local Variables:
3104 # mode: makefile
3105 # End: