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