1// Copyright 2016 The Android Open Source Project 2package { 3 default_applicable_licenses: ["external_dtc_license"], 4} 5 6// Added automatically by a large-scale-change that took the approach of 7// 'apply every license found to every target'. While this makes sure we respect 8// every license restriction, it may not be entirely correct. 9// 10// e.g. GPL in an MIT project might only apply to the contrib/ directory. 11// 12// Please consider splitting the single license below into multiple licenses, 13// taking care not to lose any license_kind information, and overriding the 14// default license using the 'licenses: [...]' property on targets as needed. 15// 16// For unused files, consider creating a 'fileGroup' with "//visibility:private" 17// to attach the license to, and including a comment whether the files may be 18// used in the current project. 19// 20// large-scale-change included anything that looked like it might be a license 21// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc. 22// 23// Please consider removing redundant or irrelevant files from 'license_text:'. 24// See: http://go/android-license-faq 25license { 26 name: "external_dtc_license", 27 visibility: [":__subpackages__"], 28 license_kinds: ["SPDX-license-identifier-GPL-2.0"], 29 license_text: ["GPL"], 30} 31 32license { 33 name: "external_dtc_libfdt_license", 34 visibility: [":__subpackages__"], 35 license_kinds: ["SPDX-license-identifier-BSD-2-Clause"], 36 license_text: ["BSD-2-Clause"], 37} 38 39license { 40 name: "external_dtc_tests_license", 41 visibility: [":__subpackages__"], 42 license_kinds: ["SPDX-license-identifier-LGPL-2.1+"], 43 license_text: ["LGPL"], 44} 45 46cc_defaults { 47 name: "dtc_cflags_defaults", 48 cflags: [ 49 "-Wall", 50 "-Werror", 51 "-Wno-macro-redefined", 52 "-Wno-missing-field-initializers", 53 "-Wno-sign-compare", 54 "-Wno-unused-parameter", 55 ], 56} 57 58cc_defaults { 59 name: "dt_defaults", 60 defaults: ["dtc_cflags_defaults"], 61 cflags: [ 62 "-DNO_YAML", 63 ], 64 65 generated_headers: ["dtc_version_gen.h"], 66 shared_libs: ["libfdt"], 67 68 stl: "none", 69 target: { 70 host: { 71 dist: { 72 targets: [ 73 "dist_files", 74 ], 75 dir: "dtc", 76 }, 77 }, 78 }, 79} 80 81cc_defaults { 82 name: "dtc_defaults", 83 defaults: ["dt_defaults"], 84 srcs: [ 85 "checks.c", 86 "data.c", 87 "dtc.c", 88 "dtc-lexer.l", 89 "dtc-parser.y", 90 "flattree.c", 91 "fstree.c", 92 "livetree.c", 93 "srcpos.c", 94 "treesource.c", 95 "util.c", 96 ], 97} 98 99cc_binary { 100 name: "dtc_static", 101 defaults: ["dtc_defaults"], 102 static_executable: true, 103 installable: false, // test only 104} 105 106cc_binary_host { 107 name: "dtc", 108 defaults: ["dtc_defaults"], 109} 110 111cc_binary_host { 112 name: "fdtget", 113 defaults: ["dt_defaults"], 114 srcs: [ 115 "fdtget.c", 116 "util.c", 117 ], 118} 119 120cc_binary_host { 121 name: "fdtoverlay", 122 defaults: ["dt_defaults"], 123 srcs: [ 124 "fdtoverlay.c", 125 "util.c", 126 ], 127} 128 129cc_binary_host { 130 name: "fdtdump", 131 defaults: ["dt_defaults"], 132 srcs: [ 133 "fdtdump.c", 134 "util.c", 135 ], 136} 137 138sh_binary_host { 139 name: "dtdiff", 140 src: "dtdiff", 141 required: ["dtc"], 142} 143 144genrule { 145 name: "dtc_version_gen.h", 146 out: ["version_gen.h"], 147 srcs: ["version_gen.h.in"], 148 tool_files: [ 149 "METADATA", 150 "METADATA_version.sed", 151 ], 152 cmd: "version=$$(" + 153 "sed -f $(location METADATA_version.sed) -n $(location METADATA)" + 154 ")-Android-build;" + 155 "sed s/@VCS_TAG@/$${version}/ $(in) > $(out)", 156} 157