1LOCAL_PATH := $(call my-dir)
2
3#########################
4# Build the libext2 profile library
5
6libext2_profile_src_files :=  \
7	prof_err.c \
8	profile.c
9
10libext2_profile_shared_libraries := \
11	libext2_com_err
12
13libext2_profile_system_shared_libraries := libc
14
15libext2_profile_c_includes := external/e2fsprogs/lib
16
17libext2_profile_cflags := -O2 -g -W -Wall \
18	-DHAVE_UNISTD_H \
19	-DHAVE_ERRNO_H \
20	-DHAVE_NETINET_IN_H \
21	-DHAVE_SYS_IOCTL_H \
22	-DHAVE_SYS_MMAN_H \
23	-DHAVE_SYS_MOUNT_H \
24	-DHAVE_SYS_PRCTL_H \
25	-DHAVE_SYS_RESOURCE_H \
26	-DHAVE_SYS_SELECT_H \
27	-DHAVE_SYS_STAT_H \
28	-DHAVE_SYS_TYPES_H \
29	-DHAVE_STDLIB_H \
30	-DHAVE_STRDUP \
31	-DHAVE_MMAP \
32	-DHAVE_UTIME_H \
33	-DHAVE_GETPAGESIZE \
34	-DHAVE_LSEEK64 \
35	-DHAVE_LSEEK64_PROTOTYPE \
36	-DHAVE_EXT2_IOCTLS \
37	-DHAVE_LINUX_FD_H \
38	-DHAVE_TYPE_SSIZE_T \
39	-DHAVE_SYS_TIME_H \
40        -DHAVE_SYS_PARAM_H \
41	-DHAVE_SYSCONF \
42	-DDISABLE_BACKTRACE=1
43
44include $(CLEAR_VARS)
45
46LOCAL_SRC_FILES := $(libext2_profile_src_files)
47LOCAL_SYSTEM_SHARED_LIBRARIES := $(libext2_profile_system_shared_libraries)
48LOCAL_SHARED_LIBRARIES := $(libext2_profile_shared_libraries)
49LOCAL_C_INCLUDES := $(libext2_profile_c_includes)
50LOCAL_CFLAGS := $(libext2_profile_cflags)
51LOCAL_MODULE := libext2_profile
52LOCAL_MODULE_TAGS := optional
53
54include $(BUILD_SHARED_LIBRARY)
55
56include $(CLEAR_VARS)
57
58LOCAL_SRC_FILES := $(libext2_profile_src_files)
59LOCAL_SHARED_LIBRARIES := $(addsuffix _host, $(libext2_profile_shared_libraries))
60LOCAL_C_INCLUDES := $(libext2_profile_c_includes)
61LOCAL_CFLAGS := $(libext2_profile_cflags)
62LOCAL_MODULE := libext2_profile_host
63LOCAL_MODULE_TAGS := optional
64
65include $(BUILD_HOST_SHARED_LIBRARY)
66
67#########################
68# Build the e2fsck binary
69
70e2fsck_src_files :=  \
71	crc32.c \
72	e2fsck.c \
73	dict.c \
74	super.c \
75	pass1.c \
76	pass1b.c \
77	pass2.c \
78	pass3.c \
79	pass4.c \
80	pass5.c \
81	logfile.c \
82	journal.c \
83	recovery.c \
84	revoke.c \
85	badblocks.c \
86	util.c \
87	unix.c \
88	dirinfo.c \
89	dx_dirinfo.c \
90	ehandler.c \
91	problem.c \
92	message.c \
93	ea_refcount.c \
94	quota.c \
95	rehash.c \
96	region.c \
97	sigcatcher.c
98
99e2fsck_shared_libraries := \
100	libext2fs \
101	libext2_blkid \
102	libext2_uuid \
103	libext2_profile \
104	libext2_quota \
105	libext2_com_err \
106	libext2_e2p
107e2fsck_system_shared_libraries := libc
108
109e2fsck_c_includes := external/e2fsprogs/lib
110
111e2fsck_cflags := -O2 -g -W -Wall -fno-strict-aliasing \
112	-DHAVE_DIRENT_H \
113	-DHAVE_ERRNO_H \
114	-DHAVE_INTTYPES_H \
115	-DHAVE_LINUX_FD_H \
116	-DHAVE_NETINET_IN_H \
117	-DHAVE_SETJMP_H \
118	-DHAVE_SYS_IOCTL_H \
119	-DHAVE_SYS_MMAN_H \
120	-DHAVE_SYS_MOUNT_H \
121	-DHAVE_SYS_PRCTL_H \
122	-DHAVE_SYS_RESOURCE_H \
123	-DHAVE_SYS_SELECT_H \
124	-DHAVE_SYS_STAT_H \
125	-DHAVE_SYS_TYPES_H \
126	-DHAVE_STDLIB_H \
127	-DHAVE_UNISTD_H \
128	-DHAVE_UTIME_H \
129	-DHAVE_STRDUP \
130	-DHAVE_MMAP \
131	-DHAVE_GETPAGESIZE \
132	-DHAVE_LSEEK64 \
133	-DHAVE_LSEEK64_PROTOTYPE \
134	-DHAVE_EXT2_IOCTLS \
135	-DHAVE_TYPE_SSIZE_T \
136	-DHAVE_INTPTR_T \
137	-DENABLE_HTREE=1 \
138	-DHAVE_SYS_TIME_H \
139        -DHAVE_SYS_PARAM_H \
140	-DHAVE_SYSCONF \
141	-DDISABLE_BACKTRACE=1
142
143include $(CLEAR_VARS)
144
145LOCAL_SRC_FILES := $(e2fsck_src_files)
146LOCAL_C_INCLUDES := $(e2fsck_c_includes)
147LOCAL_CFLAGS := $(e2fsck_cflags)
148LOCAL_SYSTEM_SHARED_LIBRARIES := $(e2fsck_system_shared_libraries)
149LOCAL_SHARED_LIBRARIES := $(e2fsck_shared_libraries)
150LOCAL_MODULE := e2fsck
151LOCAL_MODULE_TAGS := optional
152include $(BUILD_EXECUTABLE)
153
154include $(CLEAR_VARS)
155
156LOCAL_SRC_FILES := $(e2fsck_src_files)
157LOCAL_C_INCLUDES := $(e2fsck_c_includes)
158LOCAL_CFLAGS := $(e2fsck_cflags)
159LOCAL_SHARED_LIBRARIES := $(addsuffix _host, $(e2fsck_shared_libraries))
160LOCAL_MODULE := e2fsck_host
161LOCAL_MODULE_STEM := e2fsck
162LOCAL_MODULE_TAGS := optional
163
164include $(BUILD_HOST_EXECUTABLE)
165