2023-04-27 23:07:18 +02:00
|
|
|
cc_library(
|
|
|
|
name = "libfdt",
|
|
|
|
srcs = glob([
|
|
|
|
"libfdt/*.h",
|
|
|
|
"libfdt/*.c",
|
|
|
|
]),
|
|
|
|
copts = [
|
|
|
|
"-Werror",
|
|
|
|
"-Wno-macro-redefined",
|
|
|
|
"-Wno-sign-compare",
|
|
|
|
],
|
|
|
|
includes = ["libfdt"],
|
|
|
|
)
|
|
|
|
|
|
|
|
COPTS = [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
"-Wno-sign-compare",
|
|
|
|
"-Wno-missing-field-initializers",
|
|
|
|
"-Wno-unused-parameter",
|
|
|
|
]
|
|
|
|
|
|
|
|
genrule(
|
2023-10-11 17:37:55 +02:00
|
|
|
name = "dtc_lexer_srcs",
|
|
|
|
srcs = ["dtc-lexer.l"],
|
2023-04-27 23:07:18 +02:00
|
|
|
outs = ["dtc-lexer.lex.c"],
|
2023-10-11 17:37:55 +02:00
|
|
|
cmd = "lex -o $@ $<",
|
2023-04-27 23:07:18 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
genrule(
|
2023-10-11 17:37:55 +02:00
|
|
|
name = "dtc_parser_srcs",
|
2023-04-27 23:07:18 +02:00
|
|
|
srcs = ["dtc-parser.y"],
|
|
|
|
outs = [
|
|
|
|
"dtc-parser.c",
|
|
|
|
"dtc-parser.h",
|
|
|
|
],
|
2023-10-11 17:37:55 +02:00
|
|
|
cmd = "bison -d -o $(location dtc-parser.c) $(location dtc-parser.y)",
|
2023-04-27 23:07:18 +02:00
|
|
|
)
|
|
|
|
|
2023-10-11 17:37:49 +02:00
|
|
|
UTILS = [
|
|
|
|
"util.c",
|
|
|
|
"util.h",
|
2023-10-11 15:09:22 +02:00
|
|
|
":version_gen_header",
|
2023-10-11 17:37:49 +02:00
|
|
|
]
|
|
|
|
|
2023-10-11 15:09:22 +02:00
|
|
|
genrule(
|
|
|
|
name = "version_gen_header",
|
|
|
|
outs = ["version_gen.h"],
|
|
|
|
srcs = [
|
|
|
|
"METADATA",
|
|
|
|
"METADATA_version.sed",
|
|
|
|
"version_gen.h.in",
|
|
|
|
],
|
|
|
|
cmd = """
|
|
|
|
version="$$(sed -f $(location METADATA_version.sed) -n $(location METADATA))-Android-build"
|
|
|
|
sed s/@VCS_TAG@/$${version}/ $(location version_gen.h.in) > $@
|
|
|
|
""",
|
|
|
|
)
|
|
|
|
|
2023-04-27 23:07:18 +02:00
|
|
|
cc_binary(
|
|
|
|
name = "dtc",
|
2023-10-11 17:37:49 +02:00
|
|
|
srcs = UTILS + [
|
2023-10-11 17:37:55 +02:00
|
|
|
":dtc_lexer_srcs",
|
|
|
|
":dtc_parser_srcs",
|
2023-04-27 23:07:18 +02:00
|
|
|
"checks.c",
|
|
|
|
"data.c",
|
|
|
|
"dtc.c",
|
2023-10-11 17:37:49 +02:00
|
|
|
"dtc.h",
|
2023-04-27 23:07:18 +02:00
|
|
|
"flattree.c",
|
|
|
|
"fstree.c",
|
|
|
|
"livetree.c",
|
|
|
|
"srcpos.c",
|
2023-10-11 17:37:49 +02:00
|
|
|
"srcpos.h",
|
2023-04-27 23:07:18 +02:00
|
|
|
"treesource.c",
|
|
|
|
],
|
|
|
|
copts = COPTS,
|
|
|
|
defines = ["NO_YAML"],
|
2023-10-11 17:37:55 +02:00
|
|
|
deps = [":libfdt"],
|
2023-04-27 23:07:18 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_binary(
|
|
|
|
name = "fdtget",
|
2023-10-11 17:37:49 +02:00
|
|
|
srcs = UTILS + [
|
2023-04-27 23:07:18 +02:00
|
|
|
"fdtget.c",
|
|
|
|
],
|
|
|
|
copts = COPTS,
|
|
|
|
defines = ["NO_YAML"],
|
|
|
|
deps = [":libfdt"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_binary(
|
|
|
|
name = "fdtput",
|
2023-10-11 17:37:49 +02:00
|
|
|
srcs = UTILS + [
|
2023-04-27 23:07:18 +02:00
|
|
|
"fdtput.c",
|
|
|
|
],
|
|
|
|
copts = COPTS,
|
|
|
|
defines = ["NO_YAML"],
|
|
|
|
deps = [":libfdt"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_binary(
|
|
|
|
name = "fdtdump",
|
2023-10-11 17:37:49 +02:00
|
|
|
srcs = UTILS + [
|
2023-04-27 23:07:18 +02:00
|
|
|
"fdtdump.c",
|
|
|
|
],
|
|
|
|
copts = COPTS,
|
|
|
|
defines = ["NO_YAML"],
|
|
|
|
deps = [":libfdt"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_binary(
|
|
|
|
name = "fdtoverlay",
|
2023-10-11 17:37:49 +02:00
|
|
|
srcs = UTILS + [
|
2023-04-27 23:07:18 +02:00
|
|
|
"fdtoverlay.c",
|
|
|
|
],
|
|
|
|
copts = COPTS,
|
|
|
|
defines = ["NO_YAML"],
|
|
|
|
deps = [":libfdt"],
|
|
|
|
)
|