2021-08-08 21:19:30 +00:00
|
|
|
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
|
|
|
|
#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘
|
|
|
|
|
2021-08-09 13:52:35 +00:00
|
|
|
# this file contains the recipes for the C extensions
|
2021-08-08 21:19:30 +00:00
|
|
|
# that are included with the Python source distribution
|
|
|
|
# the list of modules are also provided in Modules/config.c
|
|
|
|
# so any changes here must be reflected there as well
|
|
|
|
|
|
|
|
|
|
|
|
# these modules are always required
|
|
|
|
|
|
|
|
# _elementtree
|
2021-08-09 15:59:18 +00:00
|
|
|
EXTMODULE_ELEMENTTREE_SRCS = \
|
2021-08-08 21:19:30 +00:00
|
|
|
third_party/python/Modules/_elementtree.c
|
|
|
|
|
|
|
|
EXTMODULE_ELEMENTTREE_OBJS = \
|
2021-08-09 15:59:18 +00:00
|
|
|
$(EXTMODULE_ELEMENTTREE_SRCS:%.c=o/$(MODE)/%.o)
|
2021-08-08 21:19:30 +00:00
|
|
|
|
2021-08-09 13:52:35 +00:00
|
|
|
# _io
|
2021-08-09 15:59:18 +00:00
|
|
|
EXTMODULE_IO_SRCS = \
|
|
|
|
third_party/python/Modules/_io/_iomodule.c \
|
|
|
|
third_party/python/Modules/_io/bufferedio.c \
|
|
|
|
third_party/python/Modules/_io/bytesio.c \
|
|
|
|
third_party/python/Modules/_io/fileio.c \
|
|
|
|
third_party/python/Modules/_io/iobase.c \
|
|
|
|
third_party/python/Modules/_io/stringio.c \
|
|
|
|
third_party/python/Modules/_io/textio.c
|
2021-08-08 21:19:30 +00:00
|
|
|
|
2021-08-09 13:52:35 +00:00
|
|
|
EXTMODULE_IO_OBJS = \
|
2021-08-09 15:59:18 +00:00
|
|
|
$(EXTMODULE_IO_SRCS:%.c=o/$(MODE)/%.o)
|
2021-08-08 21:19:30 +00:00
|
|
|
|
|
|
|
# _tracemalloc
|
2021-08-09 15:59:18 +00:00
|
|
|
EXTMODULE_TRACEMALLOC_SRCS = \
|
2021-08-09 13:52:35 +00:00
|
|
|
third_party/python/Modules/_tracemalloc.c \
|
2021-08-08 21:19:30 +00:00
|
|
|
third_party/python/Modules/hashtable.c
|
|
|
|
|
|
|
|
# these modules don't rely on POSIX
|
2021-08-09 15:59:18 +00:00
|
|
|
EXTMODULE_BASE_INDEP_SRCS = \
|
2021-08-09 13:52:35 +00:00
|
|
|
third_party/python/Modules/gcmodule.c \
|
|
|
|
third_party/python/Modules/arraymodule.c \
|
|
|
|
third_party/python/Modules/cmathmodule.c \
|
|
|
|
third_party/python/Modules/mathmodule.c \
|
2021-08-08 21:19:30 +00:00
|
|
|
third_party/python/Modules/_math.c \
|
2021-08-09 13:52:35 +00:00
|
|
|
third_party/python/Modules/_struct.c \
|
|
|
|
third_party/python/Modules/_weakref.c \
|
|
|
|
third_party/python/Modules/_testcapimodule.c \
|
2021-08-08 21:19:30 +00:00
|
|
|
third_party/python/Modules/_randommodule.c \
|
|
|
|
third_party/python/Modules/_pickle.c \
|
2021-08-09 13:52:35 +00:00
|
|
|
third_party/python/Modules/_datetimemodule.c \
|
2021-08-08 21:19:30 +00:00
|
|
|
third_party/python/Modules/_bisectmodule.c \
|
|
|
|
third_party/python/Modules/_heapqmodule.c \
|
|
|
|
third_party/python/Modules/unicodedata.c \
|
2021-08-09 15:59:18 +00:00
|
|
|
$(EXTMODULE_TRACEMALLOC_SRCS) \
|
|
|
|
$(EXTMODULE_ELEMENTTREE_SRCS)
|
2021-08-09 13:52:35 +00:00
|
|
|
|
2021-08-08 21:19:30 +00:00
|
|
|
|
|
|
|
# these modules require POSIX-compliant libs
|
2021-08-09 15:59:18 +00:00
|
|
|
EXTMODULE_BASE_POSIX_SRCS = \
|
2021-08-08 21:19:30 +00:00
|
|
|
third_party/python/Modules/main.c \
|
2021-08-09 13:52:35 +00:00
|
|
|
third_party/python/Modules/posixmodule.c \
|
|
|
|
third_party/python/Modules/errnomodule.c \
|
|
|
|
third_party/python/Modules/pwdmodule.c \
|
2021-08-08 21:19:30 +00:00
|
|
|
third_party/python/Modules/_sre.c \
|
2021-08-09 13:52:35 +00:00
|
|
|
third_party/python/Modules/_codecsmodule.c \
|
|
|
|
third_party/python/Modules/_functoolsmodule.c \
|
|
|
|
third_party/python/Modules/_operator.c \
|
|
|
|
third_party/python/Modules/_collectionsmodule.c \
|
|
|
|
third_party/python/Modules/itertoolsmodule.c \
|
|
|
|
third_party/python/Modules/atexitmodule.c \
|
|
|
|
third_party/python/Modules/signalmodule.c \
|
2021-08-08 21:19:30 +00:00
|
|
|
third_party/python/Modules/_stat.c \
|
2021-08-09 13:52:35 +00:00
|
|
|
third_party/python/Modules/timemodule.c \
|
|
|
|
third_party/python/Modules/zipimport.c \
|
|
|
|
third_party/python/Modules/faulthandler.c \
|
|
|
|
third_party/python/Modules/symtablemodule.c \
|
|
|
|
third_party/python/Modules/fcntlmodule.c \
|
|
|
|
third_party/python/Modules/grpmodule.c \
|
|
|
|
third_party/python/Modules/selectmodule.c \
|
|
|
|
third_party/python/Modules/mmapmodule.c \
|
2021-08-08 21:19:30 +00:00
|
|
|
third_party/python/Modules/_csv.c \
|
2021-08-09 13:52:35 +00:00
|
|
|
third_party/python/Modules/_localemodule.c \
|
2021-08-09 15:59:18 +00:00
|
|
|
$(EXTMODULE_IO_SRCS)
|
2021-08-08 21:19:30 +00:00
|
|
|
|
|
|
|
# optional modules
|
|
|
|
|
|
|
|
# _blake
|
2021-08-09 15:59:18 +00:00
|
|
|
EXTMODULE_BLAKE_SRCS = \
|
|
|
|
third_party/python/Modules/_blake2/blake2b_impl.c \
|
|
|
|
third_party/python/Modules/_blake2/blake2module.c \
|
|
|
|
third_party/python/Modules/_blake2/blake2s_impl.c
|
2021-08-08 21:19:30 +00:00
|
|
|
|
2021-08-09 13:52:35 +00:00
|
|
|
EXTMODULE_BLAKE_OBJS = \
|
2021-08-09 15:59:18 +00:00
|
|
|
$(EXTMODULE_BLAKE_SRCS:%.c=o/$(MODE)/%.o)
|
2021-08-08 21:19:30 +00:00
|
|
|
|
|
|
|
# pyexpat
|
2021-08-09 15:59:18 +00:00
|
|
|
EXTMODULE_PYEXPAT_SRCS = \
|
2021-08-08 21:19:30 +00:00
|
|
|
third_party/python/Modules/expat/xmlparse.c \
|
|
|
|
third_party/python/Modules/expat/xmlrole.c \
|
|
|
|
third_party/python/Modules/expat/xmltok.c \
|
|
|
|
third_party/python/Modules/pyexpat.c
|
|
|
|
|
2021-08-09 13:52:35 +00:00
|
|
|
EXTMODULE_PYEXPAT_OBJS = \
|
2021-08-09 15:59:18 +00:00
|
|
|
$(EXTMODULE_PYEXPAT_SRCS:%.c=o/$(MODE)/%.o)
|
2021-08-08 21:19:30 +00:00
|
|
|
|
|
|
|
# lsprof
|
2021-08-09 15:59:18 +00:00
|
|
|
EXTMODULE_LSPROF_SRCS = \
|
2021-08-08 21:19:30 +00:00
|
|
|
third_party/python/Modules/_lsprof.c \
|
2021-08-09 13:52:35 +00:00
|
|
|
third_party/python/Modules/rotatingtree.c
|
2021-08-08 21:19:30 +00:00
|
|
|
|
|
|
|
# CJK codecs
|
2021-08-09 15:59:18 +00:00
|
|
|
EXTMODULE_CJKCODECS_SRCS = \
|
|
|
|
third_party/python/Modules/cjkcodecs/_codecs_cn.c \
|
|
|
|
third_party/python/Modules/cjkcodecs/_codecs_hk.c \
|
|
|
|
third_party/python/Modules/cjkcodecs/_codecs_iso2022.c \
|
|
|
|
third_party/python/Modules/cjkcodecs/_codecs_jp.c \
|
|
|
|
third_party/python/Modules/cjkcodecs/_codecs_kr.c \
|
|
|
|
third_party/python/Modules/cjkcodecs/_codecs_tw.c \
|
|
|
|
third_party/python/Modules/cjkcodecs/multibytecodec.c
|
2021-08-08 21:19:30 +00:00
|
|
|
|
|
|
|
# sqlite
|
|
|
|
|
|
|
|
# bz2
|
|
|
|
|
|
|
|
# readline
|
|
|
|
|
|
|
|
# ctypes
|
|
|
|
|
|
|
|
# _ssl
|
|
|
|
|
|
|
|
# _hashlib
|
|
|
|
|
|
|
|
|
|
|
|
# _decimal module (w/libmpdec)
|
2021-08-09 15:59:18 +00:00
|
|
|
EXTMODULE_DECIMAL_SRCS = \
|
|
|
|
third_party/python/Modules/_decimal/libmpdec/basearith.c \
|
|
|
|
third_party/python/Modules/_decimal/libmpdec/constants.c \
|
|
|
|
third_party/python/Modules/_decimal/libmpdec/context.c \
|
|
|
|
third_party/python/Modules/_decimal/libmpdec/convolute.c \
|
|
|
|
third_party/python/Modules/_decimal/libmpdec/crt.c \
|
|
|
|
third_party/python/Modules/_decimal/libmpdec/difradix2.c \
|
|
|
|
third_party/python/Modules/_decimal/libmpdec/fnt.c \
|
|
|
|
third_party/python/Modules/_decimal/libmpdec/fourstep.c \
|
|
|
|
third_party/python/Modules/_decimal/libmpdec/io.c \
|
|
|
|
third_party/python/Modules/_decimal/libmpdec/memory.c \
|
|
|
|
third_party/python/Modules/_decimal/libmpdec/mpdecimal.c \
|
|
|
|
third_party/python/Modules/_decimal/libmpdec/numbertheory.c \
|
|
|
|
third_party/python/Modules/_decimal/libmpdec/sixstep.c \
|
|
|
|
third_party/python/Modules/_decimal/libmpdec/transpose.c \
|
2021-08-08 21:19:30 +00:00
|
|
|
third_party/python/Modules/_decimal/_decimal.c
|
|
|
|
|
2021-08-09 13:52:35 +00:00
|
|
|
EXTMODULE_DECIMAL_OBJS = \
|
2021-08-09 15:59:18 +00:00
|
|
|
$(EXTMODULE_DECIMAL_SRCS:%.c=o/$(MODE)/%.o)
|
|
|
|
|
|
|
|
EXTMODULE_OPT_SRCS = \
|
|
|
|
$(EXTMODULE_CJKCODECS_SRCS) \
|
|
|
|
$(EXTMODULE_LSPROF_SRCS) \
|
|
|
|
$(EXTMODULE_BLAKE_SRCS) \
|
|
|
|
$(EXTMODULE_LSPROF_SRCS) \
|
|
|
|
$(EXTMODULE_DECIMAL_SRCS) \
|
|
|
|
$(EXTMODULE_PYEXPAT_SRCS) \
|
2021-08-08 21:19:30 +00:00
|
|
|
third_party/python/Modules/socketmodule.c \
|
|
|
|
third_party/python/Modules/md5module.c \
|
|
|
|
third_party/python/Modules/sha1module.c \
|
|
|
|
third_party/python/Modules/sha256module.c \
|
|
|
|
third_party/python/Modules/sha512module.c \
|
2021-08-09 13:52:35 +00:00
|
|
|
third_party/python/Modules/_sha3/sha3module.c \
|
2021-08-08 21:19:30 +00:00
|
|
|
third_party/python/Modules/resource.c \
|
2021-08-09 13:52:35 +00:00
|
|
|
third_party/python/Modules/_posixsubprocess.c \
|
2021-08-08 21:19:30 +00:00
|
|
|
third_party/python/Modules/syslogmodule.c \
|
|
|
|
third_party/python/Modules/binascii.c \
|
|
|
|
third_party/python/Modules/parsermodule.c \
|
|
|
|
third_party/python/Modules/syslogmodule.c \
|
|
|
|
third_party/python/Modules/fpectlmodule.c \
|
|
|
|
third_party/python/Modules/zlibmodule.c \
|
2021-08-09 13:52:35 +00:00
|
|
|
third_party/python/Modules/_json.c \
|
|
|
|
third_party/python/Modules/_opcode.c
|
2021-08-08 21:19:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
# add all of the module source files together to use in python.mk
|
2021-08-09 15:59:18 +00:00
|
|
|
THIRD_PARTY_PYTHON_MODULES_SRCS = \
|
2021-08-09 13:52:35 +00:00
|
|
|
third_party/python/Modules/config.c \
|
|
|
|
third_party/python/Modules/getbuildinfo.c \
|
|
|
|
third_party/python/Modules/getpath.c \
|
2021-08-09 15:59:18 +00:00
|
|
|
$(EXTMODULE_BASE_INDEP_SRCS) \
|
|
|
|
$(EXTMODULE_BASE_POSIX_SRCS) \
|
|
|
|
$(EXTMODULE_OPT_SRCS)
|
2021-08-08 21:19:30 +00:00
|
|
|
|
2021-08-09 13:52:35 +00:00
|
|
|
THIRD_PARTY_PYTHON_MODULES_OBJS = \
|
2021-08-09 15:59:18 +00:00
|
|
|
$(THIRD_PARTY_PYTHON_MODULES_SRCS:%.c=o/$(MODE)/%.o)
|
2021-08-08 21:19:30 +00:00
|
|
|
|
|
|
|
|
2021-08-09 13:52:35 +00:00
|
|
|
THIRD_PARTY_PYTHON_MODULES_DIRECTDEPS = \
|
2021-08-08 21:19:30 +00:00
|
|
|
THIRD_PARTY_ZLIB
|
|
|
|
# add sqlite if needed here
|
|
|
|
|
2021-08-09 13:52:35 +00:00
|
|
|
$(THIRD_PARTY_PYTHON_MODULES_OBJS): \
|
|
|
|
OVERRIDE_CFLAGS += \
|
2021-08-08 21:19:30 +00:00
|
|
|
-Ithird_party/python/Modules
|
|
|
|
|
2021-08-09 13:52:35 +00:00
|
|
|
o/$(MODE)/third_party/python/Modules/getbuildinfo.o: \
|
|
|
|
OVERRIDE_CFLAGS += \
|
|
|
|
-DGITVERSION='"3.6"' \
|
|
|
|
-DGITTAG='"3.6"' \
|
2021-08-08 21:19:30 +00:00
|
|
|
-DGITBRANCH='"cosmo"'
|
|
|
|
|
|
|
|
$(EXTMODULE_ELEMENTTREE_OBJS): \
|
2021-08-09 13:52:35 +00:00
|
|
|
OVERRIDE_CFLAGS += \
|
|
|
|
-DUSE_PYEXPAT_CAPI \
|
|
|
|
-DHAVE_EXPAT_CONFIG_H \
|
2021-08-08 21:19:30 +00:00
|
|
|
-Ithird_party/python/Modules/expat/
|
|
|
|
|
2021-08-09 13:52:35 +00:00
|
|
|
$(EXTMODULE_IO_OBJS): \
|
|
|
|
OVERRIDE_CFLAGS += \
|
2021-08-09 15:59:18 +00:00
|
|
|
-Ithird_party/python/Modules/_io
|
2021-08-08 21:19:30 +00:00
|
|
|
|
2021-08-09 13:52:35 +00:00
|
|
|
$(EXTMODULE_BLAKE_OBJS): \
|
|
|
|
OVERRIDE_CFLAGS += \
|
2021-08-08 21:19:30 +00:00
|
|
|
-DBLAKE_USE_SSE=1
|
|
|
|
|
2021-08-09 13:52:35 +00:00
|
|
|
$(EXTMODULE_PYEXPAT_OBJS): \
|
|
|
|
OVERRIDE_CFLAGS += \
|
|
|
|
-DXML_POOR_ENTROPY \
|
|
|
|
-DHAVE_EXPAT_CONFIG_H \
|
|
|
|
-DUSE_PYEXPAT_CAPI \
|
2021-08-08 21:19:30 +00:00
|
|
|
-Ithird_party/python/Modules/expat
|
|
|
|
|
2021-08-09 13:52:35 +00:00
|
|
|
$(EXTMODULE_DECIMAL_OBJS): \
|
|
|
|
OVERRIDE_CFLAGS += \
|
|
|
|
-Ithird_party/python/Modules/_decimal/ \
|
2021-08-08 21:19:30 +00:00
|
|
|
-Ithird_party/python/Modules/_decimal/libmpdec \
|
2021-08-09 13:52:35 +00:00
|
|
|
-DASM=1 \
|
2021-08-08 21:19:30 +00:00
|
|
|
-DCONFIG_64=1
|
|
|
|
|
|
|
|
o/$(MODE)/third_party/python/Modules/_decimal/libmpdec/transpose.o: \
|
2021-08-09 13:52:35 +00:00
|
|
|
OVERRIDE_CFLAGS += \
|
|
|
|
-DSTACK_FRAME_UNLIMITED
|