Whamcloud - gitweb
AOSP: mke2fs: add links for mkfs.ext[234]
[tools/e2fsprogs.git] / misc / Android.bp
1 // Copyright 2017 The Android Open Source Project
2
3 // Library used to export files from this directory to other programs in this
4 // project.
5 cc_library {
6     name: "libext2_misc",
7     host_supported: true,
8
9     target: {
10         windows: {
11             include_dirs: [ "external/e2fsprogs/include/mingw" ],
12             enabled: true,
13             cflags: ["-Wno-unused-variable"],
14         },
15     },
16
17     srcs: [
18         "create_inode.c",
19     ],
20     cflags: ["-W", "-Wall"],
21     shared_libs: [
22         "libext2_quota",
23         "libext2fs",
24     ],
25     system_shared_libs: ["libc", "libdl"],
26     export_include_dirs: ["."],
27 }
28
29 //########################################################################
30 // Build mke2fs
31
32 cc_binary {
33     name: "mke2fs",
34     host_supported: true,
35
36     srcs: [
37         "mke2fs.c",
38         "util.c",
39         "mk_hugefiles.c",
40         "default_profile.c",
41     ],
42     required: [
43         "mke2fs.conf",
44     ],
45     cflags: ["-W", "-Wall", "-Wno-macro-redefined"],
46     target: {
47         host: {
48             static_libs: [
49                 "libext2_blkid",
50                 "libext2_misc",
51                 "libext2_uuid",
52                 "libext2_quota",
53                 "libext2_com_err",
54                 "libext2_e2p",
55                 "libext2fs",
56                 "libsparse",
57                 "libbase",
58                 "libz",
59             ],
60         },
61         windows: {
62             include_dirs: [ "external/e2fsprogs/include/mingw" ],
63             cflags: ["-D_POSIX", "-D__USE_MINGW_ALARM"],
64             ldflags: ["-static"],
65             host_ldlibs: ["-lws2_32"],
66             enabled: true
67         },
68         android: {
69             shared_libs: [
70                 "libext2fs",
71                 "libext2_blkid",
72                 "libext2_misc",
73                 "libext2_uuid",
74                 "libext2_quota",
75                 "libext2_com_err",
76                 "libext2_e2p",
77             ],
78             symlinks: ["mkfs.ext2", "mkfs.ext3", "mkfs.ext4"],
79         },
80     },
81     stl: "libc++_static",
82     include_dirs: ["external/e2fsprogs/e2fsck"],
83 }
84
85 //##########################################################################
86 // Build tune2fs
87
88 cc_defaults {
89     name: "tune2fs-defaults",
90     srcs: [
91         "tune2fs.c",
92         "util.c",
93     ],
94     cflags: [
95         "-W",
96         "-Wall",
97         "-DNO_RECOVERY",
98         "-Wno-macro-redefined",
99     ],
100     include_dirs: ["external/e2fsprogs/e2fsck"],
101 }
102
103 tune2fs_libs = [
104     "libext2_com_err",
105     "libext2_blkid",
106     "libext2_quota",
107     "libext2_uuid",
108     "libext2_e2p",
109     "libext2fs",
110 ]
111
112 cc_binary {
113     name: "tune2fs",
114     host_supported: true,
115     defaults: ["tune2fs-defaults"],
116
117     shared_libs: tune2fs_libs,
118     system_shared_libs: ["libc", "libdl"],
119 }
120
121 cc_binary {
122     name: "tune2fs_static",
123     static_executable: true,
124     defaults: ["tune2fs-defaults"],
125
126     static_libs: tune2fs_libs + ["libc"],
127 }
128
129 cc_library_static {
130     name: "libtune2fs",
131     defaults: ["tune2fs-defaults"],
132
133     cflags: ["-DBUILD_AS_LIB"],
134     static_libs: tune2fs_libs,
135 }
136
137 //########################################################################
138 // Build badblocks
139
140 cc_binary {
141     name: "badblocks",
142     host_supported: true,
143
144     srcs: ["badblocks.c"],
145     cflags: ["-W", "-Wall", "-Wno-macro-redefined"],
146     shared_libs: [
147         "libext2fs",
148         "libext2_com_err",
149         "libext2_uuid",
150         "libext2_blkid",
151         "libext2_e2p",
152     ],
153     system_shared_libs: ["libc", "libdl"],
154 }
155
156 //########################################################################
157 // Build chattr
158
159 cc_binary {
160     name: "chattr",
161     host_supported: true,
162
163     srcs: ["chattr.c"],
164     cflags: ["-W", "-Wall", "-Wno-macro-redefined"],
165     shared_libs: [
166         "libext2_com_err",
167         "libext2_e2p",
168     ],
169     system_shared_libs: ["libc", "libdl"],
170 }
171
172 //########################################################################
173 // Build lsattr
174
175 cc_defaults {
176     name: "lsattr-defaults",
177     srcs: ["lsattr.c"],
178     cflags: ["-W", "-Wall", "-Wno-macro-redefined"],
179 }
180
181 lsattr_libs = [
182     "libext2_com_err",
183     "libext2_e2p",
184 ]
185
186 cc_binary {
187     name: "lsattr",
188     host_supported: true,
189     defaults: ["lsattr-defaults"],
190
191     shared_libs: lsattr_libs,
192     system_shared_libs: ["libc", "libdl"],
193 }
194
195 cc_binary {
196     name: "lsattr_static",
197     static_executable: true,
198     defaults: ["lsattr-defaults"],
199
200     static_libs: lsattr_libs + ["libc"],
201 }
202
203 //########################################################################
204 // Build blkid
205
206 cc_binary {
207     name: "blkid",
208
209     srcs: ["blkid.c"],
210     cflags: ["-W", "-Wall", "-Wno-macro-redefined"],
211     shared_libs: [
212         "libext2fs",
213         "libext2_blkid",
214         "libext2_com_err",
215         "libext2_e2p",
216     ],
217     system_shared_libs: ["libc", "libdl"],
218 }
219
220 //########################################################################
221 // Build e4crypt
222
223 cc_binary {
224     name: "e4crypt",
225     host_supported: true,
226
227     srcs: ["e4crypt.c"],
228     cflags: ["-W", "-Wall", "-Wno-macro-redefined"],
229     shared_libs: [
230         "libext2fs",
231         "libext2_uuid",
232     ],
233     system_shared_libs: ["libc", "libdl"],
234
235     target: {
236         darwin: {
237             enabled: false,
238         },
239     },
240 }
241
242 //##########################################################################
243 // Build e2image
244
245 cc_binary {
246     name: "e2image",
247     host_supported: true,
248
249     srcs: ["e2image.c"],
250     cflags: ["-W", "-Wall", "-Wno-macro-redefined"],
251     shared_libs: [
252         "libext2fs",
253         "libext2_blkid",
254         "libext2_com_err",
255         "libext2_quota",
256     ],
257     system_shared_libs: ["libc", "libdl"],
258 }