]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
AOSP: Convert e2fsprogs targets to soong.
authorAlex Deymo <deymo@google.com>
Thu, 12 Jan 2017 17:48:04 +0000 (09:48 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 24 May 2017 03:00:54 +0000 (23:00 -0400)
This patch also removes all the "-host" and "_static" suffix from all
the libraries adding "unique_host_soname: true". This prevents
confusions with the host installed libraries.

A new "libext2_misc" library is introduced to export some files from
the misc/ directory to other binaries in this project.

Bug: 34220783
Test: mmma external/e2fsprogs

Change-Id: Ia1b689991346b11f8cb38f7c6ee356e666e01d6d
From AOSP commit: 7a9e1a96766d31a41b88f0a539fcc3d532b5c530

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
30 files changed:
Android.bp [new file with mode: 0644]
Android.mk [deleted file]
contrib/Android.bp [new file with mode: 0644]
contrib/Android.mk [deleted file]
contrib/android/Android.bp [new file with mode: 0644]
contrib/android/Android.mk [deleted file]
debugfs/Android.bp [new file with mode: 0644]
debugfs/Android.mk [deleted file]
e2fsck/Android.bp [new file with mode: 0644]
e2fsck/Android.mk [deleted file]
lib/Android.bp [new file with mode: 0644]
lib/Android.mk [deleted file]
lib/blkid/Android.bp [new file with mode: 0644]
lib/blkid/Android.mk [deleted file]
lib/e2p/Android.bp [new file with mode: 0644]
lib/e2p/Android.mk [deleted file]
lib/et/Android.bp [new file with mode: 0644]
lib/et/Android.mk [deleted file]
lib/ext2fs/Android.bp [new file with mode: 0644]
lib/ext2fs/Android.mk [deleted file]
lib/ss/Android.bp [new file with mode: 0644]
lib/ss/Android.mk [deleted file]
lib/support/Android.bp [new file with mode: 0644]
lib/support/Android.mk [deleted file]
lib/uuid/Android.bp [new file with mode: 0644]
lib/uuid/Android.mk [deleted file]
misc/Android.bp [new file with mode: 0644]
misc/Android.mk [deleted file]
resize/Android.bp [new file with mode: 0644]
resize/Android.mk [deleted file]

diff --git a/Android.bp b/Android.bp
new file mode 100644 (file)
index 0000000..a095aea
--- /dev/null
@@ -0,0 +1,10 @@
+// Copyright 2017 The Android Open Source Project
+
+subdirs = [
+    "contrib",
+    "debugfs",
+    "e2fsck",
+    "lib",
+    "misc",
+    "resize",
+]
diff --git a/Android.mk b/Android.mk
deleted file mode 100644 (file)
index 5053e7d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-include $(call all-subdir-makefiles)
diff --git a/contrib/Android.bp b/contrib/Android.bp
new file mode 100644 (file)
index 0000000..585a8f1
--- /dev/null
@@ -0,0 +1,37 @@
+// Copyright 2017 The Android Open Source Project
+
+subdirs = ["android"]
+
+//##########################################################################
+// Build fsstress
+
+cc_binary {
+    name: "fsstress",
+    host_supported: true,
+
+    srcs: ["fsstress.c"],
+    cflags: ["-W", "-Wall"],
+    system_shared_libs: ["libc"],
+
+    target: {
+        darwin: {
+            enabled: false,
+        },
+    },
+}
+
+//########################################################################
+// Build add_ext4_encrypt
+
+cc_binary {
+    name: "add_ext4_encrypt",
+    host_supported: true,
+
+    srcs: ["add_ext4_encrypt.c"],
+    cflags: ["-W", "-Wall"],
+    shared_libs: [
+        "libext2fs",
+        "libext2_com_err",
+    ],
+    system_shared_libs: ["libc"],
+}
diff --git a/contrib/Android.mk b/contrib/Android.mk
deleted file mode 100644 (file)
index 9f57daa..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-###########################################################################
-# Build fsstress
-#
-fsstress_src_files := \
-       fsstress.c
-
-fsstress_c_includes := 
-
-fsstress_cflags := -O2 -g -W -Wall
-
-fsstress_shared_libraries := 
-
-fsstress_system_shared_libraries := libc
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(fsstress_src_files)
-mke2fs_c_includesLOCAL_CFLAGS := $(fsstress_cflags)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(fsstress_system_shared_libraries)
-LOCAL_MODULE := fsstress
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(fsstress_src_files)
-LOCAL_CFLAGS := $(fsstress_cflags)
-LOCAL_MODULE := fsstress_host
-LOCAL_MODULE_STEM := fsstress
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_HOST_OS := linux
-
-include $(BUILD_HOST_EXECUTABLE)
-
-#########################################################################
-# Build add_ext4_encrypt
-#
-include $(CLEAR_VARS)
-
-add_ext4_encrypt_src_files := \
-       add_ext4_encrypt.c
-
-add_ext4_encrypt_c_includes := \
-       external/e2fsprogs/lib
-
-add_ext4_encrypt_cflags := -O2 -g -W -Wall
-
-add_ext4_encrypt_shared_libraries := \
-       libext2fs \
-       libext2_com_err
-
-add_ext4_encrypt_system_shared_libraries := libc
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(add_ext4_encrypt_src_files)
-LOCAL_C_INCLUDES := $(add_ext4_encrypt_c_includes)
-LOCAL_CFLAGS := $(add_ext4_encrypt_cflags)
-LOCAL_SHARED_LIBRARIES := $(add_ext4_encrypt_shared_libraries)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(add_ext4_encrypt_system_shared_libraries)
-LOCAL_MODULE := add_ext4_encrypt
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(add_ext4_encrypt_src_files)
-LOCAL_C_INCLUDES := $(add_ext4_encrypt_c_includes)
-LOCAL_CFLAGS := $(add_ext4_encrypt_cflags)
-LOCAL_SHARED_LIBRARIES := $(addsuffix -host, $(add_ext4_encrypt_shared_libraries))
-LOCAL_MODULE := add_ext4_encrypt_host
-LOCAL_MODULE_STEM := add_ext4_encrypt
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_EXECUTABLE)
-
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/contrib/android/Android.bp b/contrib/android/Android.bp
new file mode 100644 (file)
index 0000000..afa335e
--- /dev/null
@@ -0,0 +1,55 @@
+// Copyright 2017 The Android Open Source Project
+
+//##########################################################################
+// Build e2fsdroid
+
+cc_binary {
+    name: "e2fsdroid",
+    host_supported: true,
+
+    srcs: [
+        "e2fsdroid.c",
+        "block_range.c",
+        "fsmap.c",
+        "block_list.c",
+        "base_fs.c",
+        "perms.c",
+        "basefs_allocator.c",
+        "hashmap.c",
+    ],
+    cflags: ["-W", "-Wall"],
+    shared_libs: [
+        "libext2fs",
+        "libext2_com_err",
+        "libext2_misc",
+        "libcutils",
+        "libbase",
+        "libselinux",
+        "libcrypto",
+    ],
+}
+
+//##########################################################################
+// Build ext2simg
+
+cc_binary {
+    name: "ext2simg",
+    host_supported: true,
+
+    srcs: ["ext2simg.c"],
+    cflags: ["-W", "-Wall"],
+    shared_libs: [
+        "libext2fs",
+        "libext2_com_err",
+        "libsparse",
+    ],
+
+    target: {
+        host: {
+            shared_libs: ["libz-host"],
+        },
+        android: {
+            shared_libs: ["libz"],
+        },
+    },
+}
diff --git a/contrib/android/Android.mk b/contrib/android/Android.mk
deleted file mode 100644 (file)
index bc968fa..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-e2fsdroid_src := e2fsdroid.c \
-    block_range.c \
-    fsmap.c \
-    block_list.c \
-    base_fs.c \
-    perms.c \
-    basefs_allocator.c \
-    hashmap.c \
-    ../../misc/create_inode.c
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(e2fsdroid_src)
-LOCAL_MODULE := e2fsdroid
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../misc/
-LOCAL_SHARED_LIBRARIES := libext2fs-host \
-    libext2_com_err-host \
-    libcutils \
-    libbase \
-    libselinux \
-    libcrypto
-include $(BUILD_HOST_EXECUTABLE)
-
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(e2fsdroid_src)
-LOCAL_MODULE := e2fsdroid
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../misc/
-LOCAL_SHARED_LIBRARIES := libext2fs \
-    libext2_com_err \
-    libcutils \
-    libbase \
-    libselinux \
-    libcrypto
-include $(BUILD_EXECUTABLE)
-
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := ext2simg.c
-LOCAL_MODULE := ext2simg
-LOCAL_SHARED_LIBRARIES += \
-    libext2fs \
-    libext2_com_err \
-    libsparse \
-    libz
-include $(BUILD_EXECUTABLE)
-
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := ext2simg.c
-LOCAL_MODULE := ext2simg
-LOCAL_SHARED_LIBRARIES += \
-    libext2fs-host \
-    libext2_com_err-host
-LOCAL_STATIC_LIBRARIES += \
-    libsparse \
-    libz
-include $(BUILD_HOST_EXECUTABLE)
diff --git a/debugfs/Android.bp b/debugfs/Android.bp
new file mode 100644 (file)
index 0000000..be0042a
--- /dev/null
@@ -0,0 +1,71 @@
+// Copyright 2017 The Android Open Source Project
+
+//########################
+// Build the debugfs binary
+
+cc_defaults {
+    name: "debugfs-defaults",
+    srcs: [
+        "debug_cmds.c",
+        "debugfs.c",
+        "util.c",
+        "ncheck.c",
+        "icheck.c",
+        "ls.c",
+        "lsdel.c",
+        "dump.c",
+        "set_fields.c",
+        "logdump.c",
+        "htree.c",
+        "unused.c",
+        "e2freefrag.c",
+        "filefrag.c",
+        "extent_cmds.c",
+        "extent_inode.c",
+        "zap.c",
+        "create_inode.c",
+        "quota.c",
+        "xattrs.c",
+        "journal.c",
+        "revoke.c",
+        "recovery.c",
+        "do_journal.c",
+    ],
+    cflags: [
+        "-W",
+        "-Wall",
+        "-fno-strict-aliasing",
+        "-DDEBUGFS",
+    ],
+    include_dirs: [
+        "external/e2fsprogs/misc",
+        "external/e2fsprogs/e2fsck"
+    ],
+}
+
+debugfs_libs = [
+    "libext2fs",
+    "libext2_blkid",
+    "libext2_uuid",
+    "libext2_ss",
+    "libext2_quota",
+    "libext2_com_err",
+    "libext2_e2p",
+]
+
+cc_binary {
+    name: "debugfs",
+    host_supported: true,
+    defaults: ["debugfs-defaults"],
+
+    shared_libs: debugfs_libs,
+    system_shared_libs: ["libc"],
+}
+
+cc_binary {
+    name: "debugfs_static",
+    static_executable: true,
+    defaults: ["debugfs-defaults"],
+
+    static_libs: debugfs_libs,
+}
diff --git a/debugfs/Android.mk b/debugfs/Android.mk
deleted file mode 100644 (file)
index 91dc8c3..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-#########################
-# Build the debugfs binary
-
-debugfs_src_files :=  \
-       debug_cmds.c \
-       debugfs.c \
-       util.c \
-       ncheck.c\
-       icheck.c \
-       ls.c \
-       lsdel.c \
-       dump.c \
-       set_fields.c \
-       logdump.c \
-       htree.c \
-       unused.c \
-       e2freefrag.c \
-       filefrag.c \
-       extent_cmds.c \
-       extent_inode.c \
-       zap.c \
-       create_inode.c \
-       quota.c \
-       xattrs.c \
-       journal.c \
-       revoke.c \
-       recovery.c \
-       do_journal.c
-
-debugfs_shared_libraries := \
-       libext2fs \
-       libext2_blkid \
-       libext2_uuid \
-       libext2_ss \
-       libext2_quota \
-       libext2_com_err \
-       libext2_e2p
-
-debugfs_system_shared_libraries := libc
-
-debugfs_static_libraries := \
-       libext2fs \
-       libext2_blkid \
-       libext2_uuid_static \
-       libext2_ss \
-       libext2_quota \
-       libext2_com_err \
-       libext2_e2p
-
-debugfs_system_static_libraries := libc
-
-debugfs_c_includes := \
-       external/e2fsprogs/e2fsck \
-       external/e2fsprogs/misc \
-       external/e2fsprogs/lib
-
-debugfs_cflags := -O2 -g -W -Wall -fno-strict-aliasing -DDEBUGFS
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(debugfs_src_files)
-LOCAL_C_INCLUDES := $(debugfs_c_includes)
-LOCAL_CFLAGS := $(debugfs_cflags)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(debugfs_system_shared_libraries)
-LOCAL_SHARED_LIBRARIES := $(debugfs_shared_libraries)
-LOCAL_MODULE := debugfs
-LOCAL_MODULE_TAGS := optional
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(debugfs_src_files)
-LOCAL_C_INCLUDES := $(debugfs_c_includes)
-LOCAL_CFLAGS := $(debugfs_cflags)
-LOCAL_STATIC_LIBRARIES := $(debugfs_static_libraries) $(debugfs_system_static_libraries)
-LOCAL_FORCE_STATIC_EXECUTABLE := true
-LOCAL_MODULE := debugfs_static
-LOCAL_MODULE_TAGS := optional
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(debugfs_src_files)
-LOCAL_C_INCLUDES := $(debugfs_c_includes)
-LOCAL_CFLAGS := $(debugfs_cflags)
-LOCAL_SHARED_LIBRARIES := $(addsuffix -host, $(debugfs_shared_libraries))
-LOCAL_MODULE := debugfs_host
-LOCAL_MODULE_STEM := debugfs
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_EXECUTABLE)
diff --git a/e2fsck/Android.bp b/e2fsck/Android.bp
new file mode 100644 (file)
index 0000000..68b4750
--- /dev/null
@@ -0,0 +1,64 @@
+// Copyright 2017 The Android Open Source Project
+
+//########################
+// Build the e2fsck binary
+
+cc_defaults {
+    name: "e2fsck-defaults",
+    srcs: [
+        "e2fsck.c",
+        "super.c",
+        "pass1.c",
+        "pass1b.c",
+        "pass2.c",
+        "pass3.c",
+        "pass4.c",
+        "pass5.c",
+        "logfile.c",
+        "journal.c",
+        "recovery.c",
+        "revoke.c",
+        "badblocks.c",
+        "util.c",
+        "unix.c",
+        "dirinfo.c",
+        "dx_dirinfo.c",
+        "ehandler.c",
+        "problem.c",
+        "message.c",
+        "ea_refcount.c",
+        "quota.c",
+        "rehash.c",
+        "region.c",
+        "sigcatcher.c",
+        "readahead.c",
+        "extents.c",
+    ],
+    cflags: ["-W", "-Wall", "-fno-strict-aliasing"],
+}
+
+e2fsck_libs = [
+    "libext2fs",
+    "libext2_blkid",
+    "libext2_uuid",
+    "libext2_quota",
+    "libext2_com_err",
+    "libext2_e2p",
+]
+
+cc_binary {
+    name: "e2fsck",
+    host_supported: true,
+    defaults: ["e2fsck-defaults"],
+
+    shared_libs: e2fsck_libs,
+    system_shared_libs: ["libc"],
+}
+
+cc_binary {
+    name: "e2fsck_static",
+    static_executable: true,
+    defaults: ["e2fsck-defaults"],
+
+    static_libs: e2fsck_libs,
+}
diff --git a/e2fsck/Android.mk b/e2fsck/Android.mk
deleted file mode 100644 (file)
index 604eaa1..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-#########################
-# Build the e2fsck binary
-
-e2fsck_src_files :=  \
-       e2fsck.c \
-       super.c \
-       pass1.c \
-       pass1b.c \
-       pass2.c \
-       pass3.c \
-       pass4.c \
-       pass5.c \
-       logfile.c \
-       journal.c \
-       recovery.c \
-       revoke.c \
-       badblocks.c \
-       util.c \
-       unix.c \
-       dirinfo.c \
-       dx_dirinfo.c \
-       ehandler.c \
-       problem.c \
-       message.c \
-       ea_refcount.c \
-       quota.c \
-       rehash.c \
-       region.c \
-       sigcatcher.c \
-       readahead.c \
-       extents.c
-
-e2fsck_shared_libraries := \
-       libext2fs \
-       libext2_blkid \
-       libext2_uuid \
-       libext2_quota \
-       libext2_com_err \
-       libext2_e2p
-
-e2fsck_system_shared_libraries := libc
-
-e2fsck_static_libraries := \
-       libext2fs \
-       libext2_blkid \
-       libext2_uuid_static \
-       libext2_quota \
-       libext2_com_err \
-       libext2_e2p
-
-e2fsck_system_static_libraries := libc
-
-e2fsck_c_includes :=
-
-e2fsck_cflags := -O2 -g -W -Wall -fno-strict-aliasing
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(e2fsck_src_files)
-LOCAL_C_INCLUDES := $(e2fsck_c_includes)
-LOCAL_CFLAGS := $(e2fsck_cflags)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(e2fsck_system_shared_libraries)
-LOCAL_SHARED_LIBRARIES := $(e2fsck_shared_libraries)
-LOCAL_MODULE := e2fsck
-LOCAL_MODULE_TAGS := optional
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(e2fsck_src_files)
-LOCAL_C_INCLUDES := $(e2fsck_c_includes)
-LOCAL_CFLAGS := $(e2fsck_cflags)
-LOCAL_STATIC_LIBRARIES := $(e2fsck_static_libraries) $(e2fsck_system_static_libraries)
-LOCAL_FORCE_STATIC_EXECUTABLE := true
-LOCAL_MODULE := e2fsck_static
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(e2fsck_src_files)
-LOCAL_C_INCLUDES := $(e2fsck_c_includes)
-LOCAL_CFLAGS := $(e2fsck_cflags)
-LOCAL_SHARED_LIBRARIES := $(addsuffix -host, $(e2fsck_shared_libraries))
-LOCAL_MODULE := e2fsck_host
-LOCAL_MODULE_STEM := e2fsck
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_EXECUTABLE)
diff --git a/lib/Android.bp b/lib/Android.bp
new file mode 100644 (file)
index 0000000..b38d8b1
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright 2017 The Android Open Source Project
+
+// All the libraries under this directory export their headers as relative
+// paths to this directory (external/e2fsprogs/lib). This is a helper headers
+// only library to allow exporting
+cc_library_headers {
+    name: "libext2-headers",
+    host_supported: true,
+    target: {
+        windows: {
+            enabled: true,
+        },
+    },
+    export_include_dirs: ["."],
+}
+
+
+subdirs = [
+    "*",
+]
diff --git a/lib/Android.mk b/lib/Android.mk
deleted file mode 100644 (file)
index 5053e7d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-include $(call all-subdir-makefiles)
diff --git a/lib/blkid/Android.bp b/lib/blkid/Android.bp
new file mode 100644 (file)
index 0000000..9a3f276
--- /dev/null
@@ -0,0 +1,32 @@
+// Copyright 2017 The Android Open Source Project
+
+cc_library {
+    name: "libext2_blkid",
+    host_supported: true,
+    unique_host_soname: true,
+    srcs: [
+        "cache.c",
+        "dev.c",
+        "devname.c",
+        "devno.c",
+        "getsize.c",
+        "llseek.c",
+        "probe.c",
+        "read.c",
+        "resolve.c",
+        "save.c",
+        "tag.c",
+        "version.c",
+    ],
+    shared_libs: ["libext2_uuid"],
+
+    cflags: [
+        "-W",
+        "-Wall",
+        "-fno-strict-aliasing",
+    ],
+
+    header_libs: ["libext2-headers"],
+    export_include_dirs: ["."],
+    export_header_lib_headers: ["libext2-headers"],
+}
diff --git a/lib/blkid/Android.mk b/lib/blkid/Android.mk
deleted file mode 100644 (file)
index 67228a2..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-libext2_blkid_src_files := \
-       cache.c \
-       dev.c \
-       devname.c \
-       devno.c \
-       getsize.c \
-       llseek.c \
-       probe.c \
-       read.c \
-       resolve.c \
-       save.c \
-       tag.c \
-       version.c \
-
-
-libext2_blkid_shared_libraries := libext2_uuid
-
-libext2_blkid_system_shared_libraries := libc
-
-libext2_blkid_static_libraries := libext2_uuid_static
-
-libext2_blkid_system_static_libraries := libc
-
-libext2_blkid_c_includes := external/e2fsprogs/lib
-
-libext2_blkid_cflags := -O2 -g -W -Wall -fno-strict-aliasing
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_blkid_src_files)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(libext2_blkid_system_shared_libraries)
-LOCAL_SHARED_LIBRARIES := $(libext2_blkid_shared_libraries)
-LOCAL_C_INCLUDES := $(libext2_blkid_c_includes)
-LOCAL_CFLAGS := $(libext2_blkid_cflags)
-LOCAL_MODULE := libext2_blkid
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_blkid_src_files)
-LOCAL_STATIC_LIBRARIES := $(libext2_blkid_static_libraries) $(libext2_blkid_system_static_libraries)
-LOCAL_C_INCLUDES := $(libext2_blkid_c_includes)
-LOCAL_CFLAGS := $(libext2_blkid_cflags) $(libext2_blkid_cflags_linux) -fno-strict-aliasing
-LOCAL_MODULE := libext2_blkid
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_blkid_src_files)
-LOCAL_SHARED_LIBRARIES := $(addsuffix -host, $(libext2_blkid_shared_libraries))
-LOCAL_C_INCLUDES := $(libext2_blkid_c_includes)
-LOCAL_CFLAGS := $(libext2_blkid_cflags)
-LOCAL_MODULE := libext2_blkid-host
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(libext2_blkid_src_files)
-LOCAL_SHARED_LIBRARIES := libext2_uuid-host
-LOCAL_C_INCLUDES := $(libext2_blkid_c_includes)
-LOCAL_CFLAGS := $(libext2_blkid_cflags)
-LOCAL_MODULE := libext2_blkid-host
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_STATIC_LIBRARY)
diff --git a/lib/e2p/Android.bp b/lib/e2p/Android.bp
new file mode 100644 (file)
index 0000000..9c344df
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright 2017 The Android Open Source Project
+
+cc_library {
+    name: "libext2_e2p",
+    host_supported: true,
+    unique_host_soname: true,
+    srcs: [
+        "feature.c",
+        "fgetflags.c",
+        "fsetflags.c",
+        "fgetproject.c",
+        "fsetproject.c",
+        "fgetversion.c",
+        "fsetversion.c",
+        "getflags.c",
+        "getversion.c",
+        "hashstr.c",
+        "iod.c",
+        "ls.c",
+        "mntopts.c",
+        "parse_num.c",
+        "pe.c",
+        "pf.c",
+        "ps.c",
+        "setflags.c",
+        "setversion.c",
+        "uuid.c",
+        "ostype.c",
+        "percent.c",
+    ],
+
+    cflags: [
+        "-W",
+        "-Wall",
+    ],
+
+    header_libs: ["libext2-headers"],
+    export_include_dirs: ["."],
+    export_header_lib_headers: ["libext2-headers"],
+}
diff --git a/lib/e2p/Android.mk b/lib/e2p/Android.mk
deleted file mode 100644 (file)
index 279bdbb..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-libext2_e2p_src_files := \
-       feature.c \
-       fgetflags.c \
-       fsetflags.c \
-       fgetproject.c \
-       fsetproject.c \
-       fgetversion.c \
-       fsetversion.c \
-       getflags.c \
-       getversion.c \
-       hashstr.c \
-       iod.c \
-       ls.c \
-       mntopts.c \
-       parse_num.c \
-       pe.c \
-       pf.c \
-       ps.c \
-       setflags.c \
-       setversion.c \
-       uuid.c \
-       ostype.c \
-       percent.c
-
-libext2_e2p_c_includes := external/e2fsprogs/lib
-
-libext2_e2p_cflags := -O2 -g -W -Wall
-
-libext2_e2p_system_shared_libraries := libc
-
-libext2_e2p_system_static_libraries := libc
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_e2p_src_files)
-LOCAL_C_INCLUDES := $(libext2_e2p_c_includes)
-LOCAL_CFLAGS := $(libext2_e2p_cflags)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(libext2_e2p_system_shared_libraries)
-LOCAL_MODULE := libext2_e2p
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_e2p_src_files)
-LOCAL_C_INCLUDES := $(libext2_e2p_c_includes)
-LOCAL_CFLAGS := $(libext2_e2p_cflags)
-LOCAL_STATIC_LIBRARIES := $(libext2_e2p_system_static_libraries)
-LOCAL_MODULE := libext2_e2p
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_e2p_src_files)
-LOCAL_C_INCLUDES := $(libext2_e2p_c_includes)
-LOCAL_CFLAGS := $(libext2_e2p_cflags)
-LOCAL_MODULE := libext2_e2p-host
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_e2p_src_files)
-LOCAL_C_INCLUDES := $(libext2_e2p_c_includes)
-LOCAL_CFLAGS := $(libext2_e2p_cflags)
-LOCAL_MODULE := libext2_e2p-host
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_STATIC_LIBRARY)
diff --git a/lib/et/Android.bp b/lib/et/Android.bp
new file mode 100644 (file)
index 0000000..f6ad416
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright 2017 The Android Open Source Project
+
+cc_library {
+    name: "libext2_com_err",
+    host_supported: true,
+    unique_host_soname: true,
+    srcs: [
+        "error_message.c",
+        "et_name.c",
+        "init_et.c",
+        "com_err.c",
+        "com_right.c",
+    ],
+
+    cflags: [
+        "-W",
+        "-Wall",
+    ],
+    target: {
+        windows: {
+            enabled: true,
+        },
+    },
+
+    header_libs: ["libext2-headers"],
+    export_include_dirs: ["."],
+    export_header_lib_headers: ["libext2-headers"],
+}
diff --git a/lib/et/Android.mk b/lib/et/Android.mk
deleted file mode 100644 (file)
index c14e290..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-libext2_com_err_src_files := \
-       error_message.c \
-       et_name.c \
-       init_et.c \
-       com_err.c \
-       com_right.c
-
-libext2_com_err_c_includes := external/e2fsprogs/lib
-
-libext2_com_err_cflags := -O2 -g -W -Wall
-
-libext2_com_err_system_shared_libraries := libc
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_com_err_src_files)
-LOCAL_C_INCLUDES := $(libext2_com_err_c_includes)
-LOCAL_CFLAGS := $(libext2_com_err_cflags)
-LOCAL_SYSTEM_SHARED_LIBRARIES := libc
-LOCAL_MODULE := libext2_com_err
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_com_err_src_files)
-LOCAL_C_INCLUDES := $(libext2_com_err_c_includes)
-LOCAL_CFLAGS := $(libext2_com_err_cflags)
-LOCAL_STATIC_LIBRARIES := libc
-LOCAL_MODULE := libext2_com_err
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_com_err_src_files)
-LOCAL_C_INCLUDES := $(libext2_com_err_c_includes)
-LOCAL_CFLAGS := $(libext2_com_err_cflags)
-LOCAL_MODULE := libext2_com_err-host
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_HOST_OS := darwin linux windows
-
-include $(BUILD_HOST_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_com_err_src_files)
-LOCAL_C_INCLUDES := $(libext2_com_err_c_includes)
-LOCAL_CFLAGS := $(libext2_com_err_cflags)
-LOCAL_MODULE := libext2_com_err-host
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_HOST_OS := darwin linux windows
-
-include $(BUILD_HOST_STATIC_LIBRARY)
diff --git a/lib/ext2fs/Android.bp b/lib/ext2fs/Android.bp
new file mode 100644 (file)
index 0000000..73b11a3
--- /dev/null
@@ -0,0 +1,133 @@
+// Copyright 2017 The Android Open Source Project
+
+cc_library {
+    name: "libext2fs",
+    host_supported: true,
+    unique_host_soname: true,
+    srcs: [
+        "ext2_err.c",
+        "alloc.c",
+        "alloc_sb.c",
+        "alloc_stats.c",
+        "alloc_tables.c",
+        "atexit.c",
+        "badblocks.c",
+        "bb_inode.c",
+        "bitmaps.c",
+        "bitops.c",
+        "blkmap64_ba.c",
+        "blkmap64_rb.c",
+        "blknum.c",
+        "block.c",
+        "bmap.c",
+        "check_desc.c",
+        "crc16.c",
+        "crc32c.c",
+        "csum.c",
+        "closefs.c",
+        "dblist.c",
+        "dblist_dir.c",
+        "digest_encode.c",
+        "dirblock.c",
+        "dirhash.c",
+        "dir_iterate.c",
+        "dupfs.c",
+        "expanddir.c",
+        "ext_attr.c",
+        "extent.c",
+        "fallocate.c",
+        "fileio.c",
+        "finddev.c",
+        "flushb.c",
+        "freefs.c",
+        "gen_bitmap.c",
+        "gen_bitmap64.c",
+        "get_num_dirs.c",
+        "get_pathname.c",
+        "getsize.c",
+        "getsectsize.c",
+        "i_block.c",
+        "icount.c",
+        "imager.c",
+        "ind_block.c",
+        "initialize.c",
+        "inline.c",
+        "inline_data.c",
+        "inode.c",
+        "io_manager.c",
+        "ismounted.c",
+        "link.c",
+        "llseek.c",
+        "lookup.c",
+        "mmp.c",
+        "mkdir.c",
+        "mkjournal.c",
+        "namei.c",
+        "native.c",
+        "newdir.c",
+        "openfs.c",
+        "progress.c",
+        "punch.c",
+        "qcow2.c",
+        "rbtree.c",
+        "read_bb.c",
+        "read_bb_file.c",
+        "res_gdt.c",
+        "rw_bitmaps.c",
+        "sha256.c",
+        "sha512.c",
+        "swapfs.c",
+        "symlink.c",
+        "undo_io.c",
+        "unix_io.c",
+        "sparse_io.c",
+        "unlink.c",
+        "valid_blk.c",
+        "version.c",
+        // get rid of this?!
+        "test_io.c",
+    ],
+    shared_libs: [
+        "libsparse",
+    ],
+    whole_static_libs: [
+        "libext2_com_err"
+    ],
+    cflags: [
+        "-W",
+        "-Wall",
+        "-Wno-unused-parameter",
+    ],
+    target: {
+        host: {
+            shared_libs: ["libz-host"],
+            // Consider removing this library as a whole for the host. It is not
+            // in the android side.
+            whole_static_libs: ["libext2_com_err"],
+        },
+        android: {
+            shared_libs: [
+                "libext2_com_err",
+                "libext2_uuid",
+                "libz"
+            ],
+        },
+        windows: {
+            // include/nonunix is used as an overlay on top of the system
+            // include directory. Some empty header files in include/nonunix
+            // hide the ones in the system include path. This setup doesn't work
+            // unless we pass the include/nonunix as an -isystem flag.
+            // TODO(deymo): Enable windows
+            enabled: false,
+            cflags: [
+                "-Wno-format",
+            //    "-isystem external/e2fsprogs/include/nonunix",
+            ],
+            host_ldlibs: ["-lws2_32"],
+        },
+    },
+
+    header_libs: ["libext2-headers"],
+    export_include_dirs: ["."],
+    export_header_lib_headers: ["libext2-headers"],
+}
diff --git a/lib/ext2fs/Android.mk b/lib/ext2fs/Android.mk
deleted file mode 100644 (file)
index 2ccbb59..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-libext2fs_src_files := \
-       ext2_err.c \
-       alloc.c \
-       alloc_sb.c \
-       alloc_stats.c \
-       alloc_tables.c \
-       atexit.c \
-       badblocks.c \
-       bb_inode.c \
-       bitmaps.c \
-       bitops.c \
-       blkmap64_ba.c \
-       blkmap64_rb.c \
-       blknum.c \
-       block.c \
-       bmap.c \
-       check_desc.c \
-       crc16.c \
-       crc32c.c \
-       csum.c \
-       closefs.c \
-       dblist.c \
-       dblist_dir.c \
-       digest_encode.c \
-       dirblock.c \
-       dirhash.c \
-       dir_iterate.c \
-       dupfs.c \
-       expanddir.c \
-       ext_attr.c \
-       extent.c \
-       fallocate.c \
-       fileio.c \
-       finddev.c \
-       flushb.c \
-       freefs.c \
-       gen_bitmap.c \
-       gen_bitmap64.c \
-       get_num_dirs.c \
-       get_pathname.c \
-       getsize.c \
-       getsectsize.c \
-       i_block.c \
-       icount.c \
-       imager.c \
-       ind_block.c \
-       initialize.c \
-       inline.c \
-       inline_data.c \
-       inode.c \
-       io_manager.c \
-       ismounted.c \
-       link.c \
-       llseek.c \
-       lookup.c \
-       mmp.c \
-       mkdir.c \
-       mkjournal.c \
-       namei.c \
-       native.c \
-       newdir.c \
-       openfs.c \
-       progress.c \
-       punch.c \
-       qcow2.c \
-       rbtree.c \
-       read_bb.c \
-       read_bb_file.c \
-       res_gdt.c \
-       rw_bitmaps.c \
-       sha256.c \
-       sha512.c \
-       swapfs.c \
-       symlink.c \
-       undo_io.c \
-       unix_io.c \
-       sparse_io.c \
-       unlink.c \
-       valid_blk.c \
-       version.c
-
-# get rid of this?!
-libext2fs_src_files += test_io.c
-
-libext2fs_shared_libraries := \
-       libext2_com_err \
-       libext2_uuid
-
-libext2fs_system_shared_libraries := libc
-
-libext2fs_static_libraries := \
-       libext2_com_err \
-       libext2_uuid_static
-
-libext2fs_system_static_libraries := libc
-
-libext2fs_c_includes := external/e2fsprogs/lib
-
-libext2fs_cflags := -O2 -g -W -Wall -Wno-unused-parameter
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2fs_src_files)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(libext2fs_system_shared_libraries)
-LOCAL_SHARED_LIBRARIES := $(libext2fs_shared_libraries) libsparse libz
-LOCAL_C_INCLUDES := $(libext2fs_c_includes)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(libext2fs_c_includes)
-LOCAL_CFLAGS := $(libext2fs_cflags)
-LOCAL_MODULE := libext2fs
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2fs_src_files)
-LOCAL_STATIC_LIBRARIES := $(libext2fs_static_libraries) $(libext2fs_system_static_libraries) libsparse libz
-LOCAL_C_INCLUDES := $(libext2fs_c_includes)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(libext2fs_c_includes)
-LOCAL_CFLAGS := $(libext2fs_cflags) $(libext2fs_cflags_linux)
-LOCAL_MODULE := libext2fs
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2fs_src_files)
-LOCAL_WHOLE_STATIC_LIBRARIES := libext2_com_err-host
-LOCAL_STATIC_LIBRARIES := libsparse libz
-LOCAL_C_INCLUDES := $(libext2fs_c_includes)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(libext2fs_c_includes)
-LOCAL_CFLAGS := $(libext2fs_cflags)
-LOCAL_MODULE := libext2fs-host
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_HOST_OS := darwin linux windows
-LOCAL_CFLAGS_windows := -isystem external/e2fsprogs/include/nonunix -Wno-format
-LOCAL_LDLIBS_windows := -lws2_32
-
-include $(BUILD_HOST_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2fs_src_files)
-LOCAL_WHOLE_STATIC_LIBRARIES := libext2_com_err-host
-LOCAL_STATIC_LIBRARIES := libsparse libz
-LOCAL_C_INCLUDES := $(libext2fs_c_includes)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(libext2fs_c_includes)
-LOCAL_CFLAGS := $(libext2fs_cflags) $(libext2fs_cflags_linux)
-LOCAL_MODULE := libext2fs-host
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_HOST_OS := darwin linux windows
-LOCAL_CFLAGS_windows := -isystem external/e2fsprogs/include/nonunix -Wno-format
-LOCAL_LDLIBS_windows := -lws2_32
-
-include $(BUILD_HOST_STATIC_LIBRARY)
diff --git a/lib/ss/Android.bp b/lib/ss/Android.bp
new file mode 100644 (file)
index 0000000..06925d7
--- /dev/null
@@ -0,0 +1,33 @@
+// Copyright 2017 The Android Open Source Project
+
+cc_library {
+    name: "libext2_ss",
+    host_supported: true,
+    unique_host_soname: true,
+    srcs: [
+        "ss_err.c",
+        "std_rqs.c",
+        "invocation.c",
+        "help.c",
+        "execute_cmd.c",
+        "listen.c",
+        "parse.c",
+        "error.c",
+        "prompt.c",
+        "request_tbl.c",
+        "list_rqs.c",
+        "pager.c",
+        "requests.c",
+        "data.c",
+        "get_readline.c",
+    ],
+    shared_libs: ["libext2_com_err"],
+    cflags: [
+        "-W",
+        "-Wall",
+    ],
+
+    header_libs: ["libext2-headers"],
+    export_include_dirs: ["."],
+    export_header_lib_headers: ["libext2-headers"],
+}
diff --git a/lib/ss/Android.mk b/lib/ss/Android.mk
deleted file mode 100644 (file)
index 28733dd..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-libext2_ss_src_files := \
-       ss_err.c \
-       std_rqs.c \
-       invocation.c help.c \
-       execute_cmd.c \
-       listen.c \
-       parse.c \
-       error.c \
-       prompt.c \
-       request_tbl.c \
-       list_rqs.c \
-       pager.c \
-       requests.c \
-       data.c \
-       get_readline.c
-
-libext2_ss_c_includes := external/e2fsprogs/lib
-
-libext2_ss_cflags := -O2 -g -W -Wall
-
-libext2_ss_shared_libraries := \
-       libext2_com_err
-
-libext2_ss_system_shared_libraries := libc
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_ss_src_files)
-LOCAL_C_INCLUDES := $(libext2_ss_c_includes)
-LOCAL_CFLAGS := $(libext2_ss_cflags)
-LOCAL_SHARED_LIBRARIES := $(libext2_ss_shared_libraries)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(libext2_ss_system_shared_libraries)
-LOCAL_MODULE := libext2_ss
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_ss_src_files)
-LOCAL_C_INCLUDES := $(libext2_ss_c_includes)
-LOCAL_CFLAGS := $(libext2_ss_cflags)
-LOCAL_STATIC_LIBRARIES := libc
-LOCAL_MODULE := libext2_ss
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_ss_src_files)
-LOCAL_SHARED_LIBRARIES := $(addsuffix -host, $(libext2_ss_shared_libraries))
-LOCAL_C_INCLUDES := $(libext2_ss_c_includes)
-LOCAL_CFLAGS := $(libext2_ss_cflags)
-LOCAL_MODULE := libext2_ss-host
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(libext2_ss_src_files)
-LOCAL_C_INCLUDES := $(libext2_ss_c_includes)
-LOCAL_CFLAGS := $(libext2_ss_cflags)
-LOCAL_MODULE := libext2_ss-host
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_STATIC_LIBRARY)
diff --git a/lib/support/Android.bp b/lib/support/Android.bp
new file mode 100644 (file)
index 0000000..11248b4
--- /dev/null
@@ -0,0 +1,53 @@
+// Copyright 2017 The Android Open Source Project
+
+cc_library {
+    name: "libext2_quota",
+    host_supported: true,
+    unique_host_soname: true,
+    srcs: [
+        "dict.c",
+        "mkquota.c",
+        "parse_qtype.c",
+        "plausible.c",
+        "profile.c",
+        "profile_helpers.c",
+        "prof_err.c",
+        "quotaio.c",
+        "quotaio_tree.c",
+        "quotaio_v2.c",
+    ],
+    shared_libs: [
+        "libext2fs",
+        "libext2_com_err",
+        "libext2_blkid",
+    ],
+
+    cflags: [
+        "-W",
+        "-Wall",
+    ],
+
+    header_libs: ["libext2-headers"],
+    export_include_dirs: ["."],
+    export_header_lib_headers: ["libext2-headers"],
+}
+
+cc_library_shared {
+    name: "libext2_profile",
+    host_supported: true,
+    unique_host_soname: true,
+
+    srcs: [
+        "prof_err.c",
+        "profile.c",
+    ],
+    cflags = [
+        "-W",
+        "-Wall",
+    ],
+    shared_libs: ["libext2_com_err"],
+
+    header_libs: ["libext2-headers"],
+    export_include_dirs: ["."],
+    export_header_lib_headers: ["libext2-headers"],
+}
diff --git a/lib/support/Android.mk b/lib/support/Android.mk
deleted file mode 100644 (file)
index fefd058..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-libext2_quota_src_files := \
-       dict.c \
-       mkquota.c \
-       parse_qtype.c \
-       plausible.c \
-       profile.c \
-       profile_helpers.c \
-       prof_err.c \
-       quotaio.c \
-       quotaio_tree.c \
-       quotaio_v2.c
-
-libext2_quota_c_includes := external/e2fsprogs/lib
-
-libext2_quota_cflags := -O2 -g -W -Wall
-
-libext2_quota_shared_libraries := libext2fs libext2_com_err libext2_blkid
-
-libext2_quota_system_shared_libraries := libc
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_quota_src_files)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(libext2_quota_system_shared_libraries)
-LOCAL_C_INCLUDES := $(libext2_quota_c_includes)
-LOCAL_CFLAGS := $(libext2_quota_cflags)
-LOCAL_SYSTEM_SHARED_LIBRARIES := libc $(libext2_quota_shared_libraries)
-LOCAL_MODULE := libext2_quota
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
-
-libext2_quota_static_libraries := libext2fs libext2_com_err
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_quota_src_files)
-LOCAL_C_INCLUDES := $(libext2_quota_c_includes)
-LOCAL_CFLAGS := $(libext2_quota_cflags)
-LOCAL_STATIC_LIBRARIES := libc $(libext2_quota_static_libraries)
-LOCAL_MODULE := libext2_quota
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_quota_src_files)
-LOCAL_C_INCLUDES := $(libext2_quota_c_includes)
-LOCAL_CFLAGS := $(libext2_quota_cflags)
-LOCAL_MODULE := libext2_quota-host
-LOCAL_MODULE_TAGS := optional
-LOCAL_SHARED_LIBRARIES := $(addsuffix -host, $(libext2_quota_shared_libraries))
-
-include $(BUILD_HOST_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-libext2_profile_src_files :=  \
-       prof_err.c \
-       profile.c
-
-libext2_profile_shared_libraries := \
-       libext2_com_err
-
-libext2_profile_system_shared_libraries := libc
-
-libext2_profile_c_includes := external/e2fsprogs/lib
-
-libext2_profile_cflags := -O2 -g -W -Wall
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_profile_src_files)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(libext2_profile_system_shared_libraries)
-LOCAL_SHARED_LIBRARIES := $(libext2_profile_shared_libraries)
-LOCAL_C_INCLUDES := $(libext2_profile_c_includes)
-LOCAL_CFLAGS := $(libext2_profile_cflags)
-LOCAL_MODULE := libext2_profile
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_profile_src_files)
-LOCAL_SHARED_LIBRARIES := $(addsuffix -host, $(libext2_profile_shared_libraries))
-LOCAL_C_INCLUDES := $(libext2_profile_c_includes)
-LOCAL_CFLAGS := $(libext2_profile_cflags)
-LOCAL_MODULE := libext2_profile-host
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_SHARED_LIBRARY)
diff --git a/lib/uuid/Android.bp b/lib/uuid/Android.bp
new file mode 100644 (file)
index 0000000..d173788
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright 2017 The Android Open Source Project
+
+cc_library {
+    name: "libext2_uuid",
+    host_supported: true,
+    unique_host_soname: true,
+    srcs: [
+        "clear.c",
+        "compare.c",
+        "copy.c",
+        "gen_uuid.c",
+        "isnull.c",
+        "pack.c",
+        "parse.c",
+        "unpack.c",
+        "unparse.c",
+        "uuid_time.c",
+    ],
+    cflags: [
+        "-W",
+        "-Wall",
+        "-Wno-unused-function",
+        "-Wno-unused-parameter",
+    ],
+
+    header_libs: ["libext2-headers"],
+    export_include_dirs: ["."],
+    export_header_lib_headers: ["libext2-headers"],
+}
diff --git a/lib/uuid/Android.mk b/lib/uuid/Android.mk
deleted file mode 100644 (file)
index 91d6836..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-libext2_uuid_src_files := \
-       clear.c \
-       compare.c \
-       copy.c \
-       gen_uuid.c \
-       isnull.c \
-       pack.c \
-       parse.c \
-       unpack.c \
-       unparse.c \
-       uuid_time.c
-
-
-libext2_uuid_c_includes := external/e2fsprogs/lib
-
-libext2_uuid_cflags := -O2 -g -W -Wall \
-       -Wno-unused-function \
-       -Wno-unused-parameter
-
-libext2_uuid_system_shared_libraries := libc
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_uuid_src_files)
-LOCAL_C_INCLUDES := $(libext2_uuid_c_includes)
-LOCAL_CFLAGS := $(libext2_uuid_cflags)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) $(LOCAL_PATH)/..
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(libext2_uuid_system_shared_libraries)
-LOCAL_MODULE := libext2_uuid
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_uuid_src_files)
-LOCAL_C_INCLUDES := $(libext2_uuid_c_includes)
-LOCAL_CFLAGS := $(libext2_uuid_cflags)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-LOCAL_MODULE := libext2_uuid-host
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_SHARED_LIBRARY)
-
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_uuid_src_files)
-LOCAL_C_INCLUDES := $(libext2_uuid_c_includes)
-LOCAL_CFLAGS := $(libext2_uuid_cflags)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-LOCAL_STATIC_LIBRARIES := libc
-LOCAL_MODULE := libext2_uuid_static
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_STATIC_LIBRARY)
-
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(libext2_uuid_src_files)
-LOCAL_C_INCLUDES := $(libext2_uuid_c_includes)
-LOCAL_CFLAGS := $(libext2_uuid_cflags)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-LOCAL_MODULE := libext2_uuid-host
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_STATIC_LIBRARY)
diff --git a/misc/Android.bp b/misc/Android.bp
new file mode 100644 (file)
index 0000000..be63b4c
--- /dev/null
@@ -0,0 +1,220 @@
+// Copyright 2017 The Android Open Source Project
+
+// Library used to export files from this directory to other programs in this
+// project.
+cc_library {
+    name: "libext2_misc",
+    host_supported: true,
+
+    srcs: [
+        "create_inode.c",
+    ],
+    cflags: ["-W", "-Wall"],
+    shared_libs: [
+        "libext2_quota",
+        "libext2fs",
+    ],
+    system_shared_libs: ["libc"],
+    export_include_dirs: ["."],
+}
+
+//########################################################################
+// Build mke2fs
+
+cc_binary {
+    name: "mke2fs",
+    host_supported: true,
+
+    srcs: [
+        "mke2fs.c",
+        "util.c",
+        "mk_hugefiles.c",
+        "default_profile.c",
+        "create_inode.c",
+    ],
+    cflags: ["-W", "-Wall"],
+    shared_libs: [
+        "libext2fs",
+        "libext2_blkid",
+        "libext2_uuid",
+        "libext2_quota",
+        "libext2_com_err",
+        "libext2_e2p",
+    ],
+    system_shared_libs: ["libc"],
+    include_dirs: ["external/e2fsprogs/e2fsck"],
+}
+
+//##########################################################################
+// Build tune2fs
+
+cc_defaults {
+    name: "tune2fs-defaults",
+    srcs: [
+        "tune2fs.c",
+        "util.c",
+    ],
+    cflags: [
+        "-W",
+        "-Wall",
+        "-DNO_RECOVERY",
+    ],
+    include_dirs: ["external/e2fsprogs/e2fsck"],
+}
+
+tune2fs_libs = [
+    "libext2_com_err",
+    "libext2_blkid",
+    "libext2_quota",
+    "libext2_uuid",
+    "libext2_e2p",
+    "libext2fs",
+]
+
+cc_binary {
+    name: "tune2fs",
+    host_supported: true,
+    defaults: ["tune2fs-defaults"],
+
+    shared_libs: tune2fs_libs,
+    system_shared_libs: ["libc"],
+}
+
+cc_binary {
+    name: "tune2fs_static",
+    static_executable: true,
+    defaults: ["tune2fs-defaults"],
+
+    static_libs: tune2fs_libs,
+}
+
+cc_library_static {
+    name: "libtune2fs",
+    defaults: ["tune2fs-defaults"],
+
+    cflags: ["-DBUILD_AS_LIB"],
+    static_libs: tune2fs_libs,
+}
+
+//########################################################################
+// Build badblocks
+
+cc_binary {
+    name: "badblocks",
+    host_supported: true,
+
+    srcs: ["badblocks.c"],
+    cflags: ["-W", "-Wall"],
+    shared_libs: [
+        "libext2fs",
+        "libext2_com_err",
+        "libext2_uuid",
+        "libext2_blkid",
+        "libext2_e2p",
+    ],
+    system_shared_libs: ["libc"],
+}
+
+//########################################################################
+// Build chattr
+
+cc_binary {
+    name: "chattr",
+    host_supported: true,
+
+    srcs: ["chattr.c"],
+    cflags: ["-W", "-Wall"],
+    shared_libs: [
+        "libext2_com_err",
+        "libext2_e2p",
+    ],
+    system_shared_libs: ["libc"],
+}
+
+//########################################################################
+// Build lsattr
+
+cc_defaults {
+    name: "lsattr-defaults",
+    srcs: ["lsattr.c"],
+    cflags: ["-W", "-Wall"],
+}
+
+lsattr_libs = [
+    "libext2_com_err",
+    "libext2_e2p",
+]
+
+cc_binary {
+    name: "lsattr",
+    host_supported: true,
+    defaults: ["lsattr-defaults"],
+
+    shared_libs: lsattr_libs,
+    system_shared_libs: ["libc"],
+}
+
+cc_binary {
+    name: "lsattr_static",
+    static_executable: true,
+    defaults: ["lsattr-defaults"],
+
+    static_libs: lsattr_libs,
+}
+
+//########################################################################
+// Build blkid
+
+cc_binary {
+    name: "blkid",
+
+    srcs: ["blkid.c"],
+    cflags: ["-W", "-Wall"],
+    shared_libs: [
+        "libext2fs",
+        "libext2_blkid",
+        "libext2_com_err",
+        "libext2_e2p",
+    ],
+    system_shared_libs: ["libc"],
+}
+
+//########################################################################
+// Build e4crypt
+
+cc_binary {
+    name: "e4crypt",
+    host_supported: true,
+
+    srcs: ["e4crypt.c"],
+    cflags: ["-W", "-Wall"],
+    shared_libs: [
+        "libext2fs",
+        "libext2_uuid",
+    ],
+    system_shared_libs: ["libc"],
+
+    target: {
+        darwin: {
+            enabled: false,
+        },
+    },
+}
+
+//##########################################################################
+// Build e2image
+
+cc_binary {
+    name: "e2image",
+    host_supported: true,
+
+    srcs: ["e2image.c"],
+    cflags: ["-W", "-Wall"],
+    shared_libs: [
+        "libext2fs",
+        "libext2_blkid",
+        "libext2_com_err",
+        "libext2_quota",
+    ],
+    system_shared_libs: ["libc"],
+}
diff --git a/misc/Android.mk b/misc/Android.mk
deleted file mode 100644 (file)
index d960737..0000000
+++ /dev/null
@@ -1,390 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-#########################################################################
-# Build mke2fs
-mke2fs_src_files := \
-       mke2fs.c \
-       util.c \
-       mk_hugefiles.c \
-       default_profile.c \
-       create_inode.c
-
-mke2fs_c_includes := \
-       external/e2fsprogs/e2fsck
-
-mke2fs_cflags := -O2 -g -W -Wall
-
-mke2fs_shared_libraries := \
-       libext2fs \
-       libext2_blkid \
-       libext2_uuid \
-       libext2_quota \
-       libext2_com_err \
-       libext2_e2p
-
-mke2fs_system_shared_libraries := libc
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(mke2fs_src_files)
-LOCAL_C_INCLUDES := $(mke2fs_c_includes)
-LOCAL_CFLAGS := $(mke2fs_cflags)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(mke2fs_system_shared_libraries)
-LOCAL_SHARED_LIBRARIES := $(mke2fs_shared_libraries)
-LOCAL_MODULE := mke2fs
-LOCAL_MODULE_TAGS := optional
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(mke2fs_src_files)
-LOCAL_C_INCLUDES := $(mke2fs_c_includes)
-LOCAL_CFLAGS := $(mke2fs_cflags)
-LOCAL_SHARED_LIBRARIES := $(addsuffix -host, $(mke2fs_shared_libraries))
-LOCAL_MODULE := mke2fs_host
-LOCAL_MODULE_STEM := mke2fs
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_EXECUTABLE)
-
-###########################################################################
-# Build tune2fs
-#
-tune2fs_src_files := \
-       tune2fs.c \
-       util.c
-
-tune2fs_c_includes := \
-       external/e2fsprogs/e2fsck
-
-tune2fs_cflags := -O2 -g -W -Wall -DNO_RECOVERY
-
-tune2fs_shared_libraries := \
-       libext2fs \
-       libext2_com_err \
-       libext2_blkid \
-       libext2_quota \
-       libext2_uuid \
-       libext2_e2p
-
-tune2fs_system_shared_libraries := libc
-
-
-tune2fs_static_libraries := \
-       libext2_com_err \
-       libext2_blkid \
-       libext2_quota \
-       libext2_uuid_static \
-       libext2_e2p \
-       libext2fs
-
-tune2fs_system_static_libraries := libc
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(tune2fs_src_files)
-LOCAL_C_INCLUDES := $(tune2fs_c_includes)
-LOCAL_CFLAGS := $(tune2fs_cflags)
-LOCAL_SHARED_LIBRARIES := $(tune2fs_shared_libraries)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(tune2fs_system_shared_libraries)
-LOCAL_MODULE := tune2fs
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(tune2fs_src_files)
-LOCAL_C_INCLUDES := $(tune2fs_c_includes)
-LOCAL_CFLAGS := $(tune2fs_cflags)
-LOCAL_STATIC_LIBRARIES := $(tune2fs_static_libraries) $(tune2fs_system_static_libraries)
-LOCAL_FORCE_STATIC_EXECUTABLE := true
-LOCAL_MODULE := tune2fs_static
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(tune2fs_src_files)
-LOCAL_C_INCLUDES := $(tune2fs_c_includes)
-LOCAL_CFLAGS := $(tune2fs_cflags) -DBUILD_AS_LIB
-LOCAL_STATIC_LIBRARIES := $(tune2fs_static_libraries) $(tune2fs_system_static_libraries)
-LOCAL_MODULE := libtune2fs
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(tune2fs_src_files)
-LOCAL_C_INCLUDES := $(tune2fs_c_includes)
-LOCAL_CFLAGS := $(tune2fs_cflags)
-LOCAL_SHARED_LIBRARIES := $(addsuffix -host, $(tune2fs_shared_libraries))
-LOCAL_MODULE := tune2fs_host
-LOCAL_MODULE_STEM := tune2fs
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_EXECUTABLE)
-
-#########################################################################
-# Build badblocks
-#
-include $(CLEAR_VARS)
-
-badblocks_src_files := \
-       badblocks.c
-
-badblocks_c_includes :=
-
-badblocks_cflags := -O2 -g -W -Wall
-
-badblocks_shared_libraries := \
-       libext2fs \
-       libext2_com_err \
-       libext2_uuid \
-       libext2_blkid \
-       libext2_e2p
-
-badblocks_system_shared_libraries := libc
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(badblocks_src_files)
-LOCAL_C_INCLUDES := $(badblocks_c_includes)
-LOCAL_CFLAGS := $(badblocks_cflags)
-LOCAL_SHARED_LIBRARIES := $(badblocks_shared_libraries)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(badblocks_system_shared_libraries)
-LOCAL_MODULE := badblocks
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(badblocks_src_files)
-LOCAL_C_INCLUDES := $(badblocks_c_includes)
-LOCAL_CFLAGS := $(badblocks_cflags)
-LOCAL_SHARED_LIBRARIES := $(addsuffix -host, $(badblocks_shared_libraries))
-LOCAL_MODULE := badblocks_host
-LOCAL_MODULE_STEM := badblocks
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_EXECUTABLE)
-
-#########################################################################
-# Build chattr
-#
-include $(CLEAR_VARS)
-
-chattr_src_files := \
-       chattr.c
-
-chattr_c_includes := \
-       external/e2fsprogs/lib
-
-chattr_cflags := -O2 -g -W -Wall
-
-chattr_shared_libraries := \
-       libext2_com_err \
-       libext2_e2p
-
-chattr_system_shared_libraries := libc
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(chattr_src_files)
-LOCAL_C_INCLUDES := $(chattr_c_includes)
-LOCAL_CFLAGS := $(chattr_cflags)
-LOCAL_SHARED_LIBRARIES := $(chattr_shared_libraries)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(chattr_system_shared_libraries)
-LOCAL_MODULE := chattr
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(chattr_src_files)
-LOCAL_C_INCLUDES := $(chattr_c_includes)
-LOCAL_CFLAGS := $(chattr_cflags)
-LOCAL_SHARED_LIBRARIES := $(addsuffix -host, $(chattr_shared_libraries))
-LOCAL_MODULE := chattr_host
-LOCAL_MODULE_STEM := chattr
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_EXECUTABLE)
-
-#########################################################################
-# Build lsattr
-#
-include $(CLEAR_VARS)
-
-lsattr_src_files := \
-       lsattr.c
-
-lsattr_c_includes := \
-       external/e2fsprogs/lib
-
-lsattr_cflags := -O2 -g -W -Wall
-
-lsattr_shared_libraries := \
-       libext2_com_err \
-       libext2_e2p
-
-lsattr_system_shared_libraries := libc
-
-lsattr_static_libraries := \
-       libext2_com_err \
-       libext2_e2p
-
-lsattr_system_static_libraries := libc
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(lsattr_src_files)
-LOCAL_C_INCLUDES := $(lsattr_c_includes)
-LOCAL_CFLAGS := $(lsattr_cflags)
-LOCAL_SHARED_LIBRARIES := $(lsattr_shared_libraries)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(lsattr_system_shared_libraries)
-LOCAL_MODULE := lsattr
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(lsattr_src_files)
-LOCAL_C_INCLUDES := $(lsattr_c_includes)
-LOCAL_CFLAGS := $(lsattr_cflags)
-LOCAL_STATIC_LIBRARIES := $(lsattr_static_libraries) $(lsattr_system_static_libraries)
-LOCAL_FORCE_STATIC_EXECUTABLE := true
-LOCAL_MODULE := lsattr_static
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(lsattr_src_files)
-LOCAL_C_INCLUDES := $(lsattr_c_includes)
-LOCAL_CFLAGS := $(lsattr_cflags)
-LOCAL_SHARED_LIBRARIES := $(addsuffix -host, $(lsattr_shared_libraries))
-LOCAL_MODULE := lsattr_host
-LOCAL_MODULE_STEM := lsattr
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_EXECUTABLE)
-
-#########################################################################
-# Build blkid
-#
-include $(CLEAR_VARS)
-
-blkid_src_files := \
-    blkid.c
-
-blkid_c_includes :=
-
-blkid_cflags := -O2 -g -W -Wall
-
-blkid_shared_libraries := \
-    libext2fs \
-    libext2_blkid \
-    libext2_com_err \
-    libext2_e2p
-
-blkid_system_shared_libraries := libc
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(blkid_src_files)
-LOCAL_C_INCLUDES := $(blkid_c_includes)
-LOCAL_CFLAGS := $(blkid_cflags)
-LOCAL_SHARED_LIBRARIES := $(blkid_shared_libraries)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(blkid_system_shared_libraries)
-LOCAL_MODULE := blkid
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
-
-#########################################################################
-# Build e4crypt
-e4crypt_src_files := e4crypt.c
-
-e4crypt_c_includes := \
-       external/e2fsprogs/lib
-
-e4crypt_cflags := -O2 -g -W -Wall
-
-e4crypt_shared_libraries := libext2fs libext2_uuid
-
-e4crypt_system_shared_libraries := libc
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(e4crypt_src_files)
-LOCAL_C_INCLUDES := $(e4crypt_c_includes)
-LOCAL_CFLAGS := $(e4crypt_cflags)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(e4crypt_system_shared_libraries)
-LOCAL_SHARED_LIBRARIES := $(e4crypt_shared_libraries)
-LOCAL_MODULE := e4crypt
-LOCAL_MODULE_TAGS := optional
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(e4crypt_src_files)
-LOCAL_C_INCLUDES := $(e4crypt_c_includes)
-LOCAL_CFLAGS := $(e4crypt_cflags)
-LOCAL_SHARED_LIBRARIES := $(addsuffix -host, $(e4crypt_shared_libraries))
-LOCAL_MODULE := e4crypt_host
-LOCAL_MODULE_STEM := e4crypt
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_HOST_OS := linux
-
-include $(BUILD_HOST_EXECUTABLE)
-
-###########################################################################
-# Build e2image
-#
-e2image_src_files := \
-       e2image.c
-
-e2image_c_includes := \
-       external/e2fsprogs/lib
-
-e2image_cflags := -O2 -g -W -Wall
-
-e2image_shared_libraries := \
-       libext2fs \
-       libext2_blkid \
-       libext2_com_err \
-       libext2_quota
-
-e2image_system_shared_libraries := libc
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(e2image_src_files)
-LOCAL_C_INCLUDES := $(e2image_c_includes)
-mke2fs_c_includesLOCAL_CFLAGS := $(e2image_cflags)
-LOCAL_SHARED_LIBRARIES := $(e2image_shared_libraries)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(e2image_system_shared_libraries)
-LOCAL_MODULE := e2image
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(e2image_src_files)
-LOCAL_C_INCLUDES := $(e2image_c_includes)
-LOCAL_CFLAGS := $(e2image_cflags)
-LOCAL_SHARED_LIBRARIES := $(addsuffix -host, $(e2image_shared_libraries))
-LOCAL_MODULE := e2image_host
-LOCAL_MODULE_STEM := e2image
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_EXECUTABLE)
-
diff --git a/resize/Android.bp b/resize/Android.bp
new file mode 100644 (file)
index 0000000..5d8f0e8
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright 2017 The Android Open Source Project
+
+cc_binary {
+    name: "resize2fs",
+    host_supported: true,
+
+    srcs: [
+        "extent.c",
+        "resize2fs.c",
+        "main.c",
+        "online.c",
+        "sim_progress.c",
+        "resource_track.c",
+    ],
+    cflags: ["-W", "-Wall"],
+    shared_libs: [
+        "libext2fs",
+        "libext2_com_err",
+        "libext2_e2p",
+        "libext2_uuid",
+        "libext2_blkid",
+    ],
+    system_shared_libs: ["libc"],
+}
diff --git a/resize/Android.mk b/resize/Android.mk
deleted file mode 100644 (file)
index 12d6ab5..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-resize2fs_src_files := \
-       extent.c \
-       resize2fs.c \
-       main.c \
-       online.c \
-       sim_progress.c \
-       resource_track.c
-
-resize2fs_c_includes := external/e2fsprogs/lib
-
-resize2fs_cflags := -O2 -g -W -Wall
-
-resize2fs_shared_libraries := \
-       libext2fs \
-       libext2_com_err \
-       libext2_e2p \
-       libext2_uuid \
-       libext2_blkid
-
-resize2fs_system_shared_libraries := libc
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(resize2fs_src_files)
-LOCAL_C_INCLUDES := $(resize2fs_c_includes)
-LOCAL_CFLAGS := $(resize2fs_cflags)
-LOCAL_SHARED_LIBRARIES := $(resize2fs_shared_libraries)
-LOCAL_SYSTEM_SHARED_LIBRARIES := $(resize2fs_system_shared_libraries)
-LOCAL_MODULE := resize2fs
-LOCAL_MODULE_TAGS := optional
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(resize2fs_src_files)
-LOCAL_C_INCLUDES := $(resize2fs_c_includes)
-LOCAL_CFLAGS := $(resize2fs_cflags)
-LOCAL_SHARED_LIBRARIES := $(addsuffix -host, $(resize2fs_shared_libraries))
-LOCAL_MODULE := resize2fs_host
-LOCAL_MODULE_STEM := resize2fs
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_EXECUTABLE)