JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 1 | LOCAL_PATH:= $(call my-dir) |
| 2 | |
Torne (Richard Coles) | 140f403 | 2014-05-14 11:38:05 +0100 | [diff] [blame] | 3 | # f2fs-tools depends on Linux kernel headers being in the system include path. |
| 4 | ifeq ($(HOST_OS),linux) |
| 5 | |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 6 | # The versions depend on $(LOCAL_PATH)/VERSION |
Jin Qian | cb1d442 | 2017-04-28 14:56:50 -0700 | [diff] [blame] | 7 | version_CFLAGS := -DF2FS_MAJOR_VERSION=1 -DF2FS_MINOR_VERSION=8 -DF2FS_TOOLS_VERSION=\"1.8.0\" -DF2FS_TOOLS_DATE=\"2017-02-03\" |
| 8 | common_CFLAGS := -DWITH_ANDROID $(version_CFLAGS) |
Elliott Hughes | 6bd9b29 | 2017-05-18 09:53:44 -0700 | [diff] [blame] | 9 | # Workaround for the <sys/types.h>/<sys/sysmacros.h> split, here now for |
| 10 | # bionic and coming later for glibc. |
| 11 | target_CFLAGS := $(common_CFLAGS) -include sys/sysmacros.h |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 12 | |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 13 | # external/e2fsprogs/lib is needed for uuid/uuid.h |
Yang Jin | 42c4b98 | 2017-06-09 14:19:35 -0700 | [diff] [blame^] | 14 | common_C_INCLUDES := $(LOCAL_PATH)/include external/e2fsprogs/lib/ system/core/libsparse/include |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 15 | |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 16 | #---------------------------------------------------------- |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 17 | include $(CLEAR_VARS) |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 18 | LOCAL_MODULE := libf2fs_fmt |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 19 | LOCAL_SRC_FILES := \ |
| 20 | lib/libf2fs.c \ |
| 21 | mkfs/f2fs_format.c \ |
| 22 | mkfs/f2fs_format_utils.c \ |
| 23 | |
| 24 | LOCAL_C_INCLUDES := $(common_C_INCLUDES) |
Elliott Hughes | 6bd9b29 | 2017-05-18 09:53:44 -0700 | [diff] [blame] | 25 | LOCAL_CFLAGS := $(target_CFLAGS) |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 26 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/mkfs |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 27 | include $(BUILD_STATIC_LIBRARY) |
| 28 | |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 29 | #---------------------------------------------------------- |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 30 | include $(CLEAR_VARS) |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 31 | LOCAL_MODULE := libf2fs_fmt_host |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 32 | LOCAL_SRC_FILES := \ |
| 33 | lib/libf2fs.c \ |
| 34 | mkfs/f2fs_format.c \ |
| 35 | mkfs/f2fs_format_utils.c \ |
| 36 | |
| 37 | LOCAL_C_INCLUDES := $(common_C_INCLUDES) |
Jin Qian | cb1d442 | 2017-04-28 14:56:50 -0700 | [diff] [blame] | 38 | LOCAL_CFLAGS := $(common_CFLAGS) |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 39 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/mkfs |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 40 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 41 | |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 42 | #---------------------------------------------------------- |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 43 | include $(CLEAR_VARS) |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 44 | LOCAL_MODULE := libf2fs_fmt_host_dyn |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 45 | LOCAL_SRC_FILES := \ |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 46 | lib/libf2fs.c \ |
Jin Qian | cb1d442 | 2017-04-28 14:56:50 -0700 | [diff] [blame] | 47 | lib/libf2fs_io.c \ |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 48 | mkfs/f2fs_format.c \ |
Jin Qian | cb1d442 | 2017-04-28 14:56:50 -0700 | [diff] [blame] | 49 | mkfs/f2fs_format_utils.c \ |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 50 | |
| 51 | LOCAL_C_INCLUDES := $(common_C_INCLUDES) |
Jin Qian | cb1d442 | 2017-04-28 14:56:50 -0700 | [diff] [blame] | 52 | LOCAL_CFLAGS := $(common_CFLAGS) |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 53 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/mkfs |
| 54 | LOCAL_STATIC_LIBRARIES := \ |
Yang Jin | 42c4b98 | 2017-06-09 14:19:35 -0700 | [diff] [blame^] | 55 | libf2fs_ioutils_host \ |
| 56 | libext2_uuid \ |
| 57 | libsparse \ |
| 58 | libz |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 59 | # LOCAL_LDLIBS := -ldl |
| 60 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 61 | |
| 62 | #---------------------------------------------------------- |
| 63 | include $(CLEAR_VARS) |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 64 | # The LOCAL_MODULE name is referenced by the code. Don't change it. |
| 65 | LOCAL_MODULE := mkfs.f2fs |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 66 | |
| 67 | # mkfs.f2fs is used in recovery: must be static. |
| 68 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 69 | |
Ying Wang | 2a1bc92 | 2015-03-10 12:00:06 -0700 | [diff] [blame] | 70 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 71 | |
| 72 | LOCAL_SRC_FILES := \ |
| 73 | lib/libf2fs_io.c \ |
| 74 | mkfs/f2fs_format_main.c |
| 75 | LOCAL_C_INCLUDES := $(common_C_INCLUDES) |
Elliott Hughes | 6bd9b29 | 2017-05-18 09:53:44 -0700 | [diff] [blame] | 76 | LOCAL_CFLAGS := $(target_CFLAGS) |
Yang Jin | 42c4b98 | 2017-06-09 14:19:35 -0700 | [diff] [blame^] | 77 | LOCAL_STATIC_LIBRARIES := \ |
| 78 | libf2fs_fmt \ |
| 79 | libext2_uuid \ |
| 80 | libsparse \ |
| 81 | libz |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 82 | LOCAL_MODULE_TAGS := optional |
| 83 | include $(BUILD_EXECUTABLE) |
| 84 | |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 85 | #---------------------------------------------------------- |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 86 | include $(CLEAR_VARS) |
Jeff Sharkey | 3686eec | 2015-05-22 14:36:53 -0700 | [diff] [blame] | 87 | LOCAL_MODULE := make_f2fs |
| 88 | |
| 89 | LOCAL_SRC_FILES := \ |
| 90 | lib/libf2fs_io.c \ |
| 91 | mkfs/f2fs_format_main.c |
| 92 | LOCAL_C_INCLUDES := $(common_C_INCLUDES) |
Elliott Hughes | 6bd9b29 | 2017-05-18 09:53:44 -0700 | [diff] [blame] | 93 | LOCAL_CFLAGS := $(target_CFLAGS) |
Jeff Sharkey | 3686eec | 2015-05-22 14:36:53 -0700 | [diff] [blame] | 94 | LOCAL_STATIC_LIBRARIES := libf2fs_fmt |
Yang Jin | 42c4b98 | 2017-06-09 14:19:35 -0700 | [diff] [blame^] | 95 | LOCAL_SHARED_LIBRARIES := libext2_uuid libsparse |
Jeff Sharkey | 3686eec | 2015-05-22 14:36:53 -0700 | [diff] [blame] | 96 | LOCAL_SYSTEM_SHARED_LIBRARIES := libc |
| 97 | LOCAL_MODULE_TAGS := optional |
| 98 | include $(BUILD_EXECUTABLE) |
| 99 | |
| 100 | #---------------------------------------------------------- |
| 101 | include $(CLEAR_VARS) |
Yang Jin | 42c4b98 | 2017-06-09 14:19:35 -0700 | [diff] [blame^] | 102 | LOCAL_MODULE := make_f2fs_host |
| 103 | |
| 104 | LOCAL_SRC_FILES := \ |
| 105 | mkfs/f2fs_format_main.c \ |
| 106 | lib/libf2fs_io.c \ |
| 107 | |
| 108 | LOCAL_C_INCLUDES := $(common_C_INCLUDES) |
| 109 | LOCAL_CFLAGS := $(common_CFLAGS) |
| 110 | LOCAL_STATIC_LIBRARIES := libf2fs_fmt_host |
| 111 | LOCAL_SHARED_LIBRARIES := libext2_uuid libsparse |
| 112 | include $(BUILD_HOST_EXECUTABLE) |
| 113 | |
| 114 | #---------------------------------------------------------- |
| 115 | include $(CLEAR_VARS) |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 116 | # The LOCAL_MODULE name is referenced by the code. Don't change it. |
| 117 | LOCAL_MODULE := fsck.f2fs |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 118 | LOCAL_SRC_FILES := \ |
| 119 | fsck/dump.c \ |
| 120 | fsck/fsck.c \ |
| 121 | fsck/main.c \ |
| 122 | fsck/mount.c \ |
| 123 | lib/libf2fs.c \ |
| 124 | lib/libf2fs_io.c \ |
| 125 | |
| 126 | LOCAL_C_INCLUDES := $(common_C_INCLUDES) |
Elliott Hughes | 6bd9b29 | 2017-05-18 09:53:44 -0700 | [diff] [blame] | 127 | LOCAL_CFLAGS := $(target_CFLAGS) |
Yang Jin | 42c4b98 | 2017-06-09 14:19:35 -0700 | [diff] [blame^] | 128 | LOCAL_SHARED_LIBRARIES := libext2_uuid libsparse |
JP Abgrall | 3b1946f | 2014-05-07 16:59:40 -0700 | [diff] [blame] | 129 | LOCAL_SYSTEM_SHARED_LIBRARIES := libc |
| 130 | LOCAL_MODULE_TAGS := optional |
| 131 | include $(BUILD_EXECUTABLE) |
| 132 | |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 133 | #---------------------------------------------------------- |
| 134 | include $(CLEAR_VARS) |
| 135 | LOCAL_MODULE := fsck.f2fs |
| 136 | LOCAL_SRC_FILES := \ |
| 137 | fsck/dump.c \ |
| 138 | fsck/fsck.c \ |
| 139 | fsck/main.c \ |
| 140 | fsck/mount.c \ |
| 141 | lib/libf2fs.c \ |
| 142 | lib/libf2fs_io.c \ |
| 143 | |
| 144 | LOCAL_C_INCLUDES := $(common_C_INCLUDES) |
Jin Qian | cb1d442 | 2017-04-28 14:56:50 -0700 | [diff] [blame] | 145 | LOCAL_CFLAGS := $(common_CFLAGS) |
Yang Jin | 42c4b98 | 2017-06-09 14:19:35 -0700 | [diff] [blame^] | 146 | LOCAL_SHARED_LIBRARIES := libsparse |
Alex Deymo | 52a2cdc | 2017-01-12 20:15:41 -0800 | [diff] [blame] | 147 | LOCAL_HOST_SHARED_LIBRARIES := libext2_uuid |
JP Abgrall | 4541c65 | 2014-06-13 18:07:42 -0700 | [diff] [blame] | 148 | include $(BUILD_HOST_EXECUTABLE) |
| 149 | |
Torne (Richard Coles) | 140f403 | 2014-05-14 11:38:05 +0100 | [diff] [blame] | 150 | endif |