Android.bp

cc_binary {
    name: "iwpriv",
    vendor: true,
    srcs: [
        "iwpriv.c",
        "iwlib.c",
    ],
    cflags: [
        "-D_GNU_SOURCE",
        "-DCONFIG_LIBNL20",

        // Silence some warnings for now. Needs to be fixed upstream. b/26105799
        "-Wno-unused-parameter",
        "-Wno-sign-compare",
        "-Wno-format",
        "-Wno-absolute-value",
        "-Wno-enum-conversion",
        "-Wno-self-assign",
        "-Werror",
    ],
    ldflags: ["-Wl,--no-gc-sections"],
    shared_libs: ["libnl"],
}

将源文件iwpriv.c、iwlib.c编译为iwpriv

    name: "iwpriv",
    srcs: [
        "iwpriv.c",
        "iwlib.c",
    ],

文件默认生成到/vendor/bin目录

    vendor: true,

添加编译时的cflag,忽略部分编译warning

    cflags: [
        "-D_GNU_SOURCE",
        "-DCONFIG_LIBNL20",

        // Silence some warnings for now. Needs to be fixed upstream. b/26105799
        "-Wno-unused-parameter",
        "-Wno-sign-compare",
        "-Wno-format",
        "-Wno-absolute-value",
        "-Wno-enum-conversion",
        "-Wno-self-assign",
        "-Werror",
    ],
    ldflags: ["-Wl,--no-gc-sections"],

编译依赖,编译时链接对应的库文件

    shared_libs: ["libnl"],