Skip to content

Instantly share code, notes, and snippets.

@nikhedonia
Created November 9, 2018 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikhedonia/bb016371a890bb8410dadddc7fb79dfb to your computer and use it in GitHub Desktop.
Save nikhedonia/bb016371a890bb8410dadddc7fb79dfb to your computer and use it in GitHub Desktop.
def merge_dicts(x, y):
z = x.copy()
z.update(y)
return z
cxx_library(
name = "python3.8m",
header_namespace= '',
compiler_flags = ["-fwrapv"],
preprocessor_flags = ["-DNDEBUG"],
exported_headers = merge_dicts(subdir_glob([
("Include/internal", "**/*.h"),
("Include", "**/*.h"),
("Modules", "**/*.h"),
("Objects", "**/*.h"),
("Parser", "**/*.h"),
("", "pyconfig.h")
]), {
}),
headers = merge_dicts(subdir_glob([
("Modules/_io", "**/*.h")
]), {
}),
srcs = [ (file, ["-DPy_BUILD_CORE","-DGITVERSION=\"fd512d7645\"","-DGITTAG=\"heads/master\"","-DGITBRANCH=\"master\""]) for file in glob(
["Modules/getbuildinfo.c"],
include_dotfiles=False,
excludes = []) ] +
[ (file, ["-DPy_BUILD_CORE"]) for file in glob(
["Modules/_io/*.c","Python/*.c","Parser/*.c","Objects/*.c","Modules/config.c","Modules/main.c","Modules/gcmodule.c","Modules/posixmodule.c","Modules/_functoolsmodule.c","Modules/signalmodule.c","Modules/timemodule.c","Modules/_threadmodule.c"],
include_dotfiles=False,
excludes = ["Modules/_io/winconsoleio.c","Python/dup2.c","Python/dynload_aix.c","Python/dynload_dl.c","Python/dynload_hpux.c","Python/dynload_shlib.c","Python/dynload_stub.c","Python/dynload_win.c","Python/getplatform.c","Python/strdup.c","Python/sysmodule.c","Parser/parsetok_pgen.c","Parser/pgenmain.c","Parser/printgrammar.c","Parser/tokenizer_pgen.c"]) ] +
[ (file, ["-DPy_BUILD_CORE","-DPLATFORM=\"linux\""]) for file in glob(
["Python/getplatform.c"],
include_dotfiles=False,
excludes = []) ] +
[ (file, ["-DPy_BUILD_CORE","-DABIFLAGS=\"m\"","-DMULTIARCH=\"x86_64-linux-gnu\""]) for file in glob(
["Python/sysmodule.c"],
include_dotfiles=False,
excludes = []) ] +
[ (file, ["-DPy_BUILD_CORE","-DSOABI=\"cpython-38m-x86_64-linux-gnu\""]) for file in glob(
["Python/dynload_shlib.c"],
include_dotfiles=False,
excludes = []) ] +
[ (file, ["-DPy_BUILD_CORE","-DPYTHONPATH=\"\"","-DPREFIX=\"/usr/local\"","-DEXEC_PREFIX=\"/usr/local\"","-DVERSION=\"3.8\"","-DVPATH=\"\""]) for file in glob(
["Modules/getpath.c"],
include_dotfiles=False,
excludes = []) ] +
glob(
["Modules/errnomodule.c","Modules/pwdmodule.c","Modules/_sre.c","Modules/_codecsmodule.c","Modules/_weakref.c","Modules/_operator.c","Modules/_collectionsmodule.c","Modules/_abc.c","Modules/itertoolsmodule.c","Modules/atexitmodule.c","Modules/_stat.c","Modules/_localemodule.c","Modules/faulthandler.c","Modules/_tracemalloc.c","Modules/hashtable.c","Modules/symtablemodule.c","Modules/xxsubtype.c"],
excludes = [],
include_dotfiles=False
) + [
],
linker_flags = [],
exported_linker_flags = ["-pthread"],
deps = [],
visibility = []
)
cxx_binary(
name = "exe-python", compiler_flags = ["-fwrapv"],
preprocessor_flags = ["-DNDEBUG","-DPy_BUILD_CORE"],
srcs = glob(
["Programs/python.c"],
excludes = [],
include_dotfiles=False
) + [
],
linker_flags = ["-lpthread","-ldl","-lutil","-lm"],
deps = [":python3.8m"],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment