• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1package {
2    default_applicable_licenses: ["external_one-true-awk_license"],
3}
4
5// Added automatically by a large-scale-change that took the approach of
6// 'apply every license found to every target'. While this makes sure we respect
7// every license restriction, it may not be entirely correct.
8//
9// e.g. GPL in an MIT project might only apply to the contrib/ directory.
10//
11// Please consider splitting the single license below into multiple licenses,
12// taking care not to lose any license_kind information, and overriding the
13// default license using the 'licenses: [...]' property on targets as needed.
14//
15// For unused files, consider creating a 'fileGroup' with "//visibility:private"
16// to attach the license to, and including a comment whether the files may be
17// used in the current project.
18// See: http://go/android-license-faq
19license {
20    name: "external_one-true-awk_license",
21    visibility: [":__subpackages__"],
22    license_kinds: [
23        "SPDX-license-identifier-BSD",
24        "SPDX-license-identifier-MIT",
25    ],
26    license_text: [
27        "LICENSE",
28    ],
29}
30
31cc_defaults {
32    name: "awk-flags",
33    cflags: [
34        "-Wall",
35        "-Werror",
36        "-Wextra",
37        // Ignore a few harmless idioms widely used in this code.
38        "-Wno-missing-field-initializers",
39        "-Wno-self-assign",
40        "-Wno-unused-parameter",
41        // A loop to UCHAR_MAX in `b.c`.
42        "-Wno-sign-compare",
43        // And one less harmless used with strtod(3) in `lex.c`.
44        "-Wno-unused-result",
45        // Also ignore harmless macro redefinitions: glibc 2.17 #defines dprintf
46        // in stdio2.h, and this #defines it in awk.h
47        "-Wno-macro-redefined",
48    ],
49    stl: "none",
50}
51
52genrule {
53    name: "awkgram.tab.c",
54    cmd: "M4=$(location m4) $(location bison) -y --no-lines --output=$(genDir)/awkgram.tab.c $(in)",
55    out: ["awkgram.tab.c"],
56    srcs: ["awkgram.y"],
57    tools: [
58        "bison",
59        "m4",
60    ],
61}
62
63genrule {
64    name: "awkgram.tab.h",
65    cmd: "M4=$(location m4) $(location bison) -y --no-lines --defines=$(genDir)/awkgram.tab.h $(in)",
66    out: ["awkgram.tab.h"],
67    srcs: ["awkgram.y"],
68    tools: [
69        "bison",
70        "m4",
71    ],
72}
73
74genrule {
75    name: "proctab.c",
76    tools: ["awk-maketab"],
77    cmd: "$(location awk-maketab) $(in) > $(genDir)/proctab.c",
78    out: ["proctab.c"],
79    srcs: [":awkgram.tab.h"],
80}
81
82cc_binary_host {
83    name: "awk-maketab",
84    defaults: ["awk-flags"],
85    generated_headers: ["awkgram.tab.h"],
86    srcs: ["maketab.c"],
87}
88
89cc_defaults {
90    name: "awk-defaults",
91    defaults: ["awk-flags"],
92    generated_headers: ["awkgram.tab.h"],
93    srcs: [
94        "b.c",
95        "lex.c",
96        "lib.c",
97        "main.c",
98        "parse.c",
99        ":proctab.c",
100        "run.c",
101        "tran.c",
102        ":awkgram.tab.c",
103    ],
104}
105
106cc_binary {
107    name: "awk",
108    defaults: ["awk-defaults"],
109}
110
111cc_binary {
112    name: "awk_vendor",
113    defaults: ["awk-defaults"],
114    stem: "awk",
115    vendor: true,
116}
117
118cc_binary_host {
119    name: "one-true-awk",
120    defaults: ["awk-defaults"],
121}
122