1# Copyright 2010 The Android Open Source Project
2
3LOCAL_PATH:= $(call my-dir)
4
5libext4_utils_src_files := \
6    make_ext4fs.c \
7    ext4fixup.c \
8    ext4_utils.c \
9    allocate.c \
10    contents.c \
11    extent.c \
12    indirect.c \
13    sha1.c \
14    wipe.c \
15    crc16.c \
16    ext4_sb.c
17
18#
19# -- All host/targets including windows
20#
21
22include $(CLEAR_VARS)
23LOCAL_SRC_FILES := $(libext4_utils_src_files)
24LOCAL_MODULE := libext4_utils_host
25# Various instances of dereferencing a type-punned pointer in extent.c
26LOCAL_CFLAGS += -fno-strict-aliasing
27LOCAL_STATIC_LIBRARIES := \
28    libsparse_host \
29    libz
30LOCAL_STATIC_LIBRARIES_darwin += libselinux
31LOCAL_STATIC_LIBRARIES_linux += libselinux
32LOCAL_MODULE_HOST_OS := darwin linux windows
33include $(BUILD_HOST_STATIC_LIBRARY)
34
35
36include $(CLEAR_VARS)
37LOCAL_SRC_FILES := make_ext4fs_main.c
38LOCAL_MODULE := make_ext4fs
39LOCAL_SHARED_LIBRARIES += libcutils
40LOCAL_STATIC_LIBRARIES += \
41    libext4_utils_host \
42    libsparse_host \
43    libz
44LOCAL_LDLIBS_windows += -lws2_32
45LOCAL_SHARED_LIBRARIES_darwin += libselinux
46LOCAL_SHARED_LIBRARIES_linux += libselinux
47LOCAL_CFLAGS_darwin := -DHOST
48LOCAL_CFLAGS_linux := -DHOST
49include $(BUILD_HOST_EXECUTABLE)
50
51include $(CLEAR_VARS)
52LOCAL_SRC_FILES := blk_alloc_to_base_fs.c
53LOCAL_MODULE := blk_alloc_to_base_fs
54LOCAL_SHARED_LIBRARIES += libcutils
55LOCAL_CFLAGS_darwin := -DHOST
56LOCAL_CFLAGS_linux := -DHOST
57include $(BUILD_HOST_EXECUTABLE)
58
59#
60# -- All host/targets excluding windows
61#
62
63libext4_utils_src_files += \
64    key_control.cpp \
65    ext4_crypt.cpp
66
67ifneq ($(HOST_OS),windows)
68
69include $(CLEAR_VARS)
70LOCAL_SRC_FILES := $(libext4_utils_src_files)
71LOCAL_MODULE := libext4_utils
72LOCAL_C_INCLUDES += system/core/logwrapper/include
73# Various instances of dereferencing a type-punned pointer in extent.c
74LOCAL_CFLAGS += -fno-strict-aliasing
75LOCAL_SHARED_LIBRARIES := \
76    libbase \
77    libcutils \
78    libext2_uuid \
79    libselinux \
80    libsparse \
81    libz
82LOCAL_CFLAGS := -DREAL_UUID
83include $(BUILD_SHARED_LIBRARY)
84
85
86include $(CLEAR_VARS)
87LOCAL_SRC_FILES := $(libext4_utils_src_files) \
88    ext4_crypt_init_extensions.cpp
89LOCAL_MODULE := libext4_utils_static
90# Various instances of dereferencing a type-punned pointer in extent.c
91LOCAL_CFLAGS += -fno-strict-aliasing
92LOCAL_STATIC_LIBRARIES := \
93    libbase \
94    liblogwrap \
95    libsparse_static \
96    libselinux \
97    libbase
98include $(BUILD_STATIC_LIBRARY)
99
100
101include $(CLEAR_VARS)
102LOCAL_SRC_FILES := make_ext4fs_main.c
103LOCAL_MODULE := make_ext4fs
104LOCAL_SHARED_LIBRARIES := \
105    libcutils \
106    libext2_uuid \
107    libext4_utils \
108    libselinux \
109    libz
110LOCAL_CFLAGS := -DREAL_UUID
111include $(BUILD_EXECUTABLE)
112
113
114include $(CLEAR_VARS)
115LOCAL_SRC_FILES := ext2simg.c
116LOCAL_MODULE := ext2simg
117LOCAL_SHARED_LIBRARIES += \
118    libext4_utils \
119    libselinux \
120    libsparse \
121    libz
122include $(BUILD_EXECUTABLE)
123
124
125include $(CLEAR_VARS)
126LOCAL_SRC_FILES := ext2simg.c
127LOCAL_MODULE := ext2simg
128LOCAL_SHARED_LIBRARIES += \
129    libselinux
130LOCAL_STATIC_LIBRARIES += \
131    libext4_utils_host \
132    libsparse_host \
133    libz
134include $(BUILD_HOST_EXECUTABLE)
135
136
137include $(CLEAR_VARS)
138LOCAL_SRC_FILES := setup_fs.c
139LOCAL_MODULE := setup_fs
140LOCAL_SHARED_LIBRARIES += libcutils
141include $(BUILD_EXECUTABLE)
142
143
144include $(CLEAR_VARS)
145LOCAL_SRC_FILES := ext4fixup_main.c
146LOCAL_MODULE := ext4fixup
147LOCAL_SHARED_LIBRARIES += \
148    libext4_utils \
149    libsparse \
150    libz
151include $(BUILD_EXECUTABLE)
152
153
154include $(CLEAR_VARS)
155LOCAL_SRC_FILES := ext4fixup_main.c
156LOCAL_MODULE := ext4fixup
157LOCAL_STATIC_LIBRARIES += \
158    libext4_utils_host \
159    libsparse_host \
160    libz
161include $(BUILD_HOST_EXECUTABLE)
162
163
164include $(CLEAR_VARS)
165LOCAL_MODULE := mkuserimg.sh
166LOCAL_SRC_FILES := mkuserimg.sh
167LOCAL_MODULE_CLASS := EXECUTABLES
168# We don't need any additional suffix.
169LOCAL_MODULE_SUFFIX :=
170LOCAL_BUILT_MODULE_STEM := $(notdir $(LOCAL_SRC_FILES))
171LOCAL_IS_HOST_MODULE := true
172include $(BUILD_PREBUILT)
173
174endif
175