1# Copyright 2014 The Android Open Source Project
2
3LOCAL_PATH:= $(call my-dir)
4
5ifeq ($(HOST_OS),linux)
6
7include $(CLEAR_VARS)
8LOCAL_MODULE := libf2fs_utils_host
9LOCAL_SRC_FILES := f2fs_utils.c
10LOCAL_STATIC_LIBRARIES := \
11    libsparse_host \
12    libz
13LOCAL_C_INCLUDES := external/f2fs-tools/include external/f2fs-tools/mkfs
14LOCAL_CFLAGS := -Wno-unused-parameter
15include $(BUILD_HOST_STATIC_LIBRARY)
16
17include $(CLEAR_VARS)
18LOCAL_SRC_FILES := f2fs_ioutils.c
19LOCAL_C_INCLUDES := external/f2fs-tools/include external/f2fs-tools/mkfs
20LOCAL_CFLAGS := -Wno-unused-parameter
21LOCAL_STATIC_LIBRARIES := \
22    libselinux \
23    libsparse_host \
24    libext2_uuid-host \
25    libz
26LOCAL_MODULE := libf2fs_ioutils_host
27include $(BUILD_HOST_STATIC_LIBRARY)
28
29include $(CLEAR_VARS)
30LOCAL_SRC_FILES := f2fs_dlutils.c
31LOCAL_C_INCLUDES := external/f2fs-tools/include external/f2fs-tools/mkfs
32# Will attempt to dlopen("libf2fs_fmt_host_dyn")
33LOCAL_LDLIBS := -ldl
34LOCAL_MODULE := libf2fs_dlutils_host
35include $(BUILD_HOST_STATIC_LIBRARY)
36
37include $(CLEAR_VARS)
38LOCAL_SRC_FILES := make_f2fs_main.c
39LOCAL_MODULE := make_f2fs
40# libf2fs_dlutils_host will dlopen("libf2fs_fmt_host_dyn")
41LOCAL_LDFLAGS := -ldl -rdynamic
42# The following libf2fs_* are from system/extras/f2fs_utils,
43# and do not use code in external/f2fs-tools.
44LOCAL_STATIC_LIBRARIES := libf2fs_utils_host libf2fs_ioutils_host libf2fs_dlutils_host
45LOCAL_REQUIRED_MODULES := libf2fs_fmt_host_dyn
46LOCAL_STATIC_LIBRARIES += \
47    libsparse_host \
48    libz
49include $(BUILD_HOST_EXECUTABLE)
50
51include $(CLEAR_VARS)
52LOCAL_MODULE := libf2fs_dlutils
53LOCAL_SRC_FILES := f2fs_dlutils.c
54LOCAL_C_INCLUDES := external/f2fs-tools/include external/f2fs-tools/mkfs
55LOCAL_SHARED_LIBRARIES := libdl
56include $(BUILD_SHARED_LIBRARY)
57
58include $(CLEAR_VARS)
59LOCAL_MODULE := libf2fs_dlutils_static
60LOCAL_SRC_FILES := f2fs_dlutils.c
61LOCAL_C_INCLUDES := external/f2fs-tools/include external/f2fs-tools/mkfs
62LOCAL_SHARED_LIBRARIES := libdl
63include $(BUILD_STATIC_LIBRARY)
64
65include $(CLEAR_VARS)
66LOCAL_MODULE := libf2fs_utils_static
67LOCAL_SRC_FILES := f2fs_utils.c
68LOCAL_C_INCLUDES := external/f2fs-tools/include external/f2fs-tools/mkfs
69LOCAL_CFLAGS := -Wno-unused-parameter
70LOCAL_STATIC_LIBRARIES := \
71    libsparse_static
72include $(BUILD_STATIC_LIBRARY)
73
74endif
75
76include $(CLEAR_VARS)
77LOCAL_MODULE := libf2fs_sparseblock
78LOCAL_SRC_FILES := f2fs_sparseblock.c
79LOCAL_SHARED_LIBRARIES := libcutils
80LOCAL_C_INCLUDES := external/f2fs-tools/include \
81		system/core/include/log
82include $(BUILD_SHARED_LIBRARY)
83
84include $(CLEAR_VARS)
85LOCAL_MODULE := f2fs_sparseblock
86LOCAL_SRC_FILES := f2fs_sparseblock.c
87LOCAL_SHARED_LIBRARIES := libcutils
88LOCAL_C_INCLUDES := external/f2fs-tools/include \
89		system/core/include/log
90include $(BUILD_EXECUTABLE)
91
92include $(CLEAR_VARS)
93LOCAL_MODULE := mkf2fsuserimg.sh
94LOCAL_SRC_FILES := mkf2fsuserimg.sh
95LOCAL_MODULE_CLASS := EXECUTABLES
96# We don't need any additional suffix.
97LOCAL_MODULE_SUFFIX :=
98LOCAL_BUILT_MODULE_STEM := $(notdir $(LOCAL_SRC_FILES))
99LOCAL_IS_HOST_MODULE := true
100include $(BUILD_PREBUILT)
101
102
103