• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1package {
2    default_applicable_licenses: ["external_bc_license"],
3}
4
5license {
6    name: "external_bc_license",
7    visibility: [":__subpackages__"],
8    license_kinds: [
9        "SPDX-license-identifier-BSD",
10        "SPDX-license-identifier-MIT",
11    ],
12    license_text: [
13        "LICENSE.md",
14        "NOTICE.md",
15    ],
16}
17
18cc_defaults {
19  name: "bc-defaults",
20
21  cflags: [
22    "-include bc-version.h",
23    "-DBC_ENABLED=1",
24    "-DDC_ENABLED=0",
25    "-DBC_ENABLE_EXTRA_MATH=0",
26    "-DBC_ENABLE_HISTORY=0",
27    "-DBC_ENABLE_LONG_OPTIONS=1",
28    "-DBC_ENABLE_NLS=0",
29    "-DBC_ENABLE_SIGNALS=1",
30    "-Os",
31  ],
32  generated_headers: ["bc-version.h"],
33  local_include_dirs: ["include"],
34  srcs: [
35    "src/bc/*.c",
36    "src/*.c",
37    ":bc-bc_help.c",
38    ":bc-lib.c",
39  ],
40  stl: "none",
41}
42
43genrule {
44  name: "bc-lib.c",
45  srcs: ["gen/lib.bc"],
46  out: ["gen/lib.c"],
47  tool_files: ["gen/strgen.sh"],
48  cmd: "$(location gen/strgen.sh) $(in) $(out) bc_lib bc_lib_name BC_ENABLED",
49}
50
51genrule {
52  name: "bc-bc_help.c",
53  srcs: ["gen/bc_help.txt"],
54  out: ["gen/bc_help.c"],
55  tool_files: ["gen/strgen.sh"],
56  cmd: "$(location gen/strgen.sh) $(in) $(out) bc_help '' BC_ENABLED",
57}
58
59genrule {
60  name: "bc-version.h",
61  srcs: ["Makefile.in"],
62  out: ["bc-version.h"],
63  cmd: "sed -n 's/VERSION = /#define VERSION /p' $(in) > $(out)",
64}
65
66cc_binary {
67  name: "bc",
68  defaults: ["bc-defaults"],
69}
70
71cc_binary {
72  name: "bc_vendor",
73  defaults: ["bc-defaults"],
74  stem: "bc",
75  vendor: true,
76}
77
78cc_binary_host {
79  name: "gavinhoward-bc",
80  defaults: ["bc-defaults"],
81}
82
83sh_test {
84  name: "bc-tests",
85  src: "run-bc-tests-on-android.sh",
86  filename: "run-bc-tests-on-android.sh",
87  test_suites: ["general-tests"],
88  host_supported: true,
89  device_supported: false,
90  data: [
91    "functions.sh",
92    "tests/**/*",
93  ],
94}
95