Makefile 90 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043
  1. # Generated automatically from Makefile.pre by makesetup.
  2. # Top-level Makefile for Python
  3. #
  4. # As distributed, this file is called Makefile.pre.in; it is processed
  5. # into the real Makefile by running the script ./configure, which
  6. # replaces things like @spam@ with values appropriate for your system.
  7. # This means that if you edit Makefile, your changes get lost the next
  8. # time you run the configure script. Ideally, you can do:
  9. #
  10. # ./configure
  11. # make
  12. # make test
  13. # make install
  14. #
  15. # If you have a previous version of Python installed that you don't
  16. # want to overwrite, you can use "make altinstall" instead of "make
  17. # install". Refer to the "Installing" section in the README file for
  18. # additional details.
  19. #
  20. # See also the section "Build instructions" in the README file.
  21. # === Variables set by makesetup ===
  22. MODBUILT_NAMES= posix errno pwd _sre _codecs _weakref _functools _operator _collections _abc itertools atexit _signal _stat time _thread _locale _io faulthandler _tracemalloc _peg_parser _symtable xxsubtype
  23. MODDISABLED_NAMES=
  24. MODOBJS= Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/_weakref.o Modules/_functoolsmodule.o Modules/_operator.o Modules/_collectionsmodule.o Modules/_abc.o Modules/itertoolsmodule.o Modules/atexitmodule.o Modules/signalmodule.o Modules/_stat.o Modules/timemodule.o Modules/_threadmodule.o Modules/_localemodule.o Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o Modules/faulthandler.o Modules/_tracemalloc.o Modules/_peg_parser.o Modules/symtablemodule.o Modules/xxsubtype.o
  25. MODLIBS= $(LOCALMODLIBS) $(BASEMODLIBS)
  26. # === Variables set by configure
  27. VERSION= 3.9
  28. srcdir= /croot/python-split_1688589050410/work
  29. VPATH= /croot/python-split_1688589050410/work
  30. abs_srcdir= /croot/python-split_1688589050410/work
  31. abs_builddir= /croot/python-split_1688589050410/work/build-static
  32. CC= x86_64-conda-linux-gnu-gcc -pthread
  33. CXX= x86_64-conda-linux-gnu-c++ -pthread
  34. MAINCC= $(CC)
  35. LINKCC= $(PURIFY) $(MAINCC)
  36. AR= x86_64-conda-linux-gnu-ar
  37. READELF= x86_64-conda-linux-gnu-readelf
  38. SOABI= cpython-39-x86_64-linux-gnu
  39. LDVERSION= $(VERSION)$(ABIFLAGS)
  40. LIBPYTHON=
  41. GITVERSION=
  42. GITTAG=
  43. GITBRANCH=
  44. PGO_PROF_GEN_FLAG=-fprofile-generate
  45. PGO_PROF_USE_FLAG=
  46. LLVM_PROF_MERGER=true
  47. LLVM_PROF_FILE=
  48. LLVM_PROF_ERR=no
  49. DTRACE=
  50. DFLAGS=
  51. DTRACE_HEADERS=
  52. DTRACE_OBJS=
  53. GNULD= yes
  54. # Shell used by make (some versions default to the login shell, which is bad)
  55. SHELL= /bin/sh
  56. # Use this to make a link between python$(VERSION) and python in $(BINDIR)
  57. LN= ln
  58. # Portable install script (configure doesn't always guess right)
  59. INSTALL= /usr/bin/install -c
  60. INSTALL_PROGRAM=${INSTALL}
  61. INSTALL_SCRIPT= ${INSTALL}
  62. INSTALL_DATA= ${INSTALL} -m 644
  63. # Shared libraries must be installed with executable mode on some systems;
  64. # rather than figuring out exactly which, we always give them executable mode.
  65. INSTALL_SHARED= ${INSTALL} -m 755
  66. MKDIR_P= /usr/bin/mkdir -p
  67. MAKESETUP= $(srcdir)/Modules/makesetup
  68. # Compiler options
  69. OPT= -DNDEBUG -O2 -Wall
  70. BASECFLAGS= -Wno-unused-result -Wsign-compare
  71. BASECPPFLAGS= -IObjects -IInclude -IPython
  72. CONFIGURE_CFLAGS= -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include -I/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include
  73. # CFLAGS_NODIST is used for building the interpreter and stdlib C extensions.
  74. # Use it when a compiler flag should _not_ be part of the distutils CFLAGS
  75. # once Python is installed (Issue #21121).
  76. CONFIGURE_CFLAGS_NODIST= -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden
  77. # LDFLAGS_NODIST is used in the same manner as CFLAGS_NODIST.
  78. # Use it when a linker flag should _not_ be part of the distutils LDFLAGS
  79. # once Python is installed (bpo-35257)
  80. CONFIGURE_LDFLAGS_NODIST= -g
  81. CONFIGURE_CPPFLAGS= -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include -I/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include -I/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include
  82. CONFIGURE_LDFLAGS= -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib -Wl,-rpath-link,/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib -L/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib -L/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib
  83. # Avoid assigning CFLAGS, LDFLAGS, etc. so users can use them on the
  84. # command line to append to these values without stomping the pre-set
  85. # values.
  86. PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
  87. PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/internal
  88. # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
  89. # be able to build extension modules using the directories specified in the
  90. # environment variables
  91. PY_CPPFLAGS= $(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS)
  92. PY_LDFLAGS= $(CONFIGURE_LDFLAGS) $(LDFLAGS)
  93. PY_LDFLAGS_NODIST=$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)
  94. NO_AS_NEEDED= -Wl,--no-as-needed
  95. CCSHARED= -fPIC
  96. # LINKFORSHARED are the flags passed to the $(CC) command that links
  97. # the python executable -- this is only needed for a few systems
  98. LINKFORSHARED= -Xlinker -export-dynamic
  99. ARFLAGS= rcs
  100. # Extra C flags added for building the interpreter object files.
  101. CFLAGSFORSHARED=
  102. # C flags used for building the interpreter object files
  103. PY_STDMODULE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED)
  104. PY_BUILTIN_MODULE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN
  105. PY_CORE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE
  106. # Linker flags used for building the interpreter object files
  107. PY_CORE_LDFLAGS=$(PY_LDFLAGS) $(PY_LDFLAGS_NODIST)
  108. # Strict or non-strict aliasing flags used to compile dtoa.c, see above
  109. CFLAGS_ALIASING=
  110. # Machine-dependent subdirectories
  111. MACHDEP= linux
  112. # Multiarch directory (may be empty)
  113. MULTIARCH= x86_64-linux-gnu
  114. MULTIARCH_CPPFLAGS = -DMULTIARCH=\"x86_64-linux-gnu\"
  115. # Install prefix for architecture-independent files
  116. prefix= /croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac
  117. # Install prefix for architecture-dependent files
  118. exec_prefix= ${prefix}
  119. # Install prefix for data files
  120. datarootdir= ${prefix}/share
  121. # Expanded directories
  122. BINDIR= ${exec_prefix}/bin
  123. LIBDIR= ${exec_prefix}/lib
  124. MANDIR= ${datarootdir}/man
  125. INCLUDEDIR= ${prefix}/include
  126. CONFINCLUDEDIR= $(exec_prefix)/include
  127. PLATLIBDIR= lib
  128. SCRIPTDIR= $(prefix)/$(PLATLIBDIR)
  129. ABIFLAGS=
  130. # Detailed destination directories
  131. BINLIBDEST= ${exec_prefix}/${PLATLIBDIR}/python$(VERSION)
  132. LIBDEST= $(SCRIPTDIR)/python$(VERSION)
  133. INCLUDEPY= $(INCLUDEDIR)/python$(LDVERSION)
  134. CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION)
  135. # Symbols used for using shared libraries
  136. SHLIB_SUFFIX= .so
  137. EXT_SUFFIX= .cpython-39-x86_64-linux-gnu.so
  138. LDSHARED= $(CC) -shared $(PY_LDFLAGS)
  139. BLDSHARED= $(CC) -shared $(PY_CORE_LDFLAGS)
  140. LDCXXSHARED= $(CXX) -shared
  141. DESTSHARED= $(BINLIBDEST)/lib-dynload
  142. # List of exported symbols for AIX
  143. EXPORTSYMS=
  144. EXPORTSFROM=
  145. # Executable suffix (.exe on Windows and Mac OS X)
  146. EXE=
  147. BUILDEXE=
  148. # Short name and location for Mac OS X Python framework
  149. UNIVERSALSDK=
  150. PYTHONFRAMEWORK=
  151. PYTHONFRAMEWORKDIR= no-framework
  152. PYTHONFRAMEWORKPREFIX=
  153. PYTHONFRAMEWORKINSTALLDIR=
  154. # Deployment target selected during configure, to be checked
  155. # by distutils. The export statement is needed to ensure that the
  156. # deployment target is active during build.
  157. MACOSX_DEPLOYMENT_TARGET=
  158. #export MACOSX_DEPLOYMENT_TARGET
  159. # Option to install to strip binaries
  160. STRIPFLAG=-s
  161. # Flags to lipo to produce a 32-bit-only universal executable
  162. LIPO_32BIT_FLAGS=
  163. # Flags to lipo to produce an intel-64-only universal executable
  164. LIPO_INTEL64_FLAGS=
  165. # Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
  166. OTHER_LIBTOOL_OPT=
  167. # Environment to run shared python without installed libraries
  168. RUNSHARED=
  169. # ensurepip options
  170. ENSUREPIP= no
  171. # OpenSSL options for setup.py so sysconfig can pick up AC_SUBST() vars.
  172. OPENSSL_INCLUDES=-I/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include
  173. OPENSSL_LIBS=-lssl -lcrypto
  174. OPENSSL_LDFLAGS=-L/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib
  175. # Default zoneinfo.TZPATH. Added here to expose it in sysconfig.get_config_var
  176. TZPATH=/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/share/zoneinfo
  177. # Modes for directories, executables and data files created by the
  178. # install process. Default to user-only-writable for all file types.
  179. DIRMODE= 755
  180. EXEMODE= 755
  181. FILEMODE= 644
  182. # configure script arguments
  183. CONFIG_ARGS= '--prefix=/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac' '--build=x86_64-conda-linux-gnu' '--host=x86_64-conda-linux-gnu' '--enable-ipv6' '--with-ensurepip=no' '--with-tzpath=/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/share/zoneinfo' '--with-computed-gotos' '--with-system-ffi' '--enable-loadable-sqlite-extensions' '--with-tcltk-includes=-I/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include' '--with-tcltk-libs=-L/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib -ltcl8.6 -ltk8.6' '--with-platlibdir=lib' '--with-openssl=/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac' 'PKG_CONFIG_LIBDIR=/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib' 'PKG_CONFIG_PATH=/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib' 'CPPFLAGS=-DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include -I/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include -I/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include' 'CXXFLAGS=-fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include -I/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include' 'CFLAGS=-march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include -I/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include' 'LDFLAGS=-Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib -Wl,-rpath-link,/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib -L/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib -L/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib' 'CC= x86_64-conda-linux-gnu-gcc' 'CXX=x86_64-conda-linux-gnu-c++' '--with-lto' '--enable-optimizations' '-oldincludedir=/usr/include' '--disable-shared' 'PROFILE_TASK=-m test --pgo' 'build_alias=x86_64-conda-linux-gnu' 'host_alias=x86_64-conda-linux-gnu' 'MACHDEP=linux' 'CPP=/croot/python-split_1688589050410/_build_env/bin/x86_64-conda-linux-gnu-cpp'
  184. # Subdirectories with code
  185. SRCDIRS= Parser Parser/pegen Objects Python Modules Modules/_io Programs
  186. # Other subdirectories
  187. SUBDIRSTOO= Include Lib Misc
  188. # Files and directories to be distributed
  189. CONFIGFILES= configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in
  190. DISTFILES= README.rst ChangeLog $(CONFIGFILES)
  191. DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
  192. DIST= $(DISTFILES) $(DISTDIRS)
  193. LIBRARY= libpython$(VERSION)$(ABIFLAGS).a
  194. LDLIBRARY= libpython$(VERSION)$(ABIFLAGS).a
  195. BLDLIBRARY= $(LDLIBRARY)
  196. PY3LIBRARY=
  197. DLLLIBRARY=
  198. LDLIBRARYDIR=
  199. INSTSONAME= $(LDLIBRARY)
  200. LIBS= -lcrypt -lpthread -ldl -lutil -lm
  201. LIBM= -lm
  202. LIBC=
  203. SYSLIBS= $(LIBM) $(LIBC)
  204. SHLIBS= $(LIBS)
  205. DLINCLDIR= .
  206. DYNLOADFILE= dynload_shlib.o
  207. MACHDEP_OBJS=
  208. LIBOBJDIR= Python/
  209. LIBOBJS=
  210. PYTHON= python$(EXE)
  211. BUILDPYTHON= python$(BUILDEXE)
  212. PYTHON_FOR_REGEN?=python3.9
  213. UPDATE_FILE=python3.9 $(srcdir)/Tools/scripts/update_file.py
  214. PY_BUILD_ENVIRON=
  215. PYTHON_FOR_BUILD=./$(BUILDPYTHON) -E
  216. _PYTHON_HOST_PLATFORM=linux-x86_64
  217. BUILD_GNU_TYPE= x86_64-conda-linux-gnu
  218. HOST_GNU_TYPE= x86_64-conda-linux-gnu
  219. # Tcl and Tk config info from --with-tcltk-includes and -libs options
  220. TCLTK_INCLUDES= -I/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include
  221. TCLTK_LIBS= -L/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib -ltcl8.6 -ltk8.6
  222. # The task to run while instrumented when building the profile-opt target.
  223. # To speed up profile generation, we don't run the full unit test suite
  224. # by default. The default is "-m test --pgo". To run more tests, use
  225. # PROFILE_TASK="-m test --pgo-extended"
  226. PROFILE_TASK= -m test --pgo
  227. # report files for gcov / lcov coverage report
  228. COVERAGE_INFO= $(abs_builddir)/coverage.info
  229. COVERAGE_REPORT=$(abs_builddir)/lcov-report
  230. COVERAGE_REPORT_OPTIONS=--no-branch-coverage --title "CPython lcov report"
  231. # === Definitions added by makesetup ===
  232. LOCALMODLIBS=
  233. BASEMODLIBS=
  234. PYTHONPATH=$(COREPYTHONPATH)
  235. COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)
  236. TESTPATH=
  237. SITEPATH=
  238. DESTPATH=
  239. MACHDESTLIB=$(BINLIBDEST)
  240. DESTLIB=$(LIBDEST)
  241. ##########################################################################
  242. # Modules
  243. MODULE_OBJS= \
  244. Modules/config.o \
  245. Modules/getpath.o \
  246. Modules/main.o \
  247. Modules/gcmodule.o
  248. IO_H= Modules/_io/_iomodule.h
  249. IO_OBJS= \
  250. Modules/_io/_iomodule.o \
  251. Modules/_io/iobase.o \
  252. Modules/_io/fileio.o \
  253. Modules/_io/bufferedio.o \
  254. Modules/_io/textio.o \
  255. Modules/_io/bytesio.o \
  256. Modules/_io/stringio.o
  257. ##########################################################################
  258. LIBFFI_INCLUDEDIR= /croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include
  259. ##########################################################################
  260. # Parser
  261. PEGEN_OBJS= \
  262. Parser/pegen/pegen.o \
  263. Parser/pegen/parse.o \
  264. Parser/pegen/parse_string.o \
  265. Parser/pegen/peg_api.o
  266. PEGEN_HEADERS= \
  267. $(srcdir)/Include/internal/pegen_interface.h \
  268. $(srcdir)/Parser/pegen/pegen.h \
  269. $(srcdir)/Parser/pegen/parse_string.h
  270. POBJS= \
  271. Parser/acceler.o \
  272. Parser/grammar1.o \
  273. Parser/listnode.o \
  274. Parser/node.o \
  275. Parser/parser.o \
  276. Parser/token.o \
  277. PARSER_OBJS= $(POBJS) $(PEGEN_OBJS) Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o
  278. PARSER_HEADERS= \
  279. $(PEGEN_HEADERS) \
  280. $(srcdir)/Include/grammar.h \
  281. $(srcdir)/Include/parsetok.h \
  282. $(srcdir)/Parser/parser.h \
  283. $(srcdir)/Parser/tokenizer.h
  284. ##########################################################################
  285. # Python
  286. PYTHON_OBJS= \
  287. Python/_warnings.o \
  288. Python/Python-ast.o \
  289. Python/asdl.o \
  290. Python/ast.o \
  291. Python/ast_opt.o \
  292. Python/ast_unparse.o \
  293. Python/bltinmodule.o \
  294. Python/ceval.o \
  295. Python/codecs.o \
  296. Python/compile.o \
  297. Python/context.o \
  298. Python/dynamic_annotations.o \
  299. Python/errors.o \
  300. Python/frozenmain.o \
  301. Python/future.o \
  302. Python/getargs.o \
  303. Python/getcompiler.o \
  304. Python/getcopyright.o \
  305. Python/getplatform.o \
  306. Python/getversion.o \
  307. Python/graminit.o \
  308. Python/hamt.o \
  309. Python/hashtable.o \
  310. Python/import.o \
  311. Python/importdl.o \
  312. Python/initconfig.o \
  313. Python/marshal.o \
  314. Python/modsupport.o \
  315. Python/mysnprintf.o \
  316. Python/mystrtoul.o \
  317. Python/pathconfig.o \
  318. Python/peephole.o \
  319. Python/preconfig.o \
  320. Python/pyarena.o \
  321. Python/pyctype.o \
  322. Python/pyfpe.o \
  323. Python/pyhash.o \
  324. Python/pylifecycle.o \
  325. Python/pymath.o \
  326. Python/pystate.o \
  327. Python/pythonrun.o \
  328. Python/pytime.o \
  329. Python/bootstrap_hash.o \
  330. Python/structmember.o \
  331. Python/symtable.o \
  332. Python/sysmodule.o \
  333. Python/thread.o \
  334. Python/traceback.o \
  335. Python/getopt.o \
  336. Python/pystrcmp.o \
  337. Python/pystrtod.o \
  338. Python/pystrhex.o \
  339. Python/dtoa.o \
  340. Python/formatter_unicode.o \
  341. Python/fileutils.o \
  342. Python/$(DYNLOADFILE) \
  343. $(LIBOBJS) \
  344. $(MACHDEP_OBJS) \
  345. $(DTRACE_OBJS)
  346. ##########################################################################
  347. # Objects
  348. OBJECT_OBJS= \
  349. Objects/abstract.o \
  350. Objects/accu.o \
  351. Objects/boolobject.o \
  352. Objects/bytes_methods.o \
  353. Objects/bytearrayobject.o \
  354. Objects/bytesobject.o \
  355. Objects/call.o \
  356. Objects/capsule.o \
  357. Objects/cellobject.o \
  358. Objects/classobject.o \
  359. Objects/codeobject.o \
  360. Objects/complexobject.o \
  361. Objects/descrobject.o \
  362. Objects/enumobject.o \
  363. Objects/exceptions.o \
  364. Objects/genericaliasobject.o \
  365. Objects/genobject.o \
  366. Objects/fileobject.o \
  367. Objects/floatobject.o \
  368. Objects/frameobject.o \
  369. Objects/funcobject.o \
  370. Objects/interpreteridobject.o \
  371. Objects/iterobject.o \
  372. Objects/listobject.o \
  373. Objects/longobject.o \
  374. Objects/dictobject.o \
  375. Objects/odictobject.o \
  376. Objects/memoryobject.o \
  377. Objects/methodobject.o \
  378. Objects/moduleobject.o \
  379. Objects/namespaceobject.o \
  380. Objects/object.o \
  381. Objects/obmalloc.o \
  382. Objects/picklebufobject.o \
  383. Objects/rangeobject.o \
  384. Objects/setobject.o \
  385. Objects/sliceobject.o \
  386. Objects/structseq.o \
  387. Objects/tupleobject.o \
  388. Objects/typeobject.o \
  389. Objects/unicodeobject.o \
  390. Objects/unicodectype.o \
  391. Objects/weakrefobject.o
  392. ##########################################################################
  393. # objects that get linked into the Python library
  394. LIBRARY_OBJS_OMIT_FROZEN= \
  395. Modules/getbuildinfo.o \
  396. $(PARSER_OBJS) \
  397. $(OBJECT_OBJS) \
  398. $(PYTHON_OBJS) \
  399. $(MODULE_OBJS) \
  400. $(MODOBJS)
  401. LIBRARY_OBJS= \
  402. $(LIBRARY_OBJS_OMIT_FROZEN) \
  403. Python/frozen.o
  404. ##########################################################################
  405. # DTrace
  406. # On some systems, object files that reference DTrace probes need to be modified
  407. # in-place by dtrace(1).
  408. DTRACE_DEPS = \
  409. Python/ceval.o Python/import.o Python/sysmodule.o Modules/gcmodule.o
  410. #########################################################################
  411. # Rules
  412. # Default target
  413. all: profile-opt
  414. build_all: check-clean-src $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks \
  415. Programs/_testembed python-config
  416. # Check that the source is clean when building out of source.
  417. check-clean-src:
  418. @if test -n "$(VPATH)" -a -f "$(srcdir)/Programs/python.o"; then \
  419. echo "Error: The source directory ($(srcdir)) is not clean" ; \
  420. echo "Building Python out of the source tree (in $(abs_builddir)) requires a clean source tree ($(abs_srcdir))" ; \
  421. echo "Try to run: make -C \"$(srcdir)\" clean" ; \
  422. exit 1; \
  423. fi
  424. # Profile generation build must start from a clean tree.
  425. profile-clean-stamp:
  426. $(MAKE) clean
  427. touch $@
  428. # Compile with profile generation enabled.
  429. profile-gen-stamp: profile-clean-stamp
  430. @if [ $(LLVM_PROF_ERR) = yes ]; then \
  431. echo "Error: Cannot perform PGO build because llvm-profdata was not found in PATH" ;\
  432. echo "Please add it to PATH and run ./configure again" ;\
  433. exit 1;\
  434. fi
  435. @echo "Building with support for profile generation:"
  436. $(MAKE) build_all_generate_profile
  437. touch $@
  438. # Run task with profile generation build to create profile information.
  439. profile-run-stamp:
  440. @echo "Running code to generate profile data (this can take a while):"
  441. # First, we need to create a clean build with profile generation
  442. # enabled.
  443. $(MAKE) profile-gen-stamp
  444. # Next, run the profile task to generate the profile information.
  445. $(MAKE) run_profile_task
  446. $(MAKE) build_all_merge_profile
  447. # Remove profile generation binary since we are done with it.
  448. $(MAKE) clean-retain-profile
  449. # This is an expensive target to build and it does not have proper
  450. # makefile dependency information. So, we create a "stamp" file
  451. # to record its completion and avoid re-running it.
  452. touch $@
  453. build_all_generate_profile:
  454. $(MAKE) build_all CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
  455. run_profile_task:
  456. @ # FIXME: can't run for a cross build
  457. $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
  458. build_all_merge_profile:
  459. $(LLVM_PROF_MERGER)
  460. # Compile Python binary with profile guided optimization.
  461. # To force re-running of the profile task, remove the profile-run-stamp file.
  462. profile-opt: profile-run-stamp
  463. @echo "Rebuilding with profile guided optimizations:"
  464. -rm -f profile-clean-stamp
  465. $(MAKE) build_all CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_USE_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST)"
  466. # Compile and run with gcov
  467. .PHONY=coverage coverage-lcov coverage-report
  468. coverage:
  469. @echo "Building with support for coverage checking:"
  470. $(MAKE) clean
  471. $(MAKE) build_all CFLAGS="$(CFLAGS) -O0 -pg --coverage" LIBS="$(LIBS) --coverage"
  472. coverage-lcov:
  473. @echo "Creating Coverage HTML report with LCOV:"
  474. @rm -f $(COVERAGE_INFO)
  475. @rm -rf $(COVERAGE_REPORT)
  476. @lcov --capture --directory $(abs_builddir) \
  477. --base-directory $(realpath $(abs_builddir)) \
  478. --path $(realpath $(abs_srcdir)) \
  479. --output-file $(COVERAGE_INFO)
  480. @ # remove 3rd party modules, system headers and internal files with
  481. @ # debug, test or dummy functions.
  482. @lcov --remove $(COVERAGE_INFO) \
  483. '*/Modules/_blake2/impl/*' \
  484. '*/Modules/_ctypes/libffi*/*' \
  485. '*/Modules/_decimal/libmpdec/*' \
  486. '*/Modules/_sha3/kcp/*' \
  487. '*/Modules/expat/*' \
  488. '*/Modules/zlib/*' \
  489. '*/Include/*' \
  490. '*/Modules/xx*.c' \
  491. '*/Parser/listnode.c' \
  492. '*/Python/pyfpe.c' \
  493. '*/Python/pystrcmp.c' \
  494. '/usr/include/*' \
  495. '/usr/local/include/*' \
  496. '/usr/lib/gcc/*' \
  497. --output-file $(COVERAGE_INFO)
  498. @genhtml $(COVERAGE_INFO) --output-directory $(COVERAGE_REPORT) \
  499. $(COVERAGE_REPORT_OPTIONS)
  500. @echo
  501. @echo "lcov report at $(COVERAGE_REPORT)/index.html"
  502. @echo
  503. # Force regeneration of parser and importlib
  504. coverage-report: regen-grammar regen-token regen-importlib
  505. @ # build with coverage info
  506. $(MAKE) coverage
  507. @ # run tests, ignore failures
  508. $(TESTRUNNER) $(TESTOPTS) || true
  509. @ # build lcov report
  510. $(MAKE) coverage-lcov
  511. # Run "Argument Clinic" over all source files
  512. .PHONY=clinic
  513. clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c
  514. $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir)
  515. # Build the interpreter
  516. $(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
  517. $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)
  518. platform: $(BUILDPYTHON) pybuilddir.txt
  519. $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
  520. # Create build directory and generate the sysconfig build-time data there.
  521. # pybuilddir.txt contains the name of the build dir and is used for
  522. # sys.path fixup -- see Modules/getpath.c.
  523. # Since this step runs before shared modules are built, try to avoid bootstrap
  524. # problems by creating a dummy pybuilddir.txt just to allow interpreter
  525. # initialization to succeed. It will be overwritten by generate-posix-vars
  526. # or removed in case of failure.
  527. pybuilddir.txt: $(BUILDPYTHON)
  528. @echo "none" > ./pybuilddir.txt
  529. $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
  530. if test $$? -ne 0 ; then \
  531. echo "generate-posix-vars failed" ; \
  532. rm -f ./pybuilddir.txt ; \
  533. exit 1 ; \
  534. fi
  535. # This is shared by the math and cmath modules
  536. Modules/_math.o: Modules/_math.c Modules/_math.h
  537. $(CC) -c $(CCSHARED) $(PY_CORE_CFLAGS) -o $@ $<
  538. # blake2s is auto-generated from blake2b
  539. $(srcdir)/Modules/_blake2/blake2s_impl.c: $(srcdir)/Modules/_blake2/blake2b_impl.c $(srcdir)/Modules/_blake2/blake2b2s.py
  540. $(PYTHON_FOR_REGEN) $(srcdir)/Modules/_blake2/blake2b2s.py
  541. $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py -f $@
  542. # Build the shared modules
  543. # Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for
  544. # -s, --silent or --quiet is always the first char.
  545. # Under BSD make, MAKEFLAGS might be " -s -v x=y".
  546. # Ignore macros passed by GNU make, passed after --
  547. sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
  548. @case "`echo X $$MAKEFLAGS | sed 's/^X //;s/ -- .*//'`" in \
  549. *\ -s*|s*) quiet="-q";; \
  550. *) quiet="";; \
  551. esac; \
  552. echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
  553. _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
  554. $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \
  555. $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
  556. _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
  557. $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
  558. # Build static library
  559. $(LIBRARY): $(LIBRARY_OBJS)
  560. -rm -f $@
  561. $(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS)
  562. libpython$(LDVERSION).so: $(LIBRARY_OBJS) $(DTRACE_OBJS)
  563. if test $(INSTSONAME) != $(LDLIBRARY); then \
  564. $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \
  565. $(LN) -f $(INSTSONAME) $@; \
  566. else \
  567. $(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \
  568. fi
  569. libpython3.so: libpython$(LDVERSION).so
  570. $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^
  571. libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
  572. $(CC) -dynamiclib -Wl,-single_module $(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); \
  573. libpython$(VERSION).sl: $(LIBRARY_OBJS)
  574. $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM)
  575. # List of exported symbols for AIX
  576. Modules/python.exp: $(LIBRARY)
  577. $(srcdir)/Modules/makexp_aix $@ "$(EXPORTSFROM)" $?
  578. # Copy up the gdb python hooks into a position where they can be automatically
  579. # loaded by gdb during Lib/test/test_gdb.py
  580. #
  581. # Distributors are likely to want to install this somewhere else e.g. relative
  582. # to the stripped DWARF data for the shared library.
  583. gdbhooks: $(BUILDPYTHON)-gdb.py
  584. SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py
  585. $(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS)
  586. $(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py
  587. # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
  588. # minimal framework (not including the Lib directory and such) in the current
  589. # directory.
  590. RESSRCDIR=Mac/Resources/framework
  591. $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
  592. $(LIBRARY) \
  593. $(RESSRCDIR)/Info.plist
  594. $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
  595. $(CC) -o $(LDLIBRARY) $(PY_CORE_LDFLAGS) -dynamiclib \
  596. -all_load $(LIBRARY) -Wl,-single_module \
  597. -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \
  598. -compatibility_version $(VERSION) \
  599. -current_version $(VERSION) \
  600. -framework CoreFoundation $(LIBS);
  601. $(INSTALL) -d -m $(DIRMODE) \
  602. $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
  603. $(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
  604. $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
  605. $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
  606. $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
  607. $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
  608. # This rule builds the Cygwin Python DLL and import library if configured
  609. # for a shared core library; otherwise, this rule is a noop.
  610. $(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS)
  611. if test -n "$(DLLLIBRARY)"; then \
  612. $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
  613. $(LIBS) $(MODLIBS) $(SYSLIBS); \
  614. else true; \
  615. fi
  616. oldsharedmods: $(SHAREDMODS)
  617. Makefile Modules/config.c: Makefile.pre \
  618. $(srcdir)/Modules/config.c.in \
  619. $(MAKESETUP) \
  620. $(srcdir)/Modules/Setup \
  621. Modules/Setup.local
  622. $(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
  623. -s Modules \
  624. Modules/Setup.local \
  625. $(srcdir)/Modules/Setup
  626. @mv config.c Modules
  627. @echo "The Makefile was updated, you may need to re-run make."
  628. Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
  629. $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)
  630. ############################################################################
  631. # Importlib
  632. Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile
  633. Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN)
  634. $(LINKCC) $(PY_CORE_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS)
  635. .PHONY: regen-importlib
  636. regen-importlib: Programs/_freeze_importlib
  637. # Regenerate Python/importlib_external.h
  638. # from Lib/importlib/_bootstrap_external.py using _freeze_importlib
  639. ./Programs/_freeze_importlib importlib._bootstrap_external \
  640. $(srcdir)/Lib/importlib/_bootstrap_external.py \
  641. $(srcdir)/Python/importlib_external.h.new
  642. $(UPDATE_FILE) $(srcdir)/Python/importlib_external.h $(srcdir)/Python/importlib_external.h.new
  643. # Regenerate Python/importlib.h from Lib/importlib/_bootstrap.py
  644. # using _freeze_importlib
  645. ./Programs/_freeze_importlib importlib._bootstrap \
  646. $(srcdir)/Lib/importlib/_bootstrap.py \
  647. $(srcdir)/Python/importlib.h.new
  648. $(UPDATE_FILE) $(srcdir)/Python/importlib.h $(srcdir)/Python/importlib.h.new
  649. # Regenerate Python/importlib_zipimport.h from Lib/zipimport.py
  650. # using _freeze_importlib
  651. ./Programs/_freeze_importlib zipimport \
  652. $(srcdir)/Lib/zipimport.py \
  653. $(srcdir)/Python/importlib_zipimport.h.new
  654. $(UPDATE_FILE) $(srcdir)/Python/importlib_zipimport.h $(srcdir)/Python/importlib_zipimport.h.new
  655. regen-abidump: all
  656. @$(MKDIR_P) $(srcdir)/Doc/data/
  657. abidw "libpython$(LDVERSION).so" --no-architecture --out-file $(srcdir)/Doc/data/python$(LDVERSION).abi.new
  658. @$(UPDATE_FILE) $(srcdir)/Doc/data/python$(LDVERSION).abi $(srcdir)/Doc/data/python$(LDVERSION).abi.new
  659. check-abidump: all
  660. abidiff $(srcdir)/Doc/data/python$(LDVERSION).abi "libpython$(LDVERSION).so" --drop-private-types --no-architecture --no-added-syms
  661. ############################################################################
  662. # Regenerate all generated files
  663. regen-all: regen-opcode regen-opcode-targets regen-typeslots regen-grammar \
  664. regen-token regen-keyword regen-symbol regen-ast regen-importlib clinic \
  665. regen-pegen-metaparser regen-pegen
  666. ############################################################################
  667. # Special rules for object files
  668. Modules/getbuildinfo.o: $(PARSER_OBJS) \
  669. $(OBJECT_OBJS) \
  670. $(PYTHON_OBJS) \
  671. $(MODULE_OBJS) \
  672. $(MODOBJS) \
  673. $(DTRACE_OBJS) \
  674. $(srcdir)/Modules/getbuildinfo.c
  675. $(CC) -c $(PY_CORE_CFLAGS) \
  676. -DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \
  677. -DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \
  678. -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \
  679. -o $@ $(srcdir)/Modules/getbuildinfo.c
  680. Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
  681. $(CC) -c $(PY_CORE_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
  682. -DPREFIX='"$(prefix)"' \
  683. -DEXEC_PREFIX='"$(exec_prefix)"' \
  684. -DVERSION='"$(VERSION)"' \
  685. -DVPATH='"$(VPATH)"' \
  686. -o $@ $(srcdir)/Modules/getpath.c
  687. Programs/python.o: $(srcdir)/Programs/python.c
  688. $(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/python.c
  689. Programs/_testembed.o: $(srcdir)/Programs/_testembed.c
  690. $(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/_testembed.c
  691. Modules/_sre.o: $(srcdir)/Modules/_sre.c $(srcdir)/Modules/sre.h $(srcdir)/Modules/sre_constants.h $(srcdir)/Modules/sre_lib.h
  692. Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c $(srcdir)/Modules/posixmodule.h
  693. Modules/grpmodule.o: $(srcdir)/Modules/grpmodule.c $(srcdir)/Modules/posixmodule.h
  694. Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h
  695. Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c $(srcdir)/Modules/posixmodule.h
  696. Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile
  697. $(CC) -c $(PY_CORE_CFLAGS) \
  698. -DSOABI='"$(SOABI)"' \
  699. -o $@ $(srcdir)/Python/dynload_shlib.c
  700. Python/dynload_hpux.o: $(srcdir)/Python/dynload_hpux.c Makefile
  701. $(CC) -c $(PY_CORE_CFLAGS) \
  702. -DSHLIB_EXT='"$(EXT_SUFFIX)"' \
  703. -o $@ $(srcdir)/Python/dynload_hpux.c
  704. Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h
  705. $(CC) -c $(PY_CORE_CFLAGS) \
  706. -DABIFLAGS='"$(ABIFLAGS)"' \
  707. $(MULTIARCH_CPPFLAGS) \
  708. -o $@ $(srcdir)/Python/sysmodule.c
  709. Python/initconfig.o: $(srcdir)/Python/initconfig.c
  710. $(CC) -c $(PY_CORE_CFLAGS) \
  711. -DPLATLIBDIR='"$(PLATLIBDIR)"' \
  712. -o $@ $(srcdir)/Python/initconfig.c
  713. $(IO_OBJS): $(IO_H)
  714. .PHONY: regen-grammar
  715. regen-grammar: regen-token
  716. # Regenerate Include/graminit.h and Python/graminit.c
  717. # from Grammar/Grammar using pgen
  718. @$(MKDIR_P) Include
  719. PYTHONPATH=$(srcdir) $(PYTHON_FOR_REGEN) -m Parser.pgen $(srcdir)/Grammar/Grammar \
  720. $(srcdir)/Grammar/Tokens \
  721. $(srcdir)/Include/graminit.h.new \
  722. $(srcdir)/Python/graminit.c.new
  723. $(UPDATE_FILE) $(srcdir)/Include/graminit.h $(srcdir)/Include/graminit.h.new
  724. $(UPDATE_FILE) $(srcdir)/Python/graminit.c $(srcdir)/Python/graminit.c.new
  725. .PHONY: regen-pegen-metaparser
  726. regen-pegen-metaparser:
  727. @$(MKDIR_P) $(srcdir)/Tools/peg_generator/pegen
  728. PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen -q python \
  729. $(srcdir)/Tools/peg_generator/pegen/metagrammar.gram \
  730. -o $(srcdir)/Tools/peg_generator/pegen/grammar_parser.py.new
  731. $(UPDATE_FILE) $(srcdir)/Tools/peg_generator/pegen/grammar_parser.py \
  732. $(srcdir)/Tools/peg_generator/pegen/grammar_parser.py.new
  733. .PHONY: regen-pegen
  734. regen-pegen:
  735. @$(MKDIR_P) $(srcdir)/Parser/pegen
  736. PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen -q c \
  737. $(srcdir)/Grammar/python.gram \
  738. $(srcdir)/Grammar/Tokens \
  739. -o $(srcdir)/Parser/pegen/parse.new.c
  740. $(UPDATE_FILE) $(srcdir)/Parser/pegen/parse.c $(srcdir)/Parser/pegen/parse.new.c
  741. .PHONY=regen-ast
  742. regen-ast:
  743. # Regenerate Include/Python-ast.h and Python/Python-ast.c using Parser/asdl_c.py
  744. $(MKDIR_P) $(srcdir)/Include
  745. $(MKDIR_P) $(srcdir)/Python
  746. $(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \
  747. $(srcdir)/Parser/Python.asdl \
  748. -H $(srcdir)/Include/Python-ast.h.new \
  749. -C $(srcdir)/Python/Python-ast.c.new
  750. $(UPDATE_FILE) $(srcdir)/Include/Python-ast.h $(srcdir)/Include/Python-ast.h.new
  751. $(UPDATE_FILE) $(srcdir)/Python/Python-ast.c $(srcdir)/Python/Python-ast.c.new
  752. .PHONY: regen-opcode
  753. regen-opcode:
  754. # Regenerate Include/opcode.h from Lib/opcode.py
  755. # using Tools/scripts/generate_opcode_h.py
  756. $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_opcode_h.py \
  757. $(srcdir)/Lib/opcode.py \
  758. $(srcdir)/Include/opcode.h.new
  759. $(UPDATE_FILE) $(srcdir)/Include/opcode.h $(srcdir)/Include/opcode.h.new
  760. .PHONY: regen-token
  761. regen-token:
  762. # Regenerate Doc/library/token-list.inc from Grammar/Tokens
  763. # using Tools/scripts/generate_token.py
  764. $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py rst \
  765. $(srcdir)/Grammar/Tokens \
  766. $(srcdir)/Doc/library/token-list.inc
  767. # Regenerate Include/token.h from Grammar/Tokens
  768. # using Tools/scripts/generate_token.py
  769. $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py h \
  770. $(srcdir)/Grammar/Tokens \
  771. $(srcdir)/Include/token.h
  772. # Regenerate Parser/token.c from Grammar/Tokens
  773. # using Tools/scripts/generate_token.py
  774. $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py c \
  775. $(srcdir)/Grammar/Tokens \
  776. $(srcdir)/Parser/token.c
  777. # Regenerate Lib/token.py from Grammar/Tokens
  778. # using Tools/scripts/generate_token.py
  779. $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py py \
  780. $(srcdir)/Grammar/Tokens \
  781. $(srcdir)/Lib/token.py
  782. .PHONY: regen-keyword
  783. regen-keyword:
  784. # Regenerate Lib/keyword.py from Grammar/python.gram and Grammar/Tokens
  785. # using Tools/peg_generator/pegen
  786. PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen.keywordgen \
  787. $(srcdir)/Grammar/python.gram \
  788. $(srcdir)/Grammar/Tokens \
  789. $(srcdir)/Lib/keyword.py.new
  790. $(UPDATE_FILE) $(srcdir)/Lib/keyword.py $(srcdir)/Lib/keyword.py.new
  791. .PHONY: regen-symbol
  792. regen-symbol: $(srcdir)/Include/graminit.h
  793. # Regenerate Lib/symbol.py from Include/graminit.h
  794. # using Tools/scripts/generate_symbol_py.py
  795. $(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_symbol_py.py \
  796. $(srcdir)/Include/graminit.h \
  797. $(srcdir)/Lib/symbol.py
  798. Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o Parser/parsetok.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h
  799. Python/getplatform.o: $(srcdir)/Python/getplatform.c
  800. $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
  801. Python/importdl.o: $(srcdir)/Python/importdl.c
  802. $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
  803. Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
  804. $(srcdir)/Objects/unicodetype_db.h
  805. BYTESTR_DEPS = \
  806. $(srcdir)/Objects/stringlib/count.h \
  807. $(srcdir)/Objects/stringlib/ctype.h \
  808. $(srcdir)/Objects/stringlib/fastsearch.h \
  809. $(srcdir)/Objects/stringlib/find.h \
  810. $(srcdir)/Objects/stringlib/join.h \
  811. $(srcdir)/Objects/stringlib/partition.h \
  812. $(srcdir)/Objects/stringlib/split.h \
  813. $(srcdir)/Objects/stringlib/stringdefs.h \
  814. $(srcdir)/Objects/stringlib/transmogrify.h
  815. UNICODE_DEPS = \
  816. $(srcdir)/Objects/stringlib/asciilib.h \
  817. $(srcdir)/Objects/stringlib/codecs.h \
  818. $(srcdir)/Objects/stringlib/count.h \
  819. $(srcdir)/Objects/stringlib/fastsearch.h \
  820. $(srcdir)/Objects/stringlib/find.h \
  821. $(srcdir)/Objects/stringlib/find_max_char.h \
  822. $(srcdir)/Objects/stringlib/localeutil.h \
  823. $(srcdir)/Objects/stringlib/partition.h \
  824. $(srcdir)/Objects/stringlib/replace.h \
  825. $(srcdir)/Objects/stringlib/split.h \
  826. $(srcdir)/Objects/stringlib/ucs1lib.h \
  827. $(srcdir)/Objects/stringlib/ucs2lib.h \
  828. $(srcdir)/Objects/stringlib/ucs4lib.h \
  829. $(srcdir)/Objects/stringlib/undef.h \
  830. $(srcdir)/Objects/stringlib/unicode_format.h \
  831. $(srcdir)/Objects/stringlib/unicodedefs.h
  832. Objects/bytes_methods.o: $(srcdir)/Objects/bytes_methods.c $(BYTESTR_DEPS)
  833. Objects/bytesobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS)
  834. Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS)
  835. Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c $(UNICODE_DEPS)
  836. Objects/odictobject.o: $(srcdir)/Objects/dict-common.h
  837. Objects/dictobject.o: $(srcdir)/Objects/stringlib/eq.h $(srcdir)/Objects/dict-common.h
  838. Objects/setobject.o: $(srcdir)/Objects/stringlib/eq.h
  839. .PHONY: regen-opcode-targets
  840. regen-opcode-targets:
  841. # Regenerate Python/opcode_targets.h from Lib/opcode.py
  842. # using Python/makeopcodetargets.py
  843. $(PYTHON_FOR_REGEN) $(srcdir)/Python/makeopcodetargets.py \
  844. $(srcdir)/Python/opcode_targets.h.new
  845. $(UPDATE_FILE) $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/opcode_targets.h.new
  846. Python/ceval.o: $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/ceval_gil.h \
  847. $(srcdir)/Python/condvar.h
  848. Python/frozen.o: $(srcdir)/Python/importlib.h $(srcdir)/Python/importlib_external.h \
  849. $(srcdir)/Python/importlib_zipimport.h
  850. # Generate DTrace probe macros, then rename them (PYTHON_ -> PyDTrace_) to
  851. # follow our naming conventions. dtrace(1) uses the output filename to generate
  852. # an include guard, so we can't use a pipeline to transform its output.
  853. Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d
  854. $(MKDIR_P) Include
  855. $(DTRACE) $(DFLAGS) -o $@ -h -s $<
  856. : sed in-place edit with POSIX-only tools
  857. sed 's/PYTHON_/PyDTrace_/' $@ > $@.tmp
  858. mv $@.tmp $@
  859. Python/ceval.o: $(srcdir)/Include/pydtrace.h
  860. Python/import.o: $(srcdir)/Include/pydtrace.h
  861. Modules/gcmodule.o: $(srcdir)/Include/pydtrace.h
  862. Python/pydtrace.o: $(srcdir)/Include/pydtrace.d $(DTRACE_DEPS)
  863. $(DTRACE) $(DFLAGS) -o $@ -G -s $< $(DTRACE_DEPS)
  864. Objects/typeobject.o: Objects/typeslots.inc
  865. .PHONY: regen-typeslots
  866. regen-typeslots:
  867. # Regenerate Objects/typeslots.inc from Include/typeslotsh
  868. # using Objects/typeslots.py
  869. $(PYTHON_FOR_REGEN) $(srcdir)/Objects/typeslots.py \
  870. < $(srcdir)/Include/typeslots.h \
  871. $(srcdir)/Objects/typeslots.inc.new
  872. $(UPDATE_FILE) $(srcdir)/Objects/typeslots.inc $(srcdir)/Objects/typeslots.inc.new
  873. ############################################################################
  874. # Header files
  875. PYTHON_HEADERS= \
  876. $(srcdir)/Include/Python.h \
  877. $(srcdir)/Include/abstract.h \
  878. $(srcdir)/Include/asdl.h \
  879. $(srcdir)/Include/ast.h \
  880. $(srcdir)/Include/bitset.h \
  881. $(srcdir)/Include/bltinmodule.h \
  882. $(srcdir)/Include/boolobject.h \
  883. $(srcdir)/Include/bytearrayobject.h \
  884. $(srcdir)/Include/bytesobject.h \
  885. $(srcdir)/Include/cellobject.h \
  886. $(srcdir)/Include/ceval.h \
  887. $(srcdir)/Include/classobject.h \
  888. $(srcdir)/Include/code.h \
  889. $(srcdir)/Include/codecs.h \
  890. $(srcdir)/Include/compile.h \
  891. $(srcdir)/Include/complexobject.h \
  892. $(srcdir)/Include/context.h \
  893. $(srcdir)/Include/descrobject.h \
  894. $(srcdir)/Include/dictobject.h \
  895. $(srcdir)/Include/dynamic_annotations.h \
  896. $(srcdir)/Include/enumobject.h \
  897. $(srcdir)/Include/errcode.h \
  898. $(srcdir)/Include/eval.h \
  899. $(srcdir)/Include/fileobject.h \
  900. $(srcdir)/Include/fileutils.h \
  901. $(srcdir)/Include/floatobject.h \
  902. $(srcdir)/Include/frameobject.h \
  903. $(srcdir)/Include/funcobject.h \
  904. $(srcdir)/Include/genobject.h \
  905. $(srcdir)/Include/import.h \
  906. $(srcdir)/Include/interpreteridobject.h \
  907. $(srcdir)/Include/intrcheck.h \
  908. $(srcdir)/Include/iterobject.h \
  909. $(srcdir)/Include/listobject.h \
  910. $(srcdir)/Include/longintrepr.h \
  911. $(srcdir)/Include/longobject.h \
  912. $(srcdir)/Include/marshal.h \
  913. $(srcdir)/Include/memoryobject.h \
  914. $(srcdir)/Include/methodobject.h \
  915. $(srcdir)/Include/modsupport.h \
  916. $(srcdir)/Include/moduleobject.h \
  917. $(srcdir)/Include/namespaceobject.h \
  918. $(srcdir)/Include/node.h \
  919. $(srcdir)/Include/object.h \
  920. $(srcdir)/Include/objimpl.h \
  921. $(srcdir)/Include/odictobject.h \
  922. $(srcdir)/Include/opcode.h \
  923. $(srcdir)/Include/osdefs.h \
  924. $(srcdir)/Include/osmodule.h \
  925. $(srcdir)/Include/patchlevel.h \
  926. $(srcdir)/Include/picklebufobject.h \
  927. $(srcdir)/Include/pyarena.h \
  928. $(srcdir)/Include/pycapsule.h \
  929. $(srcdir)/Include/pyctype.h \
  930. $(srcdir)/Include/pydebug.h \
  931. $(srcdir)/Include/pydtrace.h \
  932. $(srcdir)/Include/pyerrors.h \
  933. $(srcdir)/Include/pyfpe.h \
  934. $(srcdir)/Include/pyframe.h \
  935. $(srcdir)/Include/pyhash.h \
  936. $(srcdir)/Include/pylifecycle.h \
  937. $(srcdir)/Include/pymacconfig.h \
  938. $(srcdir)/Include/pymacro.h \
  939. $(srcdir)/Include/pymath.h \
  940. $(srcdir)/Include/pymem.h \
  941. $(srcdir)/Include/pyport.h \
  942. $(srcdir)/Include/pystate.h \
  943. $(srcdir)/Include/pystrcmp.h \
  944. $(srcdir)/Include/pystrhex.h \
  945. $(srcdir)/Include/pystrtod.h \
  946. $(srcdir)/Include/pythonrun.h \
  947. $(srcdir)/Include/pythread.h \
  948. $(srcdir)/Include/pytime.h \
  949. $(srcdir)/Include/rangeobject.h \
  950. $(srcdir)/Include/setobject.h \
  951. $(srcdir)/Include/sliceobject.h \
  952. $(srcdir)/Include/structmember.h \
  953. $(srcdir)/Include/structseq.h \
  954. $(srcdir)/Include/symtable.h \
  955. $(srcdir)/Include/sysmodule.h \
  956. $(srcdir)/Include/token.h \
  957. $(srcdir)/Include/traceback.h \
  958. $(srcdir)/Include/tracemalloc.h \
  959. $(srcdir)/Include/tupleobject.h \
  960. $(srcdir)/Include/ucnhash.h \
  961. $(srcdir)/Include/unicodeobject.h \
  962. $(srcdir)/Include/warnings.h \
  963. $(srcdir)/Include/weakrefobject.h \
  964. \
  965. pyconfig.h \
  966. $(PARSER_HEADERS) \
  967. $(srcdir)/Include/Python-ast.h \
  968. \
  969. $(srcdir)/Include/cpython/abstract.h \
  970. $(srcdir)/Include/cpython/bytearrayobject.h \
  971. $(srcdir)/Include/cpython/bytesobject.h \
  972. $(srcdir)/Include/cpython/ceval.h \
  973. $(srcdir)/Include/cpython/code.h \
  974. $(srcdir)/Include/cpython/dictobject.h \
  975. $(srcdir)/Include/cpython/fileobject.h \
  976. $(srcdir)/Include/cpython/fileutils.h \
  977. $(srcdir)/Include/cpython/frameobject.h \
  978. $(srcdir)/Include/cpython/import.h \
  979. $(srcdir)/Include/cpython/initconfig.h \
  980. $(srcdir)/Include/cpython/interpreteridobject.h \
  981. $(srcdir)/Include/cpython/listobject.h \
  982. $(srcdir)/Include/cpython/methodobject.h \
  983. $(srcdir)/Include/cpython/object.h \
  984. $(srcdir)/Include/cpython/objimpl.h \
  985. $(srcdir)/Include/cpython/pyerrors.h \
  986. $(srcdir)/Include/cpython/pylifecycle.h \
  987. $(srcdir)/Include/cpython/pymem.h \
  988. $(srcdir)/Include/cpython/pystate.h \
  989. $(srcdir)/Include/cpython/sysmodule.h \
  990. $(srcdir)/Include/cpython/traceback.h \
  991. $(srcdir)/Include/cpython/tupleobject.h \
  992. $(srcdir)/Include/cpython/unicodeobject.h \
  993. \
  994. $(srcdir)/Include/internal/pycore_abstract.h \
  995. $(srcdir)/Include/internal/pycore_accu.h \
  996. $(srcdir)/Include/internal/pycore_atomic.h \
  997. $(srcdir)/Include/internal/pycore_byteswap.h \
  998. $(srcdir)/Include/internal/pycore_bytes_methods.h \
  999. $(srcdir)/Include/internal/pycore_call.h \
  1000. $(srcdir)/Include/internal/pycore_ceval.h \
  1001. $(srcdir)/Include/internal/pycore_code.h \
  1002. $(srcdir)/Include/internal/pycore_condvar.h \
  1003. $(srcdir)/Include/internal/pycore_context.h \
  1004. $(srcdir)/Include/internal/pycore_dtoa.h \
  1005. $(srcdir)/Include/internal/pycore_fileutils.h \
  1006. $(srcdir)/Include/internal/pycore_getopt.h \
  1007. $(srcdir)/Include/internal/pycore_gil.h \
  1008. $(srcdir)/Include/internal/pycore_hamt.h \
  1009. $(srcdir)/Include/internal/pycore_hashtable.h \
  1010. $(srcdir)/Include/internal/pycore_import.h \
  1011. $(srcdir)/Include/internal/pycore_initconfig.h \
  1012. $(srcdir)/Include/internal/pycore_interp.h \
  1013. $(srcdir)/Include/internal/pycore_long.h \
  1014. $(srcdir)/Include/internal/pycore_object.h \
  1015. $(srcdir)/Include/internal/pycore_pathconfig.h \
  1016. $(srcdir)/Include/internal/pycore_pyerrors.h \
  1017. $(srcdir)/Include/internal/pycore_pyhash.h \
  1018. $(srcdir)/Include/internal/pycore_pylifecycle.h \
  1019. $(srcdir)/Include/internal/pycore_pymem.h \
  1020. $(srcdir)/Include/internal/pycore_pystate.h \
  1021. $(srcdir)/Include/internal/pycore_runtime.h \
  1022. $(srcdir)/Include/internal/pycore_sysmodule.h \
  1023. $(srcdir)/Include/internal/pycore_traceback.h \
  1024. $(srcdir)/Include/internal/pycore_tupleobject.h \
  1025. $(srcdir)/Include/internal/pycore_warnings.h \
  1026. $(DTRACE_HEADERS)
  1027. $(LIBRARY_OBJS) $(MODOBJS) Programs/python.o: $(PYTHON_HEADERS)
  1028. ######################################################################
  1029. TESTOPTS= $(EXTRATESTOPTS)
  1030. TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS)
  1031. TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py
  1032. TESTTIMEOUT= 1200
  1033. .PHONY: test testall testuniversal buildbottest pythoninfo
  1034. # Remove "test_python_*" directories of previous failed test jobs.
  1035. # Pass TESTOPTS options because it can contain --tempdir option.
  1036. cleantest: build_all
  1037. $(TESTRUNNER) $(TESTOPTS) --cleanup
  1038. # Run a basic set of regression tests.
  1039. # This excludes some tests that are particularly resource-intensive.
  1040. test: build_all platform
  1041. $(TESTRUNNER) $(TESTOPTS)
  1042. # Run the full test suite twice - once without .pyc files, and once with.
  1043. # In the past, we've had problems where bugs in the marshalling or
  1044. # elsewhere caused bytecode read from .pyc files to behave differently
  1045. # than bytecode generated directly from a .py source file. Sometimes
  1046. # the bytecode read from a .pyc file had the bug, sometimes the directly
  1047. # generated bytecode. This is sometimes a very shy bug needing a lot of
  1048. # sample data.
  1049. testall: build_all platform
  1050. -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
  1051. $(TESTPYTHON) -E $(srcdir)/Lib/compileall.py
  1052. -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
  1053. -$(TESTRUNNER) -u all $(TESTOPTS)
  1054. $(TESTRUNNER) -u all $(TESTOPTS)
  1055. # Run the test suite for both architectures in a Universal build on OSX.
  1056. # Must be run on an Intel box.
  1057. testuniversal: build_all platform
  1058. @if [ `arch` != 'i386' ]; then \
  1059. echo "This can only be used on OSX/i386" ;\
  1060. exit 1 ;\
  1061. fi
  1062. $(TESTRUNNER) -u all $(TESTOPTS)
  1063. $(RUNSHARED) /usr/libexec/oah/translate \
  1064. ./$(BUILDPYTHON) -E -m test -j 0 -u all $(TESTOPTS)
  1065. # Like testall, but with only one pass and without multiple processes.
  1066. # Run an optional script to include information about the build environment.
  1067. buildbottest: build_all platform
  1068. -@if which pybuildbot.identify >/dev/null 2>&1; then \
  1069. pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
  1070. fi
  1071. $(TESTRUNNER) -j 1 -u all -W --slowest --fail-env-changed --timeout=$(TESTTIMEOUT) $(TESTOPTS)
  1072. pythoninfo: build_all
  1073. $(RUNSHARED) ./$(BUILDPYTHON) -m test.pythoninfo
  1074. QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3 \
  1075. test_multibytecodec test_urllib2_localnet test_itertools \
  1076. test_multiprocessing_fork test_multiprocessing_spawn \
  1077. test_multiprocessing_forkserver \
  1078. test_mailbox test_socket test_poll \
  1079. test_select test_zipfile test_concurrent_futures
  1080. quicktest: build_all platform
  1081. $(TESTRUNNER) $(QUICKTESTOPTS)
  1082. # SSL tests
  1083. .PHONY: multisslcompile multissltest
  1084. multisslcompile: build_all
  1085. $(RUNSHARED) ./$(BUILDPYTHON) Tools/ssl/multissltests.py --steps=modules
  1086. multissltest: build_all
  1087. $(RUNSHARED) ./$(BUILDPYTHON) Tools/ssl/multissltests.py
  1088. install: commoninstall bininstall maninstall
  1089. if test "x$(ENSUREPIP)" != "xno" ; then \
  1090. case $(ENSUREPIP) in \
  1091. upgrade) ensurepip="--upgrade" ;; \
  1092. install|*) ensurepip="" ;; \
  1093. esac; \
  1094. $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -m ensurepip \
  1095. $$ensurepip --root=$(DESTDIR)/ ; \
  1096. fi
  1097. altinstall: commoninstall
  1098. if test "x$(ENSUREPIP)" != "xno" ; then \
  1099. case $(ENSUREPIP) in \
  1100. upgrade) ensurepip="--altinstall --upgrade" ;; \
  1101. install|*) ensurepip="--altinstall" ;; \
  1102. esac; \
  1103. $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) -m ensurepip \
  1104. $$ensurepip --root=$(DESTDIR)/ ; \
  1105. fi
  1106. commoninstall: check-clean-src \
  1107. altbininstall libinstall inclinstall libainstall \
  1108. sharedinstall oldsharedinstall altmaninstall \
  1109. # Install shared libraries enabled by Setup
  1110. DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
  1111. oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
  1112. @for i in X $(SHAREDMODS); do \
  1113. if test $$i != X; then \
  1114. echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
  1115. $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
  1116. fi; \
  1117. done
  1118. $(DESTSHARED):
  1119. @for i in $(DESTDIRS); \
  1120. do \
  1121. if test ! -d $(DESTDIR)$$i; then \
  1122. echo "Creating directory $$i"; \
  1123. $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
  1124. else true; \
  1125. fi; \
  1126. done
  1127. # Install the interpreter with $(VERSION) affixed
  1128. # This goes into $(exec_prefix)
  1129. altbininstall: $(BUILDPYTHON)
  1130. @for i in $(BINDIR) $(LIBDIR); \
  1131. do \
  1132. if test ! -d $(DESTDIR)$$i; then \
  1133. echo "Creating directory $$i"; \
  1134. $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
  1135. else true; \
  1136. fi; \
  1137. done
  1138. if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
  1139. $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
  1140. else \
  1141. $(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
  1142. fi
  1143. -if test "$(VERSION)" != "$(LDVERSION)"; then \
  1144. if test -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) -o -h $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
  1145. then rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
  1146. fi; \
  1147. (cd $(DESTDIR)$(BINDIR); $(LN) python$(LDVERSION)$(EXE) python$(VERSION)$(EXE)); \
  1148. fi
  1149. if test -f $(LDLIBRARY) && test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
  1150. if test -n "$(DLLLIBRARY)" ; then \
  1151. $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
  1152. else \
  1153. $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
  1154. if test $(LDLIBRARY) != $(INSTSONAME); then \
  1155. (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \
  1156. fi \
  1157. fi; \
  1158. if test -n "$(PY3LIBRARY)"; then \
  1159. $(INSTALL_SHARED) $(PY3LIBRARY) $(DESTDIR)$(LIBDIR)/$(PY3LIBRARY); \
  1160. fi; \
  1161. else true; \
  1162. fi
  1163. if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
  1164. rm -f $(DESTDIR)$(BINDIR)python$(VERSION)-32$(EXE); \
  1165. lipo $(LIPO_32BIT_FLAGS) \
  1166. -output $(DESTDIR)$(BINDIR)/python$(VERSION)-32$(EXE) \
  1167. $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
  1168. fi
  1169. if test "x$(LIPO_INTEL64_FLAGS)" != "x" ; then \
  1170. rm -f $(DESTDIR)$(BINDIR)python$(VERSION)-intel64$(EXE); \
  1171. lipo $(LIPO_INTEL64_FLAGS) \
  1172. -output $(DESTDIR)$(BINDIR)/python$(VERSION)-intel64$(EXE) \
  1173. $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
  1174. fi
  1175. bininstall: altbininstall
  1176. if test ! -d $(DESTDIR)$(LIBPC); then \
  1177. echo "Creating directory $(LIBPC)"; \
  1178. $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC); \
  1179. fi
  1180. -if test -f $(DESTDIR)$(BINDIR)/python3$(EXE) -o -h $(DESTDIR)$(BINDIR)/python3$(EXE); \
  1181. then rm -f $(DESTDIR)$(BINDIR)/python3$(EXE); \
  1182. else true; \
  1183. fi
  1184. (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python3$(EXE))
  1185. -if test "$(VERSION)" != "$(LDVERSION)"; then \
  1186. rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)-config; \
  1187. (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(LDVERSION)-config python$(VERSION)-config); \
  1188. rm -f $(DESTDIR)$(LIBPC)/python-$(LDVERSION).pc; \
  1189. (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python-$(LDVERSION).pc); \
  1190. rm -f $(DESTDIR)$(LIBPC)/python-$(LDVERSION)-embed.pc; \
  1191. (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python-$(LDVERSION)-embed.pc); \
  1192. fi
  1193. -rm -f $(DESTDIR)$(BINDIR)/python3-config
  1194. (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python3-config)
  1195. -rm -f $(DESTDIR)$(LIBPC)/python3.pc
  1196. (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc)
  1197. -rm -f $(DESTDIR)$(LIBPC)/python3-embed.pc
  1198. (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python3-embed.pc)
  1199. -rm -f $(DESTDIR)$(BINDIR)/idle3
  1200. (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
  1201. -rm -f $(DESTDIR)$(BINDIR)/pydoc3
  1202. (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
  1203. -rm -f $(DESTDIR)$(BINDIR)/2to3
  1204. (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3)
  1205. if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
  1206. rm -f $(DESTDIR)$(BINDIR)/python3-32$(EXE); \
  1207. (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-32$(EXE) python3-32$(EXE)) \
  1208. fi
  1209. if test "x$(LIPO_INTEL64_FLAGS)" != "x" ; then \
  1210. rm -f $(DESTDIR)$(BINDIR)/python3-intel64$(EXE); \
  1211. (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-intel64$(EXE) python3-intel64$(EXE)) \
  1212. fi
  1213. # Install the versioned manual page
  1214. altmaninstall:
  1215. @for i in $(MANDIR) $(MANDIR)/man1; \
  1216. do \
  1217. if test ! -d $(DESTDIR)$$i; then \
  1218. echo "Creating directory $$i"; \
  1219. $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
  1220. else true; \
  1221. fi; \
  1222. done
  1223. $(INSTALL_DATA) $(srcdir)/Misc/python.man \
  1224. $(DESTDIR)$(MANDIR)/man1/python$(VERSION).1
  1225. # Install the unversioned manual page
  1226. maninstall: altmaninstall
  1227. -rm -f $(DESTDIR)$(MANDIR)/man1/python3.1
  1228. (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python$(VERSION).1 python3.1)
  1229. # Install the library
  1230. XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
  1231. LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
  1232. tkinter/test/test_ttk site-packages test \
  1233. test/audiodata \
  1234. test/capath test/data \
  1235. test/cjkencodings test/decimaltestdata \
  1236. test/xmltestdata test/xmltestdata/c14n-20 \
  1237. test/dtracedata \
  1238. test/eintrdata \
  1239. test/imghdrdata \
  1240. test/libregrtest \
  1241. test/subprocessdata test/sndhdrdata test/support \
  1242. test/tracedmodules test/encoded_modules \
  1243. test/test_import \
  1244. test/test_import/data \
  1245. test/test_import/data/circular_imports \
  1246. test/test_import/data/circular_imports/subpkg \
  1247. test/test_import/data/package \
  1248. test/test_import/data/package2 \
  1249. test/test_import/data/unwritable \
  1250. importlib \
  1251. importlib/metadata \
  1252. test/test_importlib \
  1253. test/test_importlib/builtin \
  1254. test/test_importlib/data \
  1255. test/test_importlib/data01 \
  1256. test/test_importlib/data01/subdirectory \
  1257. test/test_importlib/data02 \
  1258. test/test_importlib/data02/one \
  1259. test/test_importlib/data02/two \
  1260. test/test_importlib/data03 \
  1261. test/test_importlib/data03/namespace \
  1262. test/test_importlib/data03/namespace/portion1 \
  1263. test/test_importlib/data03/namespace/portion2 \
  1264. test/test_importlib/extension \
  1265. test/test_importlib/frozen \
  1266. test/test_importlib/import_ \
  1267. test/test_importlib/namespace_pkgs \
  1268. test/test_importlib/namespace_pkgs/both_portions \
  1269. test/test_importlib/namespace_pkgs/both_portions/foo \
  1270. test/test_importlib/namespace_pkgs/module_and_namespace_package \
  1271. test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test \
  1272. test/test_importlib/namespace_pkgs/not_a_namespace_pkg \
  1273. test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo \
  1274. test/test_importlib/namespace_pkgs/portion1 \
  1275. test/test_importlib/namespace_pkgs/portion1/foo \
  1276. test/test_importlib/namespace_pkgs/portion2 \
  1277. test/test_importlib/namespace_pkgs/portion2/foo \
  1278. test/test_importlib/namespace_pkgs/project1 \
  1279. test/test_importlib/namespace_pkgs/project1/parent \
  1280. test/test_importlib/namespace_pkgs/project1/parent/child \
  1281. test/test_importlib/namespace_pkgs/project2 \
  1282. test/test_importlib/namespace_pkgs/project2/parent \
  1283. test/test_importlib/namespace_pkgs/project2/parent/child \
  1284. test/test_importlib/namespace_pkgs/project3 \
  1285. test/test_importlib/namespace_pkgs/project3/parent \
  1286. test/test_importlib/namespace_pkgs/project3/parent/child \
  1287. test/test_importlib/partial \
  1288. test/test_importlib/source \
  1289. test/test_importlib/zipdata01 \
  1290. test/test_importlib/zipdata02 \
  1291. test/test_zoneinfo test/test_zoneinfo/data \
  1292. test/ziptestdata \
  1293. asyncio \
  1294. test/test_asyncio \
  1295. collections concurrent concurrent/futures encodings \
  1296. email email/mime test/test_email test/test_email/data \
  1297. ensurepip ensurepip/_bundled \
  1298. html json test/test_json http dbm xmlrpc \
  1299. sqlite3 sqlite3/test \
  1300. logging csv wsgiref urllib \
  1301. lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
  1302. lib2to3/tests/data lib2to3/tests/data/fixers \
  1303. lib2to3/tests/data/fixers/myfixes \
  1304. ctypes ctypes/test ctypes/macholib \
  1305. idlelib idlelib/Icons idlelib/idle_test \
  1306. distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
  1307. test/test_peg_generator \
  1308. test/test_tools test/test_warnings test/test_warnings/data \
  1309. turtledemo \
  1310. multiprocessing multiprocessing/dummy \
  1311. unittest unittest/test unittest/test/testmock \
  1312. venv venv/scripts venv/scripts/common venv/scripts/posix \
  1313. curses pydoc_data \
  1314. zoneinfo
  1315. libinstall: build_all $(srcdir)/Modules/xxmodule.c
  1316. @for i in $(SCRIPTDIR) $(LIBDEST); \
  1317. do \
  1318. if test ! -d $(DESTDIR)$$i; then \
  1319. echo "Creating directory $$i"; \
  1320. $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
  1321. else true; \
  1322. fi; \
  1323. done
  1324. @for d in $(LIBSUBDIRS); \
  1325. do \
  1326. a=$(srcdir)/Lib/$$d; \
  1327. if test ! -d $$a; then continue; else true; fi; \
  1328. b=$(LIBDEST)/$$d; \
  1329. if test ! -d $(DESTDIR)$$b; then \
  1330. echo "Creating directory $$b"; \
  1331. $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
  1332. else true; \
  1333. fi; \
  1334. done
  1335. @for i in $(srcdir)/Lib/*.py; \
  1336. do \
  1337. if test -x $$i; then \
  1338. $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
  1339. echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
  1340. else \
  1341. $(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
  1342. echo $(INSTALL_DATA) $$i $(LIBDEST); \
  1343. fi; \
  1344. done
  1345. @for d in $(LIBSUBDIRS); \
  1346. do \
  1347. a=$(srcdir)/Lib/$$d; \
  1348. if test ! -d $$a; then continue; else true; fi; \
  1349. if test `ls $$a | wc -l` -lt 1; then continue; fi; \
  1350. b=$(LIBDEST)/$$d; \
  1351. for i in $$a/*; \
  1352. do \
  1353. case $$i in \
  1354. *CVS) ;; \
  1355. *.py[co]) ;; \
  1356. *.orig) ;; \
  1357. *wininst-*.exe) ;; \
  1358. *~) ;; \
  1359. *) \
  1360. if test -d $$i; then continue; fi; \
  1361. if test -x $$i; then \
  1362. echo $(INSTALL_SCRIPT) $$i $$b; \
  1363. $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
  1364. else \
  1365. echo $(INSTALL_DATA) $$i $$b; \
  1366. $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
  1367. fi;; \
  1368. esac; \
  1369. done; \
  1370. done
  1371. $(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \
  1372. $(DESTDIR)$(LIBDEST); \
  1373. $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
  1374. if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
  1375. $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
  1376. $(DESTDIR)$(LIBDEST)/distutils/tests ; \
  1377. fi
  1378. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  1379. $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
  1380. -j0 -d $(LIBDEST) -f \
  1381. -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
  1382. $(DESTDIR)$(LIBDEST)
  1383. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  1384. $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
  1385. -j0 -d $(LIBDEST) -f \
  1386. -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
  1387. $(DESTDIR)$(LIBDEST)
  1388. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  1389. $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
  1390. -j0 -d $(LIBDEST) -f \
  1391. -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
  1392. $(DESTDIR)$(LIBDEST)
  1393. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  1394. $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
  1395. -j0 -d $(LIBDEST)/site-packages -f \
  1396. -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
  1397. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  1398. $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
  1399. -j0 -d $(LIBDEST)/site-packages -f \
  1400. -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
  1401. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  1402. $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
  1403. -j0 -d $(LIBDEST)/site-packages -f \
  1404. -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
  1405. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  1406. $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
  1407. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  1408. $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
  1409. # bpo-21536: Misc/python-config.sh is generated in the build directory
  1410. # from $(srcdir)Misc/python-config.sh.in.
  1411. python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
  1412. @ # Substitution happens here, as the completely-expanded BINDIR
  1413. @ # is not available in configure
  1414. sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py
  1415. @ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
  1416. LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config
  1417. @ # On Darwin, always use the python version of the script, the shell
  1418. @ # version doesn't use the compiler customizations that are provided
  1419. @ # in python (_osx_support.py).
  1420. @if test `uname -s` = Darwin; then \
  1421. cp python-config.py python-config; \
  1422. fi
  1423. # Install the include files
  1424. INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
  1425. inclinstall:
  1426. @for i in $(INCLDIRSTOMAKE); \
  1427. do \
  1428. if test ! -d $(DESTDIR)$$i; then \
  1429. echo "Creating directory $$i"; \
  1430. $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
  1431. else true; \
  1432. fi; \
  1433. done
  1434. @if test ! -d $(DESTDIR)$(INCLUDEPY)/cpython; then \
  1435. echo "Creating directory $(DESTDIR)$(INCLUDEPY)/cpython"; \
  1436. $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/cpython; \
  1437. else true; \
  1438. fi
  1439. @if test ! -d $(DESTDIR)$(INCLUDEPY)/internal; then \
  1440. echo "Creating directory $(DESTDIR)$(INCLUDEPY)/internal"; \
  1441. $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/internal; \
  1442. else true; \
  1443. fi
  1444. @for i in $(srcdir)/Include/*.h; \
  1445. do \
  1446. echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
  1447. $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
  1448. done
  1449. @for i in $(srcdir)/Include/cpython/*.h; \
  1450. do \
  1451. echo $(INSTALL_DATA) $$i $(INCLUDEPY)/cpython; \
  1452. $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/cpython; \
  1453. done
  1454. @for i in $(srcdir)/Include/internal/*.h; \
  1455. do \
  1456. echo $(INSTALL_DATA) $$i $(INCLUDEPY)/internal; \
  1457. $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/internal; \
  1458. done
  1459. $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
  1460. # Install the library and miscellaneous stuff needed for extending/embedding
  1461. # This goes into $(exec_prefix)
  1462. LIBPL= $(prefix)/lib/python3.9/config-$(VERSION)$(ABIFLAGS)-x86_64-linux-gnu
  1463. # pkgconfig directory
  1464. LIBPC= $(LIBDIR)/pkgconfig
  1465. libainstall: build_all python-config
  1466. @for i in $(LIBDIR) $(LIBPL) $(LIBPC) $(BINDIR); \
  1467. do \
  1468. if test ! -d $(DESTDIR)$$i; then \
  1469. echo "Creating directory $$i"; \
  1470. $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
  1471. else true; \
  1472. fi; \
  1473. done
  1474. @if test -d $(LIBRARY); then :; else \
  1475. if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
  1476. if test "$(SHLIB_SUFFIX)" = .dll; then \
  1477. $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
  1478. else \
  1479. $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
  1480. fi; \
  1481. else \
  1482. echo Skip install of $(LIBRARY) - use make frameworkinstall; \
  1483. fi; \
  1484. fi
  1485. $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
  1486. $(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o
  1487. $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
  1488. $(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
  1489. $(INSTALL_DATA) $(srcdir)/Modules/Setup $(DESTDIR)$(LIBPL)/Setup
  1490. $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
  1491. $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
  1492. $(INSTALL_DATA) Misc/python-embed.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)-embed.pc
  1493. $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
  1494. $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
  1495. $(INSTALL_SCRIPT) python-config.py $(DESTDIR)$(LIBPL)/python-config.py
  1496. $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(LDVERSION)-config
  1497. @if [ -s Modules/python.exp -a \
  1498. "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
  1499. echo; echo "Installing support files for building shared extension modules on AIX:"; \
  1500. $(INSTALL_DATA) Modules/python.exp \
  1501. $(DESTDIR)$(LIBPL)/python.exp; \
  1502. echo; echo "$(LIBPL)/python.exp"; \
  1503. $(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix \
  1504. $(DESTDIR)$(LIBPL)/makexp_aix; \
  1505. echo "$(LIBPL)/makexp_aix"; \
  1506. $(INSTALL_SCRIPT) Modules/ld_so_aix \
  1507. $(DESTDIR)$(LIBPL)/ld_so_aix; \
  1508. echo "$(LIBPL)/ld_so_aix"; \
  1509. echo; echo "See Misc/AIX-NOTES for details."; \
  1510. else true; \
  1511. fi
  1512. # Install the dynamically loadable modules
  1513. # This goes into $(exec_prefix)
  1514. sharedinstall: sharedmods
  1515. $(RUNSHARED) $(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
  1516. --prefix=$(prefix) \
  1517. --install-scripts=$(BINDIR) \
  1518. --install-platlib=$(DESTSHARED) \
  1519. --root=$(DESTDIR)/
  1520. -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py
  1521. -rm -r $(DESTDIR)$(DESTSHARED)/__pycache__
  1522. # Here are a couple of targets for MacOSX again, to install a full
  1523. # framework-based Python. frameworkinstall installs everything, the
  1524. # subtargets install specific parts. Much of the actual work is offloaded to
  1525. # the Makefile in Mac
  1526. #
  1527. #
  1528. # This target is here for backward compatibility, previous versions of Python
  1529. # hadn't integrated framework installation in the normal install process.
  1530. frameworkinstall: install
  1531. # On install, we re-make the framework
  1532. # structure in the install location, /Library/Frameworks/ or the argument to
  1533. # --enable-framework. If --enable-framework has been specified then we have
  1534. # automatically set prefix to the location deep down in the framework, so we
  1535. # only have to cater for the structural bits of the framework.
  1536. frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
  1537. frameworkinstallstructure: $(LDLIBRARY)
  1538. @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
  1539. echo Not configured with --enable-framework; \
  1540. exit 1; \
  1541. else true; \
  1542. fi
  1543. @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
  1544. if test ! -d $(DESTDIR)$$i; then \
  1545. echo "Creating directory $(DESTDIR)$$i"; \
  1546. $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
  1547. else true; \
  1548. fi; \
  1549. done
  1550. $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
  1551. sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
  1552. $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
  1553. $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
  1554. $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
  1555. $(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
  1556. $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
  1557. # This installs Mac/Lib into the framework
  1558. # Install a number of symlinks to keep software that expects a normal unix
  1559. # install (which includes python-config) happy.
  1560. frameworkinstallmaclib:
  1561. $(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(LDVERSION).a"
  1562. $(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(LDVERSION).dylib"
  1563. $(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(VERSION).a"
  1564. $(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(VERSION).dylib"
  1565. $(LN) -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(LDVERSION).dylib"
  1566. $(LN) -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(VERSION).dylib"
  1567. # This installs the IDE, the Launcher and other apps into /Applications
  1568. frameworkinstallapps:
  1569. cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
  1570. # Build the bootstrap executable that will spawn the interpreter inside
  1571. # an app bundle within the framework. This allows the interpreter to
  1572. # run OS X GUI APIs.
  1573. frameworkpythonw:
  1574. cd Mac && $(MAKE) pythonw
  1575. # This installs the python* and other bin symlinks in $prefix/bin or in
  1576. # a bin directory relative to the framework root
  1577. frameworkinstallunixtools:
  1578. cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
  1579. frameworkaltinstallunixtools:
  1580. cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"
  1581. # This installs the Tools into the applications directory.
  1582. # It is not part of a normal frameworkinstall
  1583. frameworkinstallextras:
  1584. cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)"
  1585. # Build the toplevel Makefile
  1586. Makefile.pre: $(srcdir)/Makefile.pre.in config.status
  1587. CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
  1588. $(MAKE) -f Makefile.pre Makefile
  1589. # Run the configure script.
  1590. config.status: $(srcdir)/configure
  1591. $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
  1592. .PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
  1593. # Some make's put the object file in the current directory
  1594. .c.o:
  1595. $(CC) -c $(PY_CORE_CFLAGS) -o $@ $<
  1596. # bpo-30104: dtoa.c uses union to cast double to unsigned long[2]. clang 4.0
  1597. # with -O2 or higher and strict aliasing miscompiles the ratio() function
  1598. # causing rounding issues. Compile dtoa.c using -fno-strict-aliasing on clang.
  1599. # https://bugs.llvm.org//show_bug.cgi?id=31928
  1600. Python/dtoa.o: Python/dtoa.c
  1601. $(CC) -c $(PY_CORE_CFLAGS) $(CFLAGS_ALIASING) -o $@ $<
  1602. # Run reindent on the library
  1603. reindent:
  1604. ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
  1605. # Rerun configure with the same options as it was run last time,
  1606. # provided the config.status script exists
  1607. recheck:
  1608. $(SHELL) config.status --recheck
  1609. $(SHELL) config.status
  1610. # Regenerate configure and pyconfig.h.in
  1611. .PHONY: autoconf
  1612. autoconf:
  1613. # Regenerate the configure script from configure.ac using autoconf
  1614. (cd $(srcdir); autoconf -Wall)
  1615. # Regenerate pyconfig.h.in from configure.ac using autoheader
  1616. (cd $(srcdir); autoheader -Wall)
  1617. # Create a tags file for vi
  1618. tags::
  1619. ctags -w $(srcdir)/Include/*.h $(srcdir)/Include/cpython/*.h $(srcdir)/Include/internal/*.h
  1620. for i in $(SRCDIRS); do ctags -f tags -w -a $(srcdir)/$$i/*.[ch]; done
  1621. ctags -f tags -w -a $(srcdir)/Modules/_ctypes/*.[ch]
  1622. 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 -
  1623. LC_ALL=C sort -o tags tags
  1624. # Create a tags file for GNU Emacs
  1625. TAGS::
  1626. cd $(srcdir); \
  1627. etags Include/*.h Include/cpython/*.h Include/internal/*.h; \
  1628. for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
  1629. etags -a $(srcdir)/Modules/_ctypes/*.[ch]
  1630. find $(srcdir)/Lib -type f -name "*.py" -not -name "test_*.py" -not -path "*/test/*" -not -path "*/tests/*" -not -path "*/*_test/*" | etags - -a
  1631. # Sanitation targets -- clean leaves libraries, executables and tags
  1632. # files, which clobber removes as well
  1633. pycremoval:
  1634. -find $(srcdir) -depth -name '__pycache__' -exec rm -rf {} ';'
  1635. -find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
  1636. rmtestturds:
  1637. -rm -f *BAD *GOOD *SKIPPED
  1638. -rm -rf OUT
  1639. -rm -f *.TXT
  1640. -rm -f *.txt
  1641. -rm -f gb-18030-2000.xml
  1642. docclean:
  1643. -rm -rf Doc/build
  1644. -rm -rf Doc/tools/sphinx Doc/tools/pygments Doc/tools/docutils
  1645. # like the 'clean' target but retain the profile guided optimization (PGO)
  1646. # data. The PGO data is only valid if source code remains unchanged.
  1647. clean-retain-profile: pycremoval
  1648. find . -name '*.[oa]' -exec rm -f {} ';'
  1649. find . -name '*.s[ol]' -exec rm -f {} ';'
  1650. find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
  1651. find . -name '*.lst' -exec rm -f {} ';'
  1652. find build -name 'fficonfig.h' -exec rm -f {} ';' || true
  1653. find build -name '*.py' -exec rm -f {} ';' || true
  1654. find build -name '*.py[co]' -exec rm -f {} ';' || true
  1655. -rm -f pybuilddir.txt
  1656. -rm -f Lib/lib2to3/*Grammar*.pickle
  1657. -rm -f Programs/_testembed Programs/_freeze_importlib
  1658. -find build -type f -a ! -name '*.gc??' -exec rm -f {} ';'
  1659. -rm -f Include/pydtrace_probes.h
  1660. -rm -f profile-gen-stamp
  1661. profile-removal:
  1662. find . -name '*.gc??' -exec rm -f {} ';'
  1663. find . -name '*.profclang?' -exec rm -f {} ';'
  1664. find . -name '*.dyn' -exec rm -f {} ';'
  1665. rm -f $(COVERAGE_INFO)
  1666. rm -rf $(COVERAGE_REPORT)
  1667. rm -f profile-run-stamp
  1668. clean: clean-retain-profile
  1669. @if test profile-opt = profile-opt; then \
  1670. rm -f profile-gen-stamp profile-clean-stamp; \
  1671. $(MAKE) profile-removal; \
  1672. fi
  1673. clobber: clean
  1674. -rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
  1675. tags TAGS \
  1676. config.cache config.log pyconfig.h Modules/config.c
  1677. -rm -rf build platform
  1678. -rm -rf $(PYTHONFRAMEWORKDIR)
  1679. -rm -f python-config.py python-config
  1680. # Make things extra clean, before making a distribution:
  1681. # remove all generated files, even Makefile[.pre]
  1682. # Keep configure and Python-ast.[ch], it's possible they can't be generated
  1683. distclean: clobber
  1684. for file in $(srcdir)/Lib/test/data/* ; do \
  1685. if test "$$file" != "$(srcdir)/Lib/test/data/README"; then rm "$$file"; fi; \
  1686. done
  1687. -rm -f core Makefile Makefile.pre config.status Modules/Setup.local \
  1688. Modules/ld_so_aix Modules/python.exp Misc/python.pc \
  1689. Misc/python-embed.pc Misc/python-config.sh
  1690. -rm -f python*-gdb.py
  1691. # Issue #28258: set LC_ALL to avoid issues with Estonian locale.
  1692. # Expansion is performed here by shell (spawned by make) itself before
  1693. # arguments are passed to find. So LC_ALL=C must be set as a separate
  1694. # command.
  1695. LC_ALL=C; find $(srcdir)/[a-zA-Z]* '(' -name '*.fdc' -o -name '*~' \
  1696. -o -name '[@,#]*' -o -name '*.old' \
  1697. -o -name '*.orig' -o -name '*.rej' \
  1698. -o -name '*.bak' ')' \
  1699. -exec rm -f {} ';'
  1700. # Check that all symbols exported by libpython start with "Py" or "_Py"
  1701. smelly: build_all
  1702. $(RUNSHARED) ./$(BUILDPYTHON) Tools/scripts/smelly.py
  1703. # Find files with funny names
  1704. funny:
  1705. find $(SUBDIRS) $(SUBDIRSTOO) \
  1706. -type d \
  1707. -o -name '*.[chs]' \
  1708. -o -name '*.py' \
  1709. -o -name '*.pyw' \
  1710. -o -name '*.dat' \
  1711. -o -name '*.el' \
  1712. -o -name '*.fd' \
  1713. -o -name '*.in' \
  1714. -o -name '*.gif' \
  1715. -o -name '*.txt' \
  1716. -o -name '*.xml' \
  1717. -o -name '*.xbm' \
  1718. -o -name '*.xpm' \
  1719. -o -name '*.uue' \
  1720. -o -name '*.decTest' \
  1721. -o -name '*.tmCommand' \
  1722. -o -name '*.tmSnippet' \
  1723. -o -name 'Setup' \
  1724. -o -name 'Setup.*' \
  1725. -o -name README \
  1726. -o -name NEWS \
  1727. -o -name HISTORY \
  1728. -o -name Makefile \
  1729. -o -name ChangeLog \
  1730. -o -name .hgignore \
  1731. -o -name MANIFEST \
  1732. -o -print
  1733. # Perform some verification checks on any modified files.
  1734. patchcheck: build_all
  1735. $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
  1736. .PHONY: update-config
  1737. update-config:
  1738. curl -sL -o config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
  1739. curl -sL -o config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
  1740. chmod +x config.guess config.sub
  1741. # Dependencies
  1742. Python/thread.o: $(srcdir)/Python/thread_nt.h $(srcdir)/Python/thread_pthread.h $(srcdir)/Python/condvar.h
  1743. # Declare targets that aren't real files
  1744. .PHONY: all build_all sharedmods check-clean-src oldsharedmods test quicktest
  1745. .PHONY: install altinstall oldsharedinstall bininstall altbininstall
  1746. .PHONY: maninstall libinstall inclinstall libainstall sharedinstall
  1747. .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
  1748. .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
  1749. .PHONY: frameworkaltinstallunixtools recheck clean clobber distclean
  1750. .PHONY: smelly funny patchcheck touch altmaninstall commoninstall
  1751. .PHONY: clean-retain-profile profile-removal run_profile_task
  1752. .PHONY: build_all_generate_profile build_all_merge_profile
  1753. .PHONY: gdbhooks
  1754. # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
  1755. # Local Variables:
  1756. # mode: makefile
  1757. # End:
  1758. # Rules appended by makesetup
  1759. Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/posixmodule.c -o Modules/posixmodule.o
  1760. Modules/posix$(EXT_SUFFIX): Modules/posixmodule.o; $(BLDSHARED) Modules/posixmodule.o -o Modules/posix$(EXT_SUFFIX)
  1761. Modules/errnomodule.o: $(srcdir)/Modules/errnomodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/errnomodule.c -o Modules/errnomodule.o
  1762. Modules/errno$(EXT_SUFFIX): Modules/errnomodule.o; $(BLDSHARED) Modules/errnomodule.o -o Modules/errno$(EXT_SUFFIX)
  1763. Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/pwdmodule.c -o Modules/pwdmodule.o
  1764. Modules/pwd$(EXT_SUFFIX): Modules/pwdmodule.o; $(BLDSHARED) Modules/pwdmodule.o -o Modules/pwd$(EXT_SUFFIX)
  1765. Modules/_sre.o: $(srcdir)/Modules/_sre.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_sre.c -o Modules/_sre.o
  1766. Modules/_sre$(EXT_SUFFIX): Modules/_sre.o; $(BLDSHARED) Modules/_sre.o -o Modules/_sre$(EXT_SUFFIX)
  1767. Modules/_codecsmodule.o: $(srcdir)/Modules/_codecsmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_codecsmodule.c -o Modules/_codecsmodule.o
  1768. Modules/_codecs$(EXT_SUFFIX): Modules/_codecsmodule.o; $(BLDSHARED) Modules/_codecsmodule.o -o Modules/_codecs$(EXT_SUFFIX)
  1769. Modules/_weakref.o: $(srcdir)/Modules/_weakref.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_weakref.c -o Modules/_weakref.o
  1770. Modules/_weakref$(EXT_SUFFIX): Modules/_weakref.o; $(BLDSHARED) Modules/_weakref.o -o Modules/_weakref$(EXT_SUFFIX)
  1771. Modules/_functoolsmodule.o: $(srcdir)/Modules/_functoolsmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/_functoolsmodule.c -o Modules/_functoolsmodule.o
  1772. Modules/_functools$(EXT_SUFFIX): Modules/_functoolsmodule.o; $(BLDSHARED) Modules/_functoolsmodule.o -o Modules/_functools$(EXT_SUFFIX)
  1773. Modules/_operator.o: $(srcdir)/Modules/_operator.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_operator.c -o Modules/_operator.o
  1774. Modules/_operator$(EXT_SUFFIX): Modules/_operator.o; $(BLDSHARED) Modules/_operator.o -o Modules/_operator$(EXT_SUFFIX)
  1775. Modules/_collectionsmodule.o: $(srcdir)/Modules/_collectionsmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_collectionsmodule.c -o Modules/_collectionsmodule.o
  1776. Modules/_collections$(EXT_SUFFIX): Modules/_collectionsmodule.o; $(BLDSHARED) Modules/_collectionsmodule.o -o Modules/_collections$(EXT_SUFFIX)
  1777. Modules/_abc.o: $(srcdir)/Modules/_abc.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_abc.c -o Modules/_abc.o
  1778. Modules/_abc$(EXT_SUFFIX): Modules/_abc.o; $(BLDSHARED) Modules/_abc.o -o Modules/_abc$(EXT_SUFFIX)
  1779. Modules/itertoolsmodule.o: $(srcdir)/Modules/itertoolsmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/itertoolsmodule.c -o Modules/itertoolsmodule.o
  1780. Modules/itertools$(EXT_SUFFIX): Modules/itertoolsmodule.o; $(BLDSHARED) Modules/itertoolsmodule.o -o Modules/itertools$(EXT_SUFFIX)
  1781. Modules/atexitmodule.o: $(srcdir)/Modules/atexitmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/atexitmodule.c -o Modules/atexitmodule.o
  1782. Modules/atexit$(EXT_SUFFIX): Modules/atexitmodule.o; $(BLDSHARED) Modules/atexitmodule.o -o Modules/atexit$(EXT_SUFFIX)
  1783. Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/signalmodule.c -o Modules/signalmodule.o
  1784. Modules/_signal$(EXT_SUFFIX): Modules/signalmodule.o; $(BLDSHARED) Modules/signalmodule.o -o Modules/_signal$(EXT_SUFFIX)
  1785. Modules/_stat.o: $(srcdir)/Modules/_stat.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_stat.c -o Modules/_stat.o
  1786. Modules/_stat$(EXT_SUFFIX): Modules/_stat.o; $(BLDSHARED) Modules/_stat.o -o Modules/_stat$(EXT_SUFFIX)
  1787. Modules/timemodule.o: $(srcdir)/Modules/timemodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/timemodule.c -o Modules/timemodule.o
  1788. Modules/time$(EXT_SUFFIX): Modules/timemodule.o; $(BLDSHARED) Modules/timemodule.o -o Modules/time$(EXT_SUFFIX)
  1789. Modules/_threadmodule.o: $(srcdir)/Modules/_threadmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/_threadmodule.c -o Modules/_threadmodule.o
  1790. Modules/_thread$(EXT_SUFFIX): Modules/_threadmodule.o; $(BLDSHARED) Modules/_threadmodule.o -o Modules/_thread$(EXT_SUFFIX)
  1791. Modules/_localemodule.o: $(srcdir)/Modules/_localemodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -c $(srcdir)/Modules/_localemodule.c -o Modules/_localemodule.o
  1792. Modules/_locale$(EXT_SUFFIX): Modules/_localemodule.o; $(BLDSHARED) Modules/_localemodule.o -o Modules/_locale$(EXT_SUFFIX)
  1793. Modules/_iomodule.o: $(srcdir)/Modules/_io/_iomodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/_iomodule.c -o Modules/_iomodule.o
  1794. Modules/iobase.o: $(srcdir)/Modules/_io/iobase.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/iobase.c -o Modules/iobase.o
  1795. Modules/fileio.o: $(srcdir)/Modules/_io/fileio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/fileio.c -o Modules/fileio.o
  1796. Modules/bytesio.o: $(srcdir)/Modules/_io/bytesio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/bytesio.c -o Modules/bytesio.o
  1797. Modules/bufferedio.o: $(srcdir)/Modules/_io/bufferedio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/bufferedio.c -o Modules/bufferedio.o
  1798. Modules/textio.o: $(srcdir)/Modules/_io/textio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/textio.c -o Modules/textio.o
  1799. Modules/stringio.o: $(srcdir)/Modules/_io/stringio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/stringio.c -o Modules/stringio.o
  1800. Modules/_io$(EXT_SUFFIX): Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o; $(BLDSHARED) Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o -o Modules/_io$(EXT_SUFFIX)
  1801. Modules/faulthandler.o: $(srcdir)/Modules/faulthandler.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/faulthandler.c -o Modules/faulthandler.o
  1802. Modules/faulthandler$(EXT_SUFFIX): Modules/faulthandler.o; $(BLDSHARED) Modules/faulthandler.o -o Modules/faulthandler$(EXT_SUFFIX)
  1803. Modules/_tracemalloc.o: $(srcdir)/Modules/_tracemalloc.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_tracemalloc.c -o Modules/_tracemalloc.o
  1804. Modules/_tracemalloc$(EXT_SUFFIX): Modules/_tracemalloc.o; $(BLDSHARED) Modules/_tracemalloc.o -o Modules/_tracemalloc$(EXT_SUFFIX)
  1805. Modules/_peg_parser.o: $(srcdir)/Modules/_peg_parser.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/_peg_parser.c -o Modules/_peg_parser.o
  1806. Modules/_peg_parser$(EXT_SUFFIX): Modules/_peg_parser.o; $(BLDSHARED) Modules/_peg_parser.o -o Modules/_peg_parser$(EXT_SUFFIX)
  1807. Modules/symtablemodule.o: $(srcdir)/Modules/symtablemodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/symtablemodule.c -o Modules/symtablemodule.o
  1808. Modules/_symtable$(EXT_SUFFIX): Modules/symtablemodule.o; $(BLDSHARED) Modules/symtablemodule.o -o Modules/_symtable$(EXT_SUFFIX)
  1809. Modules/xxsubtype.o: $(srcdir)/Modules/xxsubtype.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS) -c $(srcdir)/Modules/xxsubtype.c -o Modules/xxsubtype.o
  1810. Modules/xxsubtype$(EXT_SUFFIX): Modules/xxsubtype.o; $(BLDSHARED) Modules/xxsubtype.o -o Modules/xxsubtype$(EXT_SUFFIX)