diff --git a/Android.bp b/Android.bp new file mode 100644 index 00000000..2aae6893 --- /dev/null +++ b/Android.bp @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-FileCopyrightText: 2023 Benjamin Li + +// Instructions: +// - Check out this repository as external/libgpiod. +// - Move this build file to the project's root directory. + +// +// libgpiod main library +// + +cc_library_shared { + name: "libgpiod", + defaults: [ + "libgpiod_defaults", + ], + srcs: [ + "lib/*.c", + "bindings/cxx/*.cpp", + ], + export_include_dirs: [ + "include", + "bindings/cxx", + ], + host_supported: true, + vendor: true, +} + +cc_defaults { + name: "libgpiod_defaults", + cpp_std: "gnu++17", + cflags: [ + // You may want to edit this with the version from configure.ac of + // the release you are using. + "-DGPIOD_VERSION_STR=\"unstable\"", + ], + cppflags: [ + // Google C++ style is to not use exceptions, but this library does + // use them. + "-fexceptions", + ], + // Google C++ style is to not use runtime type information, but this + // library does use it. + rtti: true, +} + + +cc_defaults { + name: "libgpiod_tools_defaults", + srcs: [ + "tools/tools-common.c", + ], + shared_libs: [ + "libgpiod", + ], +} + +cc_library_headers { + name: "libgpiod_headers", + export_include_dirs: ["include"], +} diff --git a/contrib/Android.bp b/contrib/Android.bp deleted file mode 100644 index fbc21961..00000000 --- a/contrib/Android.bp +++ /dev/null @@ -1,136 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -// SPDX-FileCopyrightText: 2023 Benjamin Li - -// Instructions: -// - Check out this repository as external/libgpiod. -// - Move this build file to the project's root directory. - -// -// libgpiod main library -// - -cc_library { - name: "libgpiod", - defaults: [ - "libgpiod_defaults", - ], - srcs: [ - "lib/*.c", - "bindings/cxx/*.cpp", - ], - export_include_dirs: [ - "include", - "bindings/cxx", - ], -} - -cc_defaults { - name: "libgpiod_defaults", - device_specific: true, - cpp_std: "gnu++17", - cflags: [ - // You may want to edit this with the version from configure.ac of - // the release you are using. - "-DGPIOD_VERSION_STR=\"unstable\"", - ], - cppflags: [ - // Google C++ style is to not use exceptions, but this library does - // use them. - "-fexceptions", - ], - // Google C++ style is to not use runtime type information, but this - // library does use it. - rtti: true, -} - -// -// libgpiod tools -// - -phony { - name: "libgpiod_tools", - required: [ - "gpiodetect", - "gpioget", - "gpioinfo", - "gpiomon", - "gpionotify", - "gpioset", - ], -} - -cc_binary { - name: "gpiodetect", - defaults: [ - "libgpiod_defaults", - "libgpiod_tools_defaults", - ], - srcs: [ - "tools/gpiodetect.c", - ], -} - -cc_binary { - name: "gpioget", - defaults: [ - "libgpiod_defaults", - "libgpiod_tools_defaults", - ], - srcs: [ - "tools/gpioget.c", - ], -} - -cc_binary { - name: "gpioinfo", - defaults: [ - "libgpiod_defaults", - "libgpiod_tools_defaults", - ], - srcs: [ - "tools/gpioinfo.c", - ], -} - -cc_binary { - name: "gpiomon", - defaults: [ - "libgpiod_defaults", - "libgpiod_tools_defaults", - ], - srcs: [ - "tools/gpiomon.c", - ], -} - -cc_binary { - name: "gpionotify", - defaults: [ - "libgpiod_defaults", - "libgpiod_tools_defaults", - ], - srcs: [ - "tools/gpionotify.c", - ], -} - -cc_binary { - name: "gpioset", - defaults: [ - "libgpiod_defaults", - "libgpiod_tools_defaults", - ], - srcs: [ - "tools/gpioset.c", - ], -} - -cc_defaults { - name: "libgpiod_tools_defaults", - srcs: [ - "tools/tools-common.c", - ], - shared_libs: [ - "libgpiod", - ], -}