1// Copyright 2016 The Android Open Source Project
2
3cc_defaults {
4    name: "apf_defaults",
5
6    cflags: [
7        "-DAPF_FRAME_HEADER_SIZE=14",
8        "-Wall",
9        "-Werror",
10        "-Werror=implicit-fallthrough",
11        "-Wnullable-to-nonnull-conversion",
12        "-Wsign-compare",
13        "-Wthread-safety",
14        "-Wunused-parameter",
15        "-Wuninitialized",
16    ],
17}
18
19cc_library_static {
20    name: "libapf",
21    defaults: ["apf_defaults"],
22    srcs: ["apf_interpreter.c"],
23    sdk_version: "24",
24}
25
26cc_binary_host {
27    name: "apf_disassembler",
28    defaults: ["apf_defaults"],
29    srcs: [
30        "apf_disassembler.c",
31        "disassembler.c",
32    ],
33}
34
35cc_binary_host {
36    name: "apf_run",
37    defaults: ["apf_defaults"],
38    static_libs: [
39        "libpcap",
40    ],
41    srcs: [
42        "apf_run.c",
43        "apf_interpreter.c",
44        "disassembler.c",
45    ],
46    cflags: [
47        "-DAPF_TRACE_HOOK=apf_trace_hook",
48    ],
49    target: {
50        darwin: {
51            enabled: false,
52        },
53    },
54}
55
56sh_test_host {
57    name: "apf_run_test",
58    src: "apf_run_test.sh",
59    filename: "apf_run_test.sh",
60    test_suites: ["general-tests"],
61    test_config: "apf_run_test.xml",
62    required: ["apf_run"],
63    data: ["testdata/*"],
64    target: {
65        darwin: {
66            enabled: false,
67        },
68        windows: {
69            enabled: false,
70        },
71    },
72}
73