Makefile 55 KB

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