blob: c34027d542c9ef841a357da3e870fc8ca4125756 [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\"
Chih-Hung Hsiehe88258a2017-10-10 13:39:20 -07008common_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 Hughes6bd9b292017-05-18 09:53:44 -070017# Workaround for the <sys/types.h>/<sys/sysmacros.h> split, here now for
18# bionic and coming later for glibc.
19target_CFLAGS := $(common_CFLAGS) -include sys/sysmacros.h
JP Abgrall4541c652014-06-13 18:07:42 -070020
JP Abgrall3b1946f2014-05-07 16:59:40 -070021# external/e2fsprogs/lib is needed for uuid/uuid.h
Yang Jin42c4b982017-06-09 14:19:35 -070022common_C_INCLUDES := $(LOCAL_PATH)/include external/e2fsprogs/lib/ system/core/libsparse/include
JP Abgrall3b1946f2014-05-07 16:59:40 -070023
JP Abgrall4541c652014-06-13 18:07:42 -070024#----------------------------------------------------------
JP Abgrall3b1946f2014-05-07 16:59:40 -070025include $(CLEAR_VARS)
JP Abgrall4541c652014-06-13 18:07:42 -070026LOCAL_MODULE := libf2fs_fmt
JP Abgrall3b1946f2014-05-07 16:59:40 -070027LOCAL_SRC_FILES := \
28 lib/libf2fs.c \
29 mkfs/f2fs_format.c \
30 mkfs/f2fs_format_utils.c \
31
32LOCAL_C_INCLUDES := $(common_C_INCLUDES)
Elliott Hughes6bd9b292017-05-18 09:53:44 -070033LOCAL_CFLAGS := $(target_CFLAGS)
JP Abgrall3b1946f2014-05-07 16:59:40 -070034LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/mkfs
JP Abgrall3b1946f2014-05-07 16:59:40 -070035include $(BUILD_STATIC_LIBRARY)
36
JP Abgrall4541c652014-06-13 18:07:42 -070037#----------------------------------------------------------
JP Abgrall3b1946f2014-05-07 16:59:40 -070038include $(CLEAR_VARS)
JP Abgrall4541c652014-06-13 18:07:42 -070039LOCAL_MODULE := libf2fs_fmt_host
JP Abgrall3b1946f2014-05-07 16:59:40 -070040LOCAL_SRC_FILES := \
41 lib/libf2fs.c \
42 mkfs/f2fs_format.c \
43 mkfs/f2fs_format_utils.c \
44
45LOCAL_C_INCLUDES := $(common_C_INCLUDES)
Jin Qiancb1d4422017-04-28 14:56:50 -070046LOCAL_CFLAGS := $(common_CFLAGS)
JP Abgrall3b1946f2014-05-07 16:59:40 -070047LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/mkfs
JP Abgrall3b1946f2014-05-07 16:59:40 -070048include $(BUILD_HOST_STATIC_LIBRARY)
49
JP Abgrall4541c652014-06-13 18:07:42 -070050#----------------------------------------------------------
JP Abgrall3b1946f2014-05-07 16:59:40 -070051include $(CLEAR_VARS)
JP Abgrall4541c652014-06-13 18:07:42 -070052LOCAL_MODULE := libf2fs_fmt_host_dyn
JP Abgrall3b1946f2014-05-07 16:59:40 -070053LOCAL_SRC_FILES := \
JP Abgrall4541c652014-06-13 18:07:42 -070054 lib/libf2fs.c \
Jin Qiancb1d4422017-04-28 14:56:50 -070055 lib/libf2fs_io.c \
JP Abgrall4541c652014-06-13 18:07:42 -070056 mkfs/f2fs_format.c \
Jin Qiancb1d4422017-04-28 14:56:50 -070057 mkfs/f2fs_format_utils.c \
JP Abgrall3b1946f2014-05-07 16:59:40 -070058
59LOCAL_C_INCLUDES := $(common_C_INCLUDES)
Jin Qiancb1d4422017-04-28 14:56:50 -070060LOCAL_CFLAGS := $(common_CFLAGS)
JP Abgrall4541c652014-06-13 18:07:42 -070061LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/mkfs
62LOCAL_STATIC_LIBRARIES := \
Yang Jin42c4b982017-06-09 14:19:35 -070063 libf2fs_ioutils_host \
64 libext2_uuid \
65 libsparse \
66 libz
JP Abgrall4541c652014-06-13 18:07:42 -070067# LOCAL_LDLIBS := -ldl
68include $(BUILD_HOST_SHARED_LIBRARY)
69
70#----------------------------------------------------------
71include $(CLEAR_VARS)
JP Abgrall3b1946f2014-05-07 16:59:40 -070072# The LOCAL_MODULE name is referenced by the code. Don't change it.
73LOCAL_MODULE := mkfs.f2fs
JP Abgrall4541c652014-06-13 18:07:42 -070074
75# mkfs.f2fs is used in recovery: must be static.
76LOCAL_FORCE_STATIC_EXECUTABLE := true
77
Ying Wang2a1bc922015-03-10 12:00:06 -070078LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
JP Abgrall4541c652014-06-13 18:07:42 -070079
80LOCAL_SRC_FILES := \
81 lib/libf2fs_io.c \
82 mkfs/f2fs_format_main.c
83LOCAL_C_INCLUDES := $(common_C_INCLUDES)
Elliott Hughes6bd9b292017-05-18 09:53:44 -070084LOCAL_CFLAGS := $(target_CFLAGS)
Yang Jin42c4b982017-06-09 14:19:35 -070085LOCAL_STATIC_LIBRARIES := \
86 libf2fs_fmt \
87 libext2_uuid \
88 libsparse \
89 libz
JP Abgrall3b1946f2014-05-07 16:59:40 -070090LOCAL_MODULE_TAGS := optional
91include $(BUILD_EXECUTABLE)
92
JP Abgrall4541c652014-06-13 18:07:42 -070093#----------------------------------------------------------
JP Abgrall3b1946f2014-05-07 16:59:40 -070094include $(CLEAR_VARS)
Jeff Sharkey3686eec2015-05-22 14:36:53 -070095LOCAL_MODULE := make_f2fs
96
97LOCAL_SRC_FILES := \
98 lib/libf2fs_io.c \
99 mkfs/f2fs_format_main.c
100LOCAL_C_INCLUDES := $(common_C_INCLUDES)
Elliott Hughes6bd9b292017-05-18 09:53:44 -0700101LOCAL_CFLAGS := $(target_CFLAGS)
Jeff Sharkey3686eec2015-05-22 14:36:53 -0700102LOCAL_STATIC_LIBRARIES := libf2fs_fmt
Yang Jin42c4b982017-06-09 14:19:35 -0700103LOCAL_SHARED_LIBRARIES := libext2_uuid libsparse
Jeff Sharkey3686eec2015-05-22 14:36:53 -0700104LOCAL_SYSTEM_SHARED_LIBRARIES := libc
105LOCAL_MODULE_TAGS := optional
106include $(BUILD_EXECUTABLE)
107
108#----------------------------------------------------------
109include $(CLEAR_VARS)
Yang Jin85b47662017-06-23 14:03:18 -0700110LOCAL_MODULE := make_f2fs
Yang Jin42c4b982017-06-09 14:19:35 -0700111
112LOCAL_SRC_FILES := \
113 mkfs/f2fs_format_main.c \
114 lib/libf2fs_io.c \
115
116LOCAL_C_INCLUDES := $(common_C_INCLUDES)
117LOCAL_CFLAGS := $(common_CFLAGS)
118LOCAL_STATIC_LIBRARIES := libf2fs_fmt_host
119LOCAL_SHARED_LIBRARIES := libext2_uuid libsparse
120include $(BUILD_HOST_EXECUTABLE)
121
122#----------------------------------------------------------
123include $(CLEAR_VARS)
JP Abgrall4541c652014-06-13 18:07:42 -0700124# The LOCAL_MODULE name is referenced by the code. Don't change it.
125LOCAL_MODULE := fsck.f2fs
JP Abgrall3b1946f2014-05-07 16:59:40 -0700126LOCAL_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
134LOCAL_C_INCLUDES := $(common_C_INCLUDES)
Elliott Hughes6bd9b292017-05-18 09:53:44 -0700135LOCAL_CFLAGS := $(target_CFLAGS)
Yang Jin42c4b982017-06-09 14:19:35 -0700136LOCAL_SHARED_LIBRARIES := libext2_uuid libsparse
JP Abgrall3b1946f2014-05-07 16:59:40 -0700137LOCAL_SYSTEM_SHARED_LIBRARIES := libc
138LOCAL_MODULE_TAGS := optional
139include $(BUILD_EXECUTABLE)
140
JP Abgrall4541c652014-06-13 18:07:42 -0700141#----------------------------------------------------------
142include $(CLEAR_VARS)
143LOCAL_MODULE := fsck.f2fs
144LOCAL_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
152LOCAL_C_INCLUDES := $(common_C_INCLUDES)
Jin Qiancb1d4422017-04-28 14:56:50 -0700153LOCAL_CFLAGS := $(common_CFLAGS)
Yang Jin42c4b982017-06-09 14:19:35 -0700154LOCAL_SHARED_LIBRARIES := libsparse
Alex Deymo52a2cdc2017-01-12 20:15:41 -0800155LOCAL_HOST_SHARED_LIBRARIES := libext2_uuid
JP Abgrall4541c652014-06-13 18:07:42 -0700156include $(BUILD_HOST_EXECUTABLE)
157
Torne (Richard Coles)140f4032014-05-14 11:38:05 +0100158endif