forked from tux-mind/platform_external_nmap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAndroid.mk
299 lines (258 loc) · 6.08 KB
/
Android.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
LOCAL_PATH := $(call my-dir)
#original path: liblua/liblua.a
include $(CLEAR_VARS)
LOCAL_CFLAGS:= -fno-strict-aliasing -DLUA_USE_POSIX -DLUA_USE_DLOPEN
# fixed flags
LOCAL_CFLAGS+= -ffunction-sections -fdata-sections
LOCAL_SRC_FILES:= \
liblua/lapi.c\
liblua/lcode.c\
liblua/lctype.c\
liblua/ldebug.c\
liblua/ldo.c\
liblua/ldump.c\
liblua/lfunc.c\
liblua/lgc.c\
liblua/llex.c\
liblua/lmem.c\
liblua/lobject.c\
liblua/lopcodes.c\
liblua/lparser.c\
liblua/lstate.c\
liblua/lstring.c\
liblua/ltable.c\
liblua/ltm.c\
liblua/lundump.c\
liblua/lvm.c\
liblua/lzio.c\
liblua/lauxlib.c\
liblua/lbaselib.c\
liblua/lbitlib.c\
liblua/lcorolib.c\
liblua/ldblib.c\
liblua/liolib.c\
liblua/lmathlib.c\
liblua/loslib.c\
liblua/lstrlib.c\
liblua/ltablib.c\
liblua/loadlib.c\
liblua/linit.c
LOCAL_MODULE := liblua
include $(BUILD_STATIC_LIBRARY)
#original path: liblinear/liblinear.a
include $(CLEAR_VARS)
LOCAL_CFLAGS:= -fno-strict-aliasing
# fixed flags
LOCAL_CFLAGS+= -ffunction-sections -fdata-sections
LOCAL_SRC_FILES:= \
liblinear/linear.cpp\
liblinear/tron.cpp\
liblinear/blas/dnrm2.c\
liblinear/blas/daxpy.c\
liblinear/blas/ddot.c\
liblinear/blas/dscal.c
LOCAL_MODULE := liblinear
include $(BUILD_STATIC_LIBRARY)
#original path: libdnet-stripped/src/libdnet.la
include $(CLEAR_VARS)
LOCAL_CFLAGS:= -DHAVE_CONFIG_H
# fixed flags
LOCAL_CFLAGS+= -ffunction-sections -fdata-sections
LOCAL_C_INCLUDES:= \
$(LOCAL_PATH)/libdnet-stripped/src\
$(LOCAL_PATH)/libdnet-stripped/include
LOCAL_SRC_FILES:= \
libdnet-stripped/src/addr-util.c\
libdnet-stripped/src/addr.c\
libdnet-stripped/src/blob.c\
libdnet-stripped/src/ip-util.c\
libdnet-stripped/src/ip6.c\
libdnet-stripped/src/rand.c\
libdnet-stripped/src/memcmp.c\
libdnet-stripped/src/arp-none.c\
libdnet-stripped/src/eth-linux.c\
libdnet-stripped/src/fw-none.c\
libdnet-stripped/src/intf.c\
libdnet-stripped/src/ip.c\
libdnet-stripped/src/route-linux.c\
libdnet-stripped/src/tun-linux.c
LOCAL_MODULE := libdnet
include $(BUILD_STATIC_LIBRARY)
#original path: nbase/libnbase.a
include $(CLEAR_VARS)
LOCAL_CFLAGS:= -DHAVE_CONFIG_H -D_FORTIFY_SOURCE=2
# fixed flags
LOCAL_CFLAGS+= -ffunction-sections -fdata-sections
LOCAL_SRC_FILES:= \
nbase/snprintf.c\
nbase/nbase_str.c\
nbase/nbase_misc.c\
nbase/nbase_memalloc.c\
nbase/nbase_rnd.c\
nbase/nbase_addrset.c
LOCAL_MODULE := libnbase
include $(BUILD_STATIC_LIBRARY)
#original path: nsock/src/libnsock.a
include $(CLEAR_VARS)
LOCAL_CFLAGS:= -DHAVE_CONFIG_H -DNSOCK_VERSION=\"0.02\" -D_FORTIFY_SOURCE=2 \
-DOPENSSL_NO_DEPRECATED
# fixed flags
LOCAL_CFLAGS+= -ffunction-sections -fdata-sections
LOCAL_C_INCLUDES:= \
$(LOCAL_PATH)/nbase\
$(LOCAL_PATH)/nsock/include\
external/openssl/include\
external/libpcap
LOCAL_SRC_FILES:= \
nsock/src/error.c\
nsock/src/filespace.c\
nsock/src/gh_heap.c\
nsock/src/nsock_connect.c\
nsock/src/nsock_core.c\
nsock/src/nsock_iod.c\
nsock/src/nsock_read.c\
nsock/src/nsock_timers.c\
nsock/src/nsock_write.c\
nsock/src/nsock_ssl.c\
nsock/src/nsock_event.c\
nsock/src/nsock_pool.c\
nsock/src/netutils.c\
nsock/src/nsock_pcap.c\
nsock/src/nsock_engines.c\
nsock/src/engine_select.c\
nsock/src/engine_epoll.c\
nsock/src/engine_kqueue.c\
nsock/src/engine_poll.c\
nsock/src/nsock_proxy.c\
nsock/src/nsock_log.c\
nsock/src/proxy_http.c\
nsock/src/proxy_socks4.c
LOCAL_STATIC_LIBRARIES:= \
libnbase\
libpcap
LOCAL_SHARED_LIBRARIES:= \
libssl\
libcrypto
LOCAL_MODULE := libnsock
include $(BUILD_STATIC_LIBRARY)
#original path: libnetutil/libnetutil.a
include $(CLEAR_VARS)
# fixed flags
LOCAL_CFLAGS+= -static -ffunction-sections -fdata-sections
LOCAL_CPPFLAGS:= -DHAVE_CONFIG_H -D_FORTIFY_SOURCE=2 -fno-strict-aliasing
LOCAL_C_INCLUDES:= \
$(LOCAL_PATH)/liblinear\
$(LOCAL_PATH)/liblua\
$(LOCAL_PATH)/libdnet-stripped/include\
$(LOCAL_PATH)/nbase\
$(LOCAL_PATH)/nsock/include\
external/libpcre\
external/libpcap\
external/openssl/include
LOCAL_SRC_FILES:= \
libnetutil/netutil.cc\
libnetutil/PacketElement.cc\
libnetutil/NetworkLayerElement.cc\
libnetutil/TransportLayerElement.cc\
libnetutil/ARPHeader.cc\
libnetutil/EthernetHeader.cc\
libnetutil/ICMPv4Header.cc\
libnetutil/ICMPv6Header.cc\
libnetutil/IPv4Header.cc\
libnetutil/IPv6Header.cc\
libnetutil/TCPHeader.cc\
libnetutil/UDPHeader.cc\
libnetutil/RawData.cc\
libnetutil/HopByHopHeader.cc\
libnetutil/DestOptsHeader.cc\
libnetutil/FragmentHeader.cc\
libnetutil/RoutingHeader.cc\
libnetutil/PacketParser.cc
LOCAL_STATIC_LIBRARIES:= \
libnbase\
libdnet\
libpcre\
libpcap
LOCAL_SHARED_LIBRARIES:= \
libssl\
libcrypto
LOCAL_MODULE := libnetutil
include $(BUILD_STATIC_LIBRARY)
#original path: nmap
include $(CLEAR_VARS)
# fixed flags
LOCAL_CFLAGS+= -ffunction-sections -fdata-sections
LOCAL_CPPFLAGS:= -DHAVE_CONFIG_H -DNMAP_NAME=\"Nmap\" \
-DNMAP_URL=\"http://nmap.org\" \
-DNMAP_PLATFORM=\"arm-unknown-linux-androideabi\" \
-DNMAPDATADIR=\"/opt/android-ndk/platforms/android-18/arch-arm/usr/share/nmap\" \
-D_FORTIFY_SOURCE=2 -fno-strict-aliasing -frtti
LOCAL_LDFLAGS:= -Wl,--gc-sections
LOCAL_C_INCLUDES:= \
$(LOCAL_PATH)/liblinear\
$(LOCAL_PATH)/liblua\
$(LOCAL_PATH)/libdnet-stripped/include\
$(LOCAL_PATH)/nbase\
$(LOCAL_PATH)/nsock/include\
external/libpcre\
external/libpcap\
external/openssl/include
LOCAL_SRC_FILES:= \
charpool.cc\
FingerPrintResults.cc\
FPEngine.cc\
FPModel.cc\
idle_scan.cc\
MACLookup.cc\
main.cc\
nmap_ftp.cc\
nmap_dns.cc\
nmap_error.cc\
nmap.cc\
NmapOps.cc\
NmapOutputTable.cc\
nmap_tty.cc\
osscan2.cc\
osscan.cc\
output.cc\
payload.cc\
portlist.cc\
portreasons.cc\
protocols.cc\
scan_engine.cc\
service_scan.cc\
services.cc\
TargetGroup.cc\
Target.cc\
targets.cc\
tcpip.cc\
timing.cc\
traceroute.cc\
utils.cc\
xml.cc\
nse_main.cc\
nse_utility.cc\
nse_nsock.cc\
nse_dnet.cc\
nse_fs.cc\
nse_nmaplib.cc\
nse_debug.cc\
nse_pcrelib.cc\
nse_binlib.cc\
nse_bit.cc\
nse_openssl.cc\
nse_ssl_cert.cc
LOCAL_STATIC_LIBRARIES:= \
libnbase\
libnsock\
libpcre\
libpcap\
libnetutil\
libdnet\
liblua\
liblinear
LOCAL_SHARED_LIBRARIES:= \
libssl\
libcrypto\
LOCAL_MODULE := nmap
include $(BUILD_EXECUTABLE)