blob: 2a320228a02ae5a6caa71a097bda057d1f0d29a3 [file] [log] [blame]
JP Abgrall3b1946f2014-05-07 16:59:40 -07001LOCAL_PATH:= $(call my-dir)
2
Torne (Richard Coles)140f4032014-05-14 11:38:05 +01003# f2fs-tools depends on Linux kernel headers being in the system include path.
4ifeq ($(HOST_OS),linux)
5
JP Abgrall3b1946f2014-05-07 16:59:40 -07006# The versions depend on $(LOCAL_PATH)/VERSION
Jin Qiancb1d4422017-04-28 14:56:50 -07007version_CFLAGS := -DF2FS_MAJOR_VERSION=1 -DF2FS_MINOR_VERSION=8 -DF2FS_TOOLS_VERSION=\"1.8.0\" -DF2FS_TOOLS_DATE=\"2017-02-03\"
8common_CFLAGS := -DWITH_ANDROID $(version_CFLAGS)
Elliott Hughes6bd9b292017-05-18 09:53:44 -07009# Workaround for the <sys/types.h>/<sys/sysmacros.h> split, here now for
10# bionic and coming later for glibc.
11target_CFLAGS := $(common_CFLAGS) -include sys/sysmacros.h
JP Abgrall4541c652014-06-13 18:07:42 -070012
JP Abgrall3b1946f2014-05-07 16:59:40 -070013# external/e2fsprogs/lib is needed for uuid/uuid.h
Yang Jin42c4b982017-06-09 14:19:35 -070014common_C_INCLUDES := $(LOCAL_PATH)/include external/e2fsprogs/lib/ system/core/libsparse/include
JP Abgrall3b1946f2014-05-07 16:59:40 -070015
JP Abgrall4541c652014-06-13 18:07:42 -070016#----------------------------------------------------------
JP Abgrall3b1946f2014-05-07 16:59:40 -070017include $(CLEAR_VARS)
JP Abgrall4541c652014-06-13 18:07:42 -070018LOCAL_MODULE := libf2fs_fmt
JP Abgrall3b1946f2014-05-07 16:59:40 -070019LOCAL_SRC_FILES := \
20 lib/libf2fs.c \
21 mkfs/f2fs_format.c \
22 mkfs/f2fs_format_utils.c \
23
24LOCAL_C_INCLUDES := $(common_C_INCLUDES)
Elliott Hughes6bd9b292017-05-18 09:53:44 -070025LOCAL_CFLAGS := $(target_CFLAGS)
JP Abgrall3b1946f2014-05-07 16:59:40 -070026LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/mkfs
JP Abgrall3b1946f2014-05-07 16:59:40 -070027include $(BUILD_STATIC_LIBRARY)
28
JP Abgrall4541c652014-06-13 18:07:42 -070029#----------------------------------------------------------
JP Abgrall3b1946f2014-05-07 16:59:40 -070030include $(CLEAR_VARS)
JP Abgrall4541c652014-06-13 18:07:42 -070031LOCAL_MODULE := libf2fs_fmt_host
JP Abgrall3b1946f2014-05-07 16:59:40 -070032LOCAL_SRC_FILES := \
33 lib/libf2fs.c \
34 mkfs/f2fs_format.c \
35 mkfs/f2fs_format_utils.c \
36
37LOCAL_C_INCLUDES := $(common_C_INCLUDES)
Jin Qiancb1d4422017-04-28 14:56:50 -070038LOCAL_CFLAGS := $(common_CFLAGS)
JP Abgrall3b1946f2014-05-07 16:59:40 -070039LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/mkfs
JP Abgrall3b1946f2014-05-07 16:59:40 -070040include $(BUILD_HOST_STATIC_LIBRARY)
41
JP Abgrall4541c652014-06-13 18:07:42 -070042#----------------------------------------------------------
JP Abgrall3b1946f2014-05-07 16:59:40 -070043include $(CLEAR_VARS)
JP Abgrall4541c652014-06-13 18:07:42 -070044LOCAL_MODULE := libf2fs_fmt_host_dyn
JP Abgrall3b1946f2014-05-07 16:59:40 -070045LOCAL_SRC_FILES := \
JP Abgrall4541c652014-06-13 18:07:42 -070046 lib/libf2fs.c \
Jin Qiancb1d4422017-04-28 14:56:50 -070047 lib/libf2fs_io.c \
JP Abgrall4541c652014-06-13 18:07:42 -070048 mkfs/f2fs_format.c \
Jin Qiancb1d4422017-04-28 14:56:50 -070049 mkfs/f2fs_format_utils.c \
JP Abgrall3b1946f2014-05-07 16:59:40 -070050
51LOCAL_C_INCLUDES := $(common_C_INCLUDES)
Jin Qiancb1d4422017-04-28 14:56:50 -070052LOCAL_CFLAGS := $(common_CFLAGS)
JP Abgrall4541c652014-06-13 18:07:42 -070053LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/mkfs
54LOCAL_STATIC_LIBRARIES := \
Yang Jin42c4b982017-06-09 14:19:35 -070055 libf2fs_ioutils_host \
56 libext2_uuid \
57 libsparse \
58 libz
JP Abgrall4541c652014-06-13 18:07:42 -070059# LOCAL_LDLIBS := -ldl
60include $(BUILD_HOST_SHARED_LIBRARY)
61
62#----------------------------------------------------------
63include $(CLEAR_VARS)
JP Abgrall3b1946f2014-05-07 16:59:40 -070064# The LOCAL_MODULE name is referenced by the code. Don't change it.
65LOCAL_MODULE := mkfs.f2fs
JP Abgrall4541c652014-06-13 18:07:42 -070066
67# mkfs.f2fs is used in recovery: must be static.
68LOCAL_FORCE_STATIC_EXECUTABLE := true
69
Ying Wang2a1bc922015-03-10 12:00:06 -070070LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
JP Abgrall4541c652014-06-13 18:07:42 -070071
72LOCAL_SRC_FILES := \
73 lib/libf2fs_io.c \
74 mkfs/f2fs_format_main.c
75LOCAL_C_INCLUDES := $(common_C_INCLUDES)
Elliott Hughes6bd9b292017-05-18 09:53:44 -070076LOCAL_CFLAGS := $(target_CFLAGS)
Yang Jin42c4b982017-06-09 14:19:35 -070077LOCAL_STATIC_LIBRARIES := \
78 libf2fs_fmt \
79 libext2_uuid \
80 libsparse \
81 libz
JP Abgrall3b1946f2014-05-07 16:59:40 -070082LOCAL_MODULE_TAGS := optional
83include $(BUILD_EXECUTABLE)
84
JP Abgrall4541c652014-06-13 18:07:42 -070085#----------------------------------------------------------
JP Abgrall3b1946f2014-05-07 16:59:40 -070086include $(CLEAR_VARS)
Jeff Sharkey3686eec2015-05-22 14:36:53 -070087LOCAL_MODULE := make_f2fs
88
89LOCAL_SRC_FILES := \
90 lib/libf2fs_io.c \
91 mkfs/f2fs_format_main.c
92LOCAL_C_INCLUDES := $(common_C_INCLUDES)
Elliott Hughes6bd9b292017-05-18 09:53:44 -070093LOCAL_CFLAGS := $(target_CFLAGS)
Jeff Sharkey3686eec2015-05-22 14:36:53 -070094LOCAL_STATIC_LIBRARIES := libf2fs_fmt
Yang Jin42c4b982017-06-09 14:19:35 -070095LOCAL_SHARED_LIBRARIES := libext2_uuid libsparse
Jeff Sharkey3686eec2015-05-22 14:36:53 -070096LOCAL_SYSTEM_SHARED_LIBRARIES := libc
97LOCAL_MODULE_TAGS := optional
98include $(BUILD_EXECUTABLE)
99
100#----------------------------------------------------------
101include $(CLEAR_VARS)
Yang Jin42c4b982017-06-09 14:19:35 -0700102LOCAL_MODULE := make_f2fs_host
103
104LOCAL_SRC_FILES := \
105 mkfs/f2fs_format_main.c \
106 lib/libf2fs_io.c \
107
108LOCAL_C_INCLUDES := $(common_C_INCLUDES)
109LOCAL_CFLAGS := $(common_CFLAGS)
110LOCAL_STATIC_LIBRARIES := libf2fs_fmt_host
111LOCAL_SHARED_LIBRARIES := libext2_uuid libsparse
112include $(BUILD_HOST_EXECUTABLE)
113
114#----------------------------------------------------------
115include $(CLEAR_VARS)
JP Abgrall4541c652014-06-13 18:07:42 -0700116# The LOCAL_MODULE name is referenced by the code. Don't change it.
117LOCAL_MODULE := fsck.f2fs
JP Abgrall3b1946f2014-05-07 16:59:40 -0700118LOCAL_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
126LOCAL_C_INCLUDES := $(common_C_INCLUDES)
Elliott Hughes6bd9b292017-05-18 09:53:44 -0700127LOCAL_CFLAGS := $(target_CFLAGS)
Yang Jin42c4b982017-06-09 14:19:35 -0700128LOCAL_SHARED_LIBRARIES := libext2_uuid libsparse
JP Abgrall3b1946f2014-05-07 16:59:40 -0700129LOCAL_SYSTEM_SHARED_LIBRARIES := libc
130LOCAL_MODULE_TAGS := optional
131include $(BUILD_EXECUTABLE)
132
JP Abgrall4541c652014-06-13 18:07:42 -0700133#----------------------------------------------------------
134include $(CLEAR_VARS)
135LOCAL_MODULE := fsck.f2fs
136LOCAL_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
144LOCAL_C_INCLUDES := $(common_C_INCLUDES)
Jin Qiancb1d4422017-04-28 14:56:50 -0700145LOCAL_CFLAGS := $(common_CFLAGS)
Yang Jin42c4b982017-06-09 14:19:35 -0700146LOCAL_SHARED_LIBRARIES := libsparse
Alex Deymo52a2cdc2017-01-12 20:15:41 -0800147LOCAL_HOST_SHARED_LIBRARIES := libext2_uuid
JP Abgrall4541c652014-06-13 18:07:42 -0700148include $(BUILD_HOST_EXECUTABLE)
149
Torne (Richard Coles)140f4032014-05-14 11:38:05 +0100150endif