| package { | |
| default_applicable_licenses: ["external_trace-cmd_license"], | |
| } | |
| // See: http://go/android-license-faq | |
| license { | |
| name: "external_trace-cmd_license", | |
| visibility: [":__subpackages__"], | |
| license_kinds: [ | |
| "SPDX-license-identifier-GPL-2.0", | |
| "SPDX-license-identifier-GPL-2.0-only", | |
| "SPDX-license-identifier-GPL-2.0+", | |
| "SPDX-license-identifier-GPL-2.0-or-later", | |
| "SPDX-license-identifier-LGPL-2.1+", | |
| ], | |
| license_text: [ | |
| "LICENSE", | |
| ], | |
| } | |
| genrule { | |
| name: "tc_version_header", | |
| srcs: ["Makefile"], | |
| out: ["tc_version.h"], | |
| cmd: "(" + | |
| "VERSION=$$(grep '\\bTC_VERSION =' <$(in) | awk '{ print $$3 }') " + | |
| "&& PATCHLEVEL=$$(grep '\\bTC_PATCHLEVEL =' <$(in) | awk '{ print $$3 }') " + | |
| "&& VERSION_CODE=$$(expr $${VERSION} \\* 256 + $${PATCHLEVEL}) " + | |
| "&& EXTRAVERSION=$$(grep '\\bTC_EXTRAVERSION =' <$(in) | awk '{ print $$3 }') " + | |
| "&& echo '/* This file is automatically generated. Do not modify */' " + | |
| "&& echo \"#define VERSION_CODE $${VERSION_CODE}\" " + | |
| "&& echo \"#define EXTRAVERSION $${EXTRAVERSION}\" " + | |
| "&& echo '#define VERSION_STRING \"'$${VERSION}.$${PATCHLEVEL}.$${EXTRAVERSION}'\"' " + | |
| "&& echo '#define FILE_VERSION ' " + | |
| "&& echo '#define VERSION_GIT \"not-a-git-repo\"' " + | |
| ") > $(out)", | |
| } | |
| cc_library { | |
| name: "libtracecmd", | |
| // Restrict visibility due to GPL license | |
| visibility: [ | |
| "//external/trace-cmd:__subpackages__", | |
| ], | |
| local_include_dirs: [ | |
| "lib/trace-cmd/include/private", | |
| "lib/trace-cmd/include", | |
| "include/trace-cmd", | |
| "tracecmd/include", | |
| "include", | |
| ], | |
| export_include_dirs: [ | |
| "lib/trace-cmd/include", | |
| ], | |
| srcs: [ | |
| "lib/trace-cmd/test.c", | |
| "lib/trace-cmd/trace-blk-hack.c", | |
| "lib/trace-cmd/trace-compress.c", | |
| "lib/trace-cmd/trace-compress-zlib.c", | |
| "lib/trace-cmd/trace-filter-hash.c", | |
| "lib/trace-cmd/trace-ftrace.c", | |
| "lib/trace-cmd/trace-hash.c", | |
| "lib/trace-cmd/trace-hooks.c", | |
| "lib/trace-cmd/trace-input.c", | |
| "lib/trace-cmd/trace-msg.c", | |
| "lib/trace-cmd/trace-output.c", | |
| "lib/trace-cmd/trace-perf.c", | |
| "lib/trace-cmd/trace-plugin.c", | |
| "lib/trace-cmd/trace-recorder.c", | |
| "lib/trace-cmd/trace-timesync.c", | |
| "lib/trace-cmd/trace-timesync-kvm.c", | |
| "lib/trace-cmd/trace-timesync-ptp.c", | |
| "lib/trace-cmd/trace-util.c", | |
| ], | |
| shared: { | |
| shared_libs: [ | |
| "libtraceevent", | |
| "libtracefs", | |
| "libz", | |
| ], | |
| export_shared_lib_headers: [ | |
| "libtraceevent", | |
| "libtracefs", | |
| "libz", | |
| ], | |
| }, | |
| static: { | |
| static_libs: [ | |
| "libtraceevent", | |
| "libtracefs", | |
| "libz", | |
| ], | |
| export_static_lib_headers: [ | |
| "libtraceevent", | |
| "libtracefs", | |
| "libz", | |
| ], | |
| }, | |
| generated_headers: ["tc_version_header"], | |
| export_generated_headers: ["tc_version_header"], | |
| cflags: [ | |
| "-D__bswap_64=__swap64", | |
| "-D_GNU_SOURCE", | |
| "-DPERF", | |
| "-DVSOCK", | |
| "-Wno-unused-parameter", | |
| "-Wno-macro-redefined", | |
| "-Wno-unused-but-set-variable", | |
| "-Wno-user-defined-warnings", | |
| "-Wno-visibility", | |
| "-Wno-pointer-arith", | |
| ], | |
| c_std: "gnu99", | |
| } | |
| cc_binary { | |
| name: "trace-cmd", | |
| local_include_dirs: [ | |
| "lib/trace-cmd/include/private", | |
| "include/trace-cmd", | |
| "tracecmd/include", | |
| "include", | |
| ], | |
| srcs: ["tracecmd/*.c"], | |
| static_libs: [ | |
| "libtraceevent", | |
| "libtracecmd", | |
| "libtracefs", | |
| ], | |
| static_executable: true, | |
| cflags: [ | |
| "-D_GNU_SOURCE", | |
| "-DNO_AUDIT", | |
| "-DVSOCK", | |
| "-Wno-unused-parameter", | |
| "-Wno-macro-redefined", | |
| "-Wno-visibility", | |
| "-Wno-pointer-arith", | |
| ], | |
| c_std: "gnu99", | |
| } |