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