Merge changes I6b780c1d,I238d963a,I32076c65 into main

* changes:
  ANDROID: Generate version_gen.h in Soong and Bazel
  ANDROID: bazel: Clean up lexer and parser rules
  ANDROID: bazel: Fix dtc header dependencies
diff --git a/Android.bp b/Android.bp
index ba0ab24..2d121ec 100644
--- a/Android.bp
+++ b/Android.bp
@@ -44,13 +44,21 @@
 }
 
 cc_defaults {
-    name: "dt_defaults",
+    name: "dtc_cflags_defaults",
     cflags: [
         "-Wall",
         "-Werror",
-        "-Wno-sign-compare",
+        "-Wno-macro-redefined",
         "-Wno-missing-field-initializers",
+        "-Wno-sign-compare",
         "-Wno-unused-parameter",
+    ],
+}
+
+cc_defaults {
+    name: "dt_defaults",
+    defaults: ["dtc_cflags_defaults"],
+    cflags: [
         "-DNO_YAML"
     ],
 
diff --git a/BUILD.bazel b/BUILD.bazel
index 4a201d3..56aeed2 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -1,25 +1,22 @@
+COPTS = [
+    "-Wall",
+    "-Werror",
+    "-Wno-macro-redefined",
+    "-Wno-missing-field-initializers",
+    "-Wno-sign-compare",
+    "-Wno-unused-parameter",
+]
+
 cc_library(
     name = "libfdt",
     srcs = glob([
         "libfdt/*.h",
         "libfdt/*.c",
     ]),
-    copts = [
-        "-Werror",
-        "-Wno-macro-redefined",
-        "-Wno-sign-compare",
-    ],
+    copts = COPTS,
     includes = ["libfdt"],
 )
 
-COPTS = [
-    "-Wall",
-    "-Werror",
-    "-Wno-sign-compare",
-    "-Wno-missing-field-initializers",
-    "-Wno-unused-parameter",
-]
-
 genrule(
     name = "dtc_lexer_srcs",
     srcs = ["dtc-lexer.l"],
diff --git a/libfdt/Android.bp b/libfdt/Android.bp
index 8f4bdfd..0bf631a 100644
--- a/libfdt/Android.bp
+++ b/libfdt/Android.bp
@@ -7,12 +7,7 @@
 cc_library {
     name: "libfdt",
     host_supported: true,
-
-    cflags: [
-        "-Werror",
-        "-Wno-macro-redefined",
-        "-Wno-sign-compare",
-    ],
+    defaults: ["dtc_cflags_defaults"],
     srcs: [
         "fdt.c",
         "fdt_check.c",