OSDN Git Service

Android: support building exfat-utils.
[android-x86/external-exfat.git] / Android.mk
1 #
2 # Free exFAT implementation.
3 # Copyright (C) 2017  liminghao
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License along
16 # with this program; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 #
19
20 LOCAL_PATH:= $(call my-dir)
21
22 exfat_common_cflags := \
23     -std=gnu99 \
24     -D_FILE_OFFSET_BITS=64 \
25     -DPACKAGE='"exfat"' \
26     -DVERSION='"1.2.8"'
27
28 ########################################
29 # static library: libexfat.a
30
31 libexfat_src_files := \
32     libexfat/cluster.c \
33     libexfat/io.c \
34     libexfat/log.c \
35     libexfat/lookup.c \
36     libexfat/mount.c \
37     libexfat/node.c \
38     libexfat/time.c \
39     libexfat/utf.c \
40     libexfat/utils.c
41
42 libexfat_headers := $(LOCAL_PATH)/libexfat
43
44 ## TARGET ##
45 include $(CLEAR_VARS)
46
47 LOCAL_MODULE := libexfat
48 LOCAL_MODULE_TAGS := optional
49 LOCAL_SRC_FILES := $(libexfat_src_files)
50 LOCAL_CFLAGS := $(exfat_common_cflags)
51 LOCAL_C_INCLUDES := $(libexfat_headers)
52
53 include $(BUILD_STATIC_LIBRARY)
54
55 ## HOST ##
56 include $(CLEAR_VARS)
57
58 LOCAL_MODULE := libexfat
59 LOCAL_MODULE_TAGS := optional
60 LOCAL_SRC_FILES := $(libexfat_src_files)
61 LOCAL_CFLAGS := $(exfat_common_cflags)
62 LOCAL_C_INCLUDES := $(libexfat_headers)
63
64 include $(BUILD_HOST_STATIC_LIBRARY)
65
66
67 ########################################
68 # executable: mkexfatfs
69
70 mkexfatfs_src_files := \
71     mkfs/cbm.c \
72     mkfs/fat.c \
73     mkfs/main.c \
74     mkfs/mkexfat.c \
75     mkfs/rootdir.c \
76     mkfs/uct.c \
77     mkfs/uctc.c \
78     mkfs/vbr.c
79
80 mkexfatfs_headers := \
81     $(libexfat_headers) \
82     $(LOCAL_PATH)/mkfs
83
84 ## TARGET ##
85 include $(CLEAR_VARS)
86
87 LOCAL_MODULE := mkexfatfs
88 LOCAL_MODULE_TAGS := optional
89 LOCAL_SRC_FILES := $(mkexfatfs_src_files)
90 LOCAL_CFLAGS := $(exfat_common_cflags)
91 LOCAL_C_INCLUDES := $(mkexfatfs_headers)
92 LOCAL_STATIC_LIBRARIES := libexfat
93
94 include $(BUILD_EXECUTABLE)
95
96 ## HOST ##
97 include $(CLEAR_VARS)
98
99 LOCAL_MODULE := mkexfatfs
100 LOCAL_MODULE_TAGS := optional
101 LOCAL_SRC_FILES := $(mkexfatfs_src_files)
102 LOCAL_CFLAGS := $(exfat_common_cflags)
103 LOCAL_C_INCLUDES := $(mkexfatfs_headers)
104 LOCAL_STATIC_LIBRARIES := libexfat
105
106 include $(BUILD_HOST_EXECUTABLE)
107
108 ########################################
109 # executable: exfatfsck
110
111 exfatfsck_src_files := fsck/main.c
112
113 exfatfsck_headers := \
114     $(libexfat_headers) \
115     $(LOCAL_PATH)/fsck
116
117 ## TARGET ##
118 include $(CLEAR_VARS)
119
120 LOCAL_MODULE := exfatfsck
121 LOCAL_MODULE_TAGS := optional
122 LOCAL_SRC_FILES := $(exfatfsck_src_files)
123 LOCAL_CFLAGS := $(exfat_common_cflags)
124 LOCAL_C_INCLUDES := $(exfatfsck_headers)
125 LOCAL_STATIC_LIBRARIES := libexfat
126
127 include $(BUILD_EXECUTABLE)
128
129 ## HOST ##
130 include $(CLEAR_VARS)
131
132 LOCAL_MODULE := exfatfsck
133 LOCAL_MODULE_TAGS := optional
134 LOCAL_SRC_FILES := $(exfatfsck_src_files)
135 LOCAL_CFLAGS := $(exfat_common_cflags)
136 LOCAL_C_INCLUDES := $(exfatfsck_headers)
137 LOCAL_STATIC_LIBRARIES := libexfat
138
139 include $(BUILD_HOST_EXECUTABLE)
140
141 ########################################
142 # executable: dumpexfat
143
144 dumpexfat_src_files := dump/main.c
145
146 dumpexfat_headers := \
147     $(libexfat_headers) \
148     $(LOCAL_PATH)/dump
149
150 ## TARGET ##
151 include $(CLEAR_VARS)
152
153 LOCAL_MODULE := dumpexfat
154 LOCAL_MODULE_TAGS := optional
155 LOCAL_SRC_FILES := $(dumpexfat_src_files)
156 LOCAL_CFLAGS := $(exfat_common_cflags)
157 LOCAL_C_INCLUDES := $(dumpexfat_headers)
158 LOCAL_STATIC_LIBRARIES := libexfat
159
160 include $(BUILD_EXECUTABLE)
161
162 ## HOST ##
163 include $(CLEAR_VARS)
164
165 LOCAL_MODULE := dumpexfat
166 LOCAL_MODULE_TAGS := optional
167 LOCAL_SRC_FILES := $(dumpexfat_src_files)
168 LOCAL_CFLAGS := $(exfat_common_cflags)
169 LOCAL_C_INCLUDES := $(dumpexfat_headers)
170 LOCAL_STATIC_LIBRARIES := libexfat
171
172 include $(BUILD_HOST_EXECUTABLE)
173
174 ########################################
175 # executable: exfatlabel
176
177 exfatlabel_src_files := label/main.c
178
179 exfatlabel_headers := \
180     $(libexfat_headers) \
181     $(LOCAL_PATH)/label
182
183 ## TARGET ##
184 include $(CLEAR_VARS)
185
186 LOCAL_MODULE := exfatlabel
187 LOCAL_MODULE_TAGS := optional
188 LOCAL_SRC_FILES := $(exfatlabel_src_files)
189 LOCAL_CFLAGS := $(exfat_common_cflags)
190 LOCAL_C_INCLUDES := $(exfatlabel_headers)
191 LOCAL_STATIC_LIBRARIES := libexfat
192
193 include $(BUILD_EXECUTABLE)
194
195 ## HOST ##
196 include $(CLEAR_VARS)
197
198 LOCAL_MODULE := exfatlabel
199 LOCAL_MODULE_TAGS := optional
200 LOCAL_SRC_FILES := $(exfatlabel_src_files)
201 LOCAL_CFLAGS := $(exfat_common_cflags)
202 LOCAL_C_INCLUDES := $(exfatlabel_headers)
203 LOCAL_STATIC_LIBRARIES := libexfat
204
205 include $(BUILD_HOST_EXECUTABLE)