1# Copyright (c) 2022 Huawei Device Co., Ltd. 2# 3# This program is free software; you can redistribute it and/or modify 4# it under the terms of the GNU General Public License as published by 5# the Free Software Foundation, either version 2 of the License, or 6# (at your option) any later version. 7# 8# This program is distributed in the hope that it will be useful, 9# but WITHOUT ANY WARRANTY; without even the implied warranty of 10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11# GNU General Public License for more details. 12# 13# You should have received a copy of the GNU General Public License along 14# with this program; if not, write to the Free Software Foundation, Inc., 15# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 17import("//build/ohos.gni") 18 19group("exfatprogs") { 20 deps = [ 21 ":exfatlabel", 22 ":fsck.exfat", 23 ":mkfs.exfat", 24 ] 25} 26 27config("exfat-defaults") { 28 cflags = [ 29 "-std=gnu99", 30 "-Wno-error", 31 "-D_FILE_OFFSET_BITS=64", 32 "-DPACKAGE=\"exfatprogs\"", 33 "-DVERSION=\"1.2.0\"", 34 ] 35 include_dirs = [ 36 "dump", 37 "fsck", 38 "include", 39 "label", 40 "mkfs", 41 "tune", 42 "exfat2img", 43 ] 44} 45 46ohos_shared_library("libexfat") { 47 configs = [ ":exfat-defaults" ] 48 sources = [ 49 "lib/exfat_dir.c", 50 "lib/exfat_fs.c", 51 "lib/libexfat.c", 52 ] 53 54 include_dirs = [ "./libexfat" ] 55 56 deps = [] 57 install_enable = true 58 subsystem_name = "thirdparty" 59 part_name = "exfatprogs" 60 install_images = [ "system" ] 61} 62 63################################################### 64##Build mkfs.exfat 65ohos_executable("mkfs.exfat") { 66 configs = [ ":exfat-defaults" ] 67 sources = [ 68 "mkfs/mkfs.c", 69 "mkfs/upcase.c", 70 ] 71 72 include_dirs = [ 73 "./lib", 74 "./mkfs", 75 ] 76 77 deps = [ ":libexfat" ] 78 install_enable = true 79 subsystem_name = "thirdparty" 80 part_name = "exfatprogs" 81 install_images = [ "system" ] 82} 83 84################################################### 85##Build fsck.exfat 86ohos_executable("fsck.exfat") { 87 configs = [ ":exfat-defaults" ] 88 sources = [ 89 "fsck/fsck.c", 90 "fsck/repair.c", 91 ] 92 93 include_dirs = [ 94 "./lib", 95 "./mkfs", 96 "./fsck", 97 ] 98 99 deps = [ ":libexfat" ] 100 install_enable = true 101 subsystem_name = "thirdparty" 102 part_name = "exfatprogs" 103 install_images = [ "system" ] 104} 105 106################################################### 107##Build dump.exfat 108ohos_executable("dump.exfat") { 109 configs = [ ":exfat-defaults" ] 110 sources = [ "dump/dump.c" ] 111 112 include_dirs = [ 113 "./lib", 114 "./mkfs", 115 "./fsck", 116 "./dump", 117 ] 118 119 deps = [ ":libexfat" ] 120 subsystem_name = "thirdparty" 121 part_name = "exfatprogs" 122} 123 124################################################### 125##Build exfatlabel 126ohos_executable("exfatlabel") { 127 configs = [ ":exfat-defaults" ] 128 sources = [ "label/label.c" ] 129 130 include_dirs = [ 131 "./lib", 132 "./mkfs", 133 "./fsck", 134 "./label", 135 ] 136 137 deps = [ ":libexfat" ] 138 subsystem_name = "thirdparty" 139 part_name = "exfatprogs" 140} 141 142################################################### 143##Build tune.exfat 144ohos_executable("tune.exfat") { 145 configs = [ ":exfat-defaults" ] 146 sources = [ "tune/tune.c" ] 147 148 include_dirs = [ 149 "./lib", 150 "./mkfs", 151 "./fsck", 152 "./label", 153 ] 154 155 deps = [ ":libexfat" ] 156 subsystem_name = "thirdparty" 157 part_name = "exfatprogs" 158} 159 160################################################### 161##Build exfat2img 162ohos_executable("exfat2img") { 163 configs = [ ":exfat-defaults" ] 164 sources = [ "exfat2img/exfat2img.c" ] 165 166 include_dirs = [ 167 "./lib", 168 "./mkfs", 169 "./fsck", 170 "./exfat2img", 171 ] 172 173 deps = [ ":libexfat" ] 174 subsystem_name = "thirdparty" 175 part_name = "exfatprogs" 176} 177