хорошо, я понял:
Содержимое Build.bazel:
load(":macro.bzl","buildmacro")
load(":SrcList.bzl","SrcLists","CommonDependencies")
[buildmacro(
current_module_name = Module[0][0],
current_module_srcs=Module[1],
current_module_hdrs=Module[2],
current_module_deps=Module[3] + CommonDependencies,
)for Module in SrcLists]
Содержимое macro.bzl:
def buildmacro(current_module_name,current_module_srcs,current_module_hdrs,current_module_deps):
native.cc_library(
name = current_module_name,
deps = current_module_deps,
srcs = current_module_srcs,
hdrs = current_module_hdrs,
linkstatic = 1,
visibility = ["//visibility:public"],
)
Пример файла SrcLists:
listofcode = [["nameofrule"]["srcfiles"]["headers"]["deps"]...]
listofcode2 = ...
SrcLists = [listofcode] + [listofcode2] ...
выполнить сборку базы: все