]>
Commit | Line | Data |
---|---|---|
6fc6879b JM |
1 | ifndef CC |
2 | CC=gcc | |
3 | endif | |
4 | ||
5 | ifndef CFLAGS | |
6 | CFLAGS = -MMD -O2 -Wall -g | |
7 | endif | |
8 | ||
9 | # define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to | |
10 | # a file (undefine it, if you want to save in binary size) | |
11 | CFLAGS += -DHOSTAPD_DUMP_STATE | |
12 | ||
13 | CFLAGS += -I../src | |
14 | CFLAGS += -I../src/crypto | |
15 | CFLAGS += -I../src/utils | |
16 | CFLAGS += -I../src/common | |
17 | ||
18 | # Uncomment following line and set the path to your kernel tree include | |
19 | # directory if your C library does not include all header files. | |
20 | # CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include | |
21 | ||
22 | -include .config | |
23 | ||
24 | ifndef CONFIG_OS | |
25 | ifdef CONFIG_NATIVE_WINDOWS | |
26 | CONFIG_OS=win32 | |
27 | else | |
28 | CONFIG_OS=unix | |
29 | endif | |
30 | endif | |
31 | ||
32 | ifeq ($(CONFIG_OS), internal) | |
33 | CFLAGS += -DOS_NO_C_LIB_DEFINES | |
34 | endif | |
35 | ||
36 | ifdef CONFIG_NATIVE_WINDOWS | |
37 | CFLAGS += -DCONFIG_NATIVE_WINDOWS | |
38 | LIBS += -lws2_32 | |
39 | endif | |
40 | ||
41 | OBJS = hostapd.o ieee802_1x.o eapol_sm.o \ | |
42 | ieee802_11.o config.o ieee802_11_auth.o accounting.o \ | |
43 | sta_info.o wpa.o ctrl_iface.o \ | |
44 | drivers.o preauth.o pmksa_cache.o beacon.o \ | |
fb6d3575 | 45 | hw_features.o wme.o ap_list.o \ |
d52e94f9 | 46 | mlme.o vlan_init.o wpa_auth_ie.o |
6fc6879b JM |
47 | |
48 | OBJS += ../src/utils/eloop.o | |
49 | OBJS += ../src/utils/common.o | |
50 | OBJS += ../src/utils/wpa_debug.o | |
51 | OBJS += ../src/utils/wpabuf.o | |
52 | OBJS += ../src/utils/os_$(CONFIG_OS).o | |
53 | OBJS += ../src/utils/ip_addr.o | |
54 | ||
cb7b04c8 | 55 | OBJS += ../src/common/ieee802_11_common.o |
6fc6879b JM |
56 | OBJS += ../src/common/wpa_common.o |
57 | ||
58 | OBJS += ../src/radius/radius.o | |
59 | OBJS += ../src/radius/radius_client.o | |
60 | ||
61 | OBJS += ../src/crypto/md5.o | |
62 | OBJS += ../src/crypto/rc4.o | |
63 | OBJS += ../src/crypto/md4.o | |
64 | OBJS += ../src/crypto/sha1.o | |
65 | OBJS += ../src/crypto/des.o | |
66 | OBJS += ../src/crypto/aes_wrap.o | |
67 | OBJS += ../src/crypto/aes.o | |
68 | ||
69 | HOBJS=../src/hlr_auc_gw/hlr_auc_gw.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).o ../src/hlr_auc_gw/milenage.o ../src/crypto/aes_wrap.o ../src/crypto/aes.o | |
70 | ||
71 | CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX | |
72 | ||
73 | ifdef CONFIG_IAPP | |
74 | CFLAGS += -DCONFIG_IAPP | |
75 | OBJS += iapp.o | |
76 | endif | |
77 | ||
78 | ifdef CONFIG_RSN_PREAUTH | |
79 | CFLAGS += -DCONFIG_RSN_PREAUTH | |
80 | CONFIG_L2_PACKET=y | |
81 | endif | |
82 | ||
83 | ifdef CONFIG_PEERKEY | |
84 | CFLAGS += -DCONFIG_PEERKEY | |
85 | OBJS += peerkey.o | |
86 | endif | |
87 | ||
88 | ifdef CONFIG_IEEE80211W | |
89 | CFLAGS += -DCONFIG_IEEE80211W | |
90 | NEED_SHA256=y | |
91 | endif | |
92 | ||
93 | ifdef CONFIG_IEEE80211R | |
94 | CFLAGS += -DCONFIG_IEEE80211R | |
95 | OBJS += wpa_ft.o | |
96 | NEED_SHA256=y | |
97 | endif | |
98 | ||
de9289c8 JM |
99 | ifdef CONFIG_IEEE80211N |
100 | CFLAGS += -DCONFIG_IEEE80211N | |
101 | endif | |
102 | ||
6fc6879b JM |
103 | ifdef CONFIG_DRIVER_HOSTAP |
104 | CFLAGS += -DCONFIG_DRIVER_HOSTAP | |
105 | OBJS += driver_hostap.o | |
106 | endif | |
107 | ||
108 | ifdef CONFIG_DRIVER_WIRED | |
109 | CFLAGS += -DCONFIG_DRIVER_WIRED | |
110 | OBJS += driver_wired.o | |
111 | endif | |
112 | ||
113 | ifdef CONFIG_DRIVER_MADWIFI | |
114 | CFLAGS += -DCONFIG_DRIVER_MADWIFI | |
115 | OBJS += driver_madwifi.o | |
116 | CONFIG_L2_PACKET=y | |
117 | endif | |
118 | ||
119 | ifdef CONFIG_DRIVER_PRISM54 | |
120 | CFLAGS += -DCONFIG_DRIVER_PRISM54 | |
121 | OBJS += driver_prism54.o | |
122 | endif | |
123 | ||
124 | ifdef CONFIG_DRIVER_NL80211 | |
125 | CFLAGS += -DCONFIG_DRIVER_NL80211 | |
126 | OBJS += driver_nl80211.o radiotap.o | |
127 | LIBS += -lnl | |
128 | endif | |
129 | ||
130 | ifdef CONFIG_DRIVER_BSD | |
131 | CFLAGS += -DCONFIG_DRIVER_BSD | |
132 | OBJS += driver_bsd.o | |
133 | CONFIG_L2_PACKET=y | |
134 | CONFIG_DNET_PCAP=y | |
135 | CONFIG_L2_FREEBSD=y | |
136 | endif | |
137 | ||
138 | ifdef CONFIG_DRIVER_TEST | |
139 | CFLAGS += -DCONFIG_DRIVER_TEST | |
140 | OBJS += driver_test.o | |
141 | endif | |
142 | ||
d64dabee JM |
143 | ifdef CONFIG_DRIVER_NONE |
144 | CFLAGS += -DCONFIG_DRIVER_NONE | |
145 | OBJS += driver_none.o | |
146 | endif | |
147 | ||
6fc6879b JM |
148 | ifdef CONFIG_L2_PACKET |
149 | ifdef CONFIG_DNET_PCAP | |
150 | ifdef CONFIG_L2_FREEBSD | |
151 | LIBS += -lpcap | |
152 | OBJS += ../src/l2_packet/l2_packet_freebsd.o | |
153 | else | |
154 | LIBS += -ldnet -lpcap | |
155 | OBJS += ../src/l2_packet/l2_packet_pcap.o | |
156 | endif | |
157 | else | |
158 | OBJS += ../src/l2_packet/l2_packet_linux.o | |
159 | endif | |
477df071 JM |
160 | else |
161 | OBJS += ../src/l2_packet/l2_packet_none.o | |
6fc6879b JM |
162 | endif |
163 | ||
164 | ||
165 | ifdef CONFIG_EAP_MD5 | |
166 | CFLAGS += -DEAP_MD5 | |
167 | OBJS += ../src/eap_server/eap_md5.o | |
168 | CHAP=y | |
169 | endif | |
170 | ||
171 | ifdef CONFIG_EAP_TLS | |
172 | CFLAGS += -DEAP_TLS | |
173 | OBJS += ../src/eap_server/eap_tls.o | |
174 | TLS_FUNCS=y | |
175 | endif | |
176 | ||
177 | ifdef CONFIG_EAP_PEAP | |
178 | CFLAGS += -DEAP_PEAP | |
179 | OBJS += ../src/eap_server/eap_peap.o | |
2eeaa5c9 | 180 | OBJS += ../src/eap_common/eap_peap_common.o |
6fc6879b | 181 | TLS_FUNCS=y |
6fc6879b JM |
182 | CONFIG_EAP_MSCHAPV2=y |
183 | endif | |
184 | ||
185 | ifdef CONFIG_EAP_TTLS | |
186 | CFLAGS += -DEAP_TTLS | |
187 | OBJS += ../src/eap_server/eap_ttls.o | |
188 | TLS_FUNCS=y | |
189 | CHAP=y | |
190 | endif | |
191 | ||
192 | ifdef CONFIG_EAP_MSCHAPV2 | |
193 | CFLAGS += -DEAP_MSCHAPv2 | |
194 | OBJS += ../src/eap_server/eap_mschapv2.o | |
195 | MS_FUNCS=y | |
196 | endif | |
197 | ||
198 | ifdef CONFIG_EAP_GTC | |
199 | CFLAGS += -DEAP_GTC | |
200 | OBJS += ../src/eap_server/eap_gtc.o | |
201 | endif | |
202 | ||
203 | ifdef CONFIG_EAP_SIM | |
204 | CFLAGS += -DEAP_SIM | |
205 | OBJS += ../src/eap_server/eap_sim.o | |
206 | CONFIG_EAP_SIM_COMMON=y | |
207 | endif | |
208 | ||
209 | ifdef CONFIG_EAP_AKA | |
210 | CFLAGS += -DEAP_AKA | |
211 | OBJS += ../src/eap_server/eap_aka.o | |
212 | CONFIG_EAP_SIM_COMMON=y | |
213 | endif | |
214 | ||
8c37556c JM |
215 | ifdef CONFIG_EAP_AKA_PRIME |
216 | CFLAGS += -DEAP_AKA_PRIME | |
8c37556c JM |
217 | endif |
218 | ||
6fc6879b JM |
219 | ifdef CONFIG_EAP_SIM_COMMON |
220 | OBJS += ../src/eap_common/eap_sim_common.o | |
221 | # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be | |
222 | # replaced with another file implementating the interface specified in | |
223 | # eap_sim_db.h. | |
224 | OBJS += ../src/eap_server/eap_sim_db.o | |
225 | NEED_FIPS186_2_PRF=y | |
226 | endif | |
227 | ||
228 | ifdef CONFIG_EAP_PAX | |
229 | CFLAGS += -DEAP_PAX | |
230 | OBJS += ../src/eap_server/eap_pax.o ../src/eap_common/eap_pax_common.o | |
231 | endif | |
232 | ||
233 | ifdef CONFIG_EAP_PSK | |
234 | CFLAGS += -DEAP_PSK | |
235 | OBJS += ../src/eap_server/eap_psk.o ../src/eap_common/eap_psk_common.o | |
236 | endif | |
237 | ||
238 | ifdef CONFIG_EAP_SAKE | |
239 | CFLAGS += -DEAP_SAKE | |
240 | OBJS += ../src/eap_server/eap_sake.o ../src/eap_common/eap_sake_common.o | |
241 | endif | |
242 | ||
243 | ifdef CONFIG_EAP_GPSK | |
244 | CFLAGS += -DEAP_GPSK | |
245 | OBJS += ../src/eap_server/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o | |
246 | ifdef CONFIG_EAP_GPSK_SHA256 | |
247 | CFLAGS += -DEAP_GPSK_SHA256 | |
248 | endif | |
249 | NEED_SHA256=y | |
250 | endif | |
251 | ||
252 | ifdef CONFIG_EAP_VENDOR_TEST | |
253 | CFLAGS += -DEAP_VENDOR_TEST | |
254 | OBJS += ../src/eap_server/eap_vendor_test.o | |
255 | endif | |
256 | ||
6fc6879b JM |
257 | ifdef CONFIG_EAP_FAST |
258 | CFLAGS += -DEAP_FAST | |
259 | OBJS += ../src/eap_server/eap_fast.o | |
a4819630 | 260 | OBJS += ../src/eap_common/eap_fast_common.o |
6fc6879b JM |
261 | TLS_FUNCS=y |
262 | NEED_T_PRF=y | |
263 | endif | |
264 | ||
ad08c363 JM |
265 | ifdef CONFIG_WPS |
266 | CFLAGS += -DCONFIG_WPS -DEAP_WSC | |
267 | OBJS += ../src/utils/uuid.o | |
268 | OBJS += wps_hostapd.o | |
269 | OBJS += ../src/eap_server/eap_wsc.o ../src/eap_common/eap_wsc_common.o | |
270 | OBJS += ../src/wps/wps.o | |
271 | OBJS += ../src/wps/wps_common.o | |
7d7b8e96 JM |
272 | OBJS += ../src/wps/wps_attr_parse.o |
273 | OBJS += ../src/wps/wps_attr_build.o | |
274 | OBJS += ../src/wps/wps_attr_process.o | |
ad08c363 JM |
275 | OBJS += ../src/wps/wps_dev_attr.o |
276 | OBJS += ../src/wps/wps_enrollee.o | |
277 | OBJS += ../src/wps/wps_registrar.o | |
278 | NEED_DH_GROUPS=y | |
279 | NEED_SHA256=y | |
280 | NEED_CRYPTO=y | |
281 | endif | |
282 | ||
6fc6879b JM |
283 | ifdef CONFIG_EAP_IKEV2 |
284 | CFLAGS += -DEAP_IKEV2 | |
285 | OBJS += ../src/eap_server/eap_ikev2.o ../src/eap_server/ikev2.o | |
286 | OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o | |
287 | NEED_DH_GROUPS=y | |
288 | endif | |
289 | ||
da08a7c7 JM |
290 | ifdef CONFIG_EAP_TNC |
291 | CFLAGS += -DEAP_TNC | |
292 | OBJS += ../src/eap_server/eap_tnc.o | |
293 | OBJS += ../src/eap_server/tncs.o | |
294 | NEED_BASE64=y | |
295 | endif | |
296 | ||
6fc6879b JM |
297 | # Basic EAP functionality is needed for EAPOL |
298 | OBJS += ../src/eap_server/eap.o | |
299 | OBJS += ../src/eap_common/eap_common.o | |
300 | OBJS += ../src/eap_server/eap_methods.o | |
301 | OBJS += ../src/eap_server/eap_identity.o | |
302 | ||
303 | ifdef CONFIG_EAP | |
304 | CFLAGS += -DEAP_SERVER | |
305 | endif | |
306 | ||
307 | ifndef CONFIG_TLS | |
308 | CONFIG_TLS=openssl | |
309 | endif | |
310 | ||
311 | ifeq ($(CONFIG_TLS), internal) | |
312 | ifndef CONFIG_CRYPTO | |
313 | CONFIG_CRYPTO=internal | |
314 | endif | |
315 | endif | |
316 | ifeq ($(CONFIG_CRYPTO), libtomcrypt) | |
317 | CFLAGS += -DCONFIG_INTERNAL_X509 | |
318 | endif | |
319 | ifeq ($(CONFIG_CRYPTO), internal) | |
320 | CFLAGS += -DCONFIG_INTERNAL_X509 | |
321 | endif | |
322 | ||
323 | ||
324 | ifdef TLS_FUNCS | |
325 | # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS) | |
326 | CFLAGS += -DEAP_TLS_FUNCS | |
327 | OBJS += ../src/eap_server/eap_tls_common.o | |
328 | ifeq ($(CONFIG_TLS), openssl) | |
329 | OBJS += ../src/crypto/tls_openssl.o | |
330 | LIBS += -lssl -lcrypto | |
331 | LIBS_p += -lcrypto | |
332 | LIBS_h += -lcrypto | |
333 | endif | |
334 | ifeq ($(CONFIG_TLS), gnutls) | |
335 | OBJS += ../src/crypto/tls_gnutls.o | |
336 | LIBS += -lgnutls -lgcrypt -lgpg-error | |
337 | LIBS_p += -lgcrypt | |
338 | LIBS_h += -lgcrypt | |
339 | endif | |
340 | ifdef CONFIG_GNUTLS_EXTRA | |
341 | CFLAGS += -DCONFIG_GNUTLS_EXTRA | |
342 | LIBS += -lgnutls-extra | |
343 | endif | |
344 | ifeq ($(CONFIG_TLS), internal) | |
345 | OBJS += ../src/crypto/tls_internal.o | |
346 | OBJS += ../src/tls/tlsv1_common.o ../src/tls/tlsv1_record.o | |
347 | OBJS += ../src/tls/tlsv1_cred.o ../src/tls/tlsv1_server.o | |
348 | OBJS += ../src/tls/tlsv1_server_write.o ../src/tls/tlsv1_server_read.o | |
349 | OBJS += ../src/tls/asn1.o ../src/tls/x509v3.o | |
350 | OBJS_p += ../src/tls/asn1.o | |
351 | OBJS_p += ../src/crypto/rc4.o ../src/crypto/aes_wrap.o ../src/crypto/aes.o | |
352 | NEED_BASE64=y | |
353 | CFLAGS += -DCONFIG_TLS_INTERNAL | |
354 | CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER | |
355 | ifeq ($(CONFIG_CRYPTO), internal) | |
356 | ifdef CONFIG_INTERNAL_LIBTOMMATH | |
357 | CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH | |
358 | else | |
359 | LIBS += -ltommath | |
360 | LIBS_p += -ltommath | |
361 | endif | |
362 | endif | |
363 | ifeq ($(CONFIG_CRYPTO), libtomcrypt) | |
364 | LIBS += -ltomcrypt -ltfm | |
365 | LIBS_p += -ltomcrypt -ltfm | |
366 | endif | |
367 | endif | |
368 | NEED_CRYPTO=y | |
369 | else | |
370 | OBJS += ../src/crypto/tls_none.o | |
371 | endif | |
372 | ||
373 | ifdef CONFIG_PKCS12 | |
374 | CFLAGS += -DPKCS12_FUNCS | |
375 | endif | |
376 | ||
377 | ifdef MS_FUNCS | |
378 | OBJS += ../src/crypto/ms_funcs.o | |
379 | NEED_CRYPTO=y | |
380 | endif | |
381 | ||
382 | ifdef CHAP | |
383 | OBJS += ../src/eap_common/chap.o | |
384 | endif | |
385 | ||
386 | ifdef NEED_CRYPTO | |
387 | ifndef TLS_FUNCS | |
388 | ifeq ($(CONFIG_TLS), openssl) | |
389 | LIBS += -lcrypto | |
390 | LIBS_p += -lcrypto | |
391 | LIBS_h += -lcrypto | |
392 | endif | |
393 | ifeq ($(CONFIG_TLS), gnutls) | |
394 | LIBS += -lgcrypt | |
395 | LIBS_p += -lgcrypt | |
396 | LIBS_h += -lgcrypt | |
397 | endif | |
398 | ifeq ($(CONFIG_TLS), internal) | |
399 | ifeq ($(CONFIG_CRYPTO), libtomcrypt) | |
400 | LIBS += -ltomcrypt -ltfm | |
401 | LIBS_p += -ltomcrypt -ltfm | |
402 | endif | |
403 | endif | |
404 | endif | |
405 | ifeq ($(CONFIG_TLS), openssl) | |
406 | OBJS += ../src/crypto/crypto_openssl.o | |
407 | OBJS_p += ../src/crypto/crypto_openssl.o | |
408 | HOBJS += ../src/crypto/crypto_openssl.o | |
409 | CONFIG_INTERNAL_SHA256=y | |
410 | endif | |
411 | ifeq ($(CONFIG_TLS), gnutls) | |
412 | OBJS += ../src/crypto/crypto_gnutls.o | |
413 | OBJS_p += ../src/crypto/crypto_gnutls.o | |
414 | HOBJS += ../src/crypto/crypto_gnutls.o | |
415 | CONFIG_INTERNAL_SHA256=y | |
416 | endif | |
417 | ifeq ($(CONFIG_TLS), internal) | |
418 | ifeq ($(CONFIG_CRYPTO), libtomcrypt) | |
419 | OBJS += ../src/crypto/crypto_libtomcrypt.o | |
420 | OBJS_p += ../src/crypto/crypto_libtomcrypt.o | |
421 | CONFIG_INTERNAL_SHA256=y | |
422 | endif | |
423 | ifeq ($(CONFIG_CRYPTO), internal) | |
424 | OBJS += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o | |
425 | OBJS_p += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o | |
426 | CFLAGS += -DCONFIG_CRYPTO_INTERNAL | |
427 | CONFIG_INTERNAL_AES=y | |
428 | CONFIG_INTERNAL_DES=y | |
429 | CONFIG_INTERNAL_SHA1=y | |
430 | CONFIG_INTERNAL_MD4=y | |
431 | CONFIG_INTERNAL_MD5=y | |
432 | CONFIG_INTERNAL_SHA256=y | |
433 | endif | |
434 | endif | |
435 | else | |
436 | CONFIG_INTERNAL_AES=y | |
437 | CONFIG_INTERNAL_SHA1=y | |
438 | CONFIG_INTERNAL_MD5=y | |
439 | CONFIG_INTERNAL_SHA256=y | |
440 | endif | |
441 | ||
442 | ifdef CONFIG_INTERNAL_AES | |
443 | CFLAGS += -DINTERNAL_AES | |
444 | endif | |
445 | ifdef CONFIG_INTERNAL_SHA1 | |
446 | CFLAGS += -DINTERNAL_SHA1 | |
447 | endif | |
448 | ifdef CONFIG_INTERNAL_SHA256 | |
449 | CFLAGS += -DINTERNAL_SHA256 | |
450 | endif | |
451 | ifdef CONFIG_INTERNAL_MD5 | |
452 | CFLAGS += -DINTERNAL_MD5 | |
453 | endif | |
454 | ifdef CONFIG_INTERNAL_MD4 | |
455 | CFLAGS += -DINTERNAL_MD4 | |
456 | endif | |
457 | ifdef CONFIG_INTERNAL_DES | |
458 | CFLAGS += -DINTERNAL_DES | |
459 | endif | |
460 | ||
461 | ifdef NEED_SHA256 | |
462 | OBJS += ../src/crypto/sha256.o | |
463 | endif | |
464 | ||
465 | ifdef NEED_DH_GROUPS | |
466 | OBJS += ../src/crypto/dh_groups.o | |
467 | endif | |
468 | ||
469 | ifndef NEED_FIPS186_2_PRF | |
470 | CFLAGS += -DCONFIG_NO_FIPS186_2_PRF | |
471 | endif | |
472 | ||
473 | ifndef NEED_T_PRF | |
474 | CFLAGS += -DCONFIG_NO_T_PRF | |
475 | endif | |
476 | ||
477 | ifdef CONFIG_RADIUS_SERVER | |
478 | CFLAGS += -DRADIUS_SERVER | |
479 | OBJS += ../src/radius/radius_server.o | |
480 | endif | |
481 | ||
482 | ifdef CONFIG_IPV6 | |
483 | CFLAGS += -DCONFIG_IPV6 | |
484 | endif | |
485 | ||
6affdaee CZ |
486 | ifdef CONFIG_DRIVER_RADIUS_ACL |
487 | CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL | |
488 | endif | |
489 | ||
6fc6879b JM |
490 | ifdef CONFIG_FULL_DYNAMIC_VLAN |
491 | # define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges | |
492 | # and vlan interfaces for the vlan feature. | |
493 | CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN | |
494 | endif | |
495 | ||
496 | ifdef NEED_BASE64 | |
497 | OBJS += ../src/utils/base64.o | |
498 | endif | |
499 | ||
500 | ALL=hostapd hostapd_cli | |
501 | ||
502 | all: verify_config $(ALL) | |
503 | ||
504 | verify_config: | |
505 | @if [ ! -r .config ]; then \ | |
506 | echo 'Building hostapd requires a configuration file'; \ | |
507 | echo '(.config). See README for more instructions. You can'; \ | |
508 | echo 'run "cp defconfig .config" to create an example'; \ | |
509 | echo 'configuration.'; \ | |
510 | exit 1; \ | |
511 | fi | |
512 | ||
513 | install: all | |
514 | for i in $(ALL); do cp $$i /usr/local/bin/$$i; done | |
515 | ||
516 | hostapd: $(OBJS) | |
517 | $(CC) -o hostapd $(OBJS) $(LIBS) | |
518 | ||
519 | OBJS_c = hostapd_cli.o ../src/common/wpa_ctrl.o ../src/utils/os_$(CONFIG_OS).o | |
520 | hostapd_cli: $(OBJS_c) | |
521 | $(CC) -o hostapd_cli $(OBJS_c) | |
522 | ||
523 | NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o ../src/crypto/sha1.o ../src/crypto/rc4.o ../src/crypto/md5.o | |
524 | NOBJS += ../src/crypto/crypto_openssl.o ../src/utils/os_$(CONFIG_OS).o | |
525 | ifdef TLS_FUNCS | |
526 | LIBS_n += -lcrypto | |
527 | endif | |
528 | ||
529 | nt_password_hash: $(NOBJS) | |
530 | $(CC) -o nt_password_hash $(NOBJS) $(LIBS_n) | |
531 | ||
532 | hlr_auc_gw: $(HOBJS) | |
533 | $(CC) -o hlr_auc_gw $(HOBJS) $(LIBS_h) | |
534 | ||
535 | clean: | |
536 | $(MAKE) -C ../src clean | |
537 | rm -f core *~ *.o hostapd hostapd_cli nt_password_hash hlr_auc_gw | |
538 | rm -f *.d | |
539 | ||
540 | %.eps: %.fig | |
541 | fig2dev -L eps $*.fig $*.eps | |
542 | ||
543 | %.png: %.fig | |
544 | fig2dev -L png -m 3 $*.fig | pngtopnm | pnmscale 0.4 | pnmtopng \ | |
545 | > $*.png | |
546 | ||
547 | docs-pics: doc/hostapd.png doc/hostapd.eps | |
548 | ||
549 | docs: docs-pics | |
550 | doxygen doc/doxygen.full | |
551 | $(MAKE) -C doc/latex | |
552 | cp doc/latex/refman.pdf hostapd-devel.pdf | |
553 | ||
554 | docs-fast: docs-pics | |
555 | doxygen doc/doxygen.fast | |
556 | ||
557 | clean-docs: | |
558 | rm -rf doc/latex doc/html | |
559 | rm -f doc/hosta.d{eps,png} hostapd-devel.pdf | |
560 | ||
561 | TEST_SRC_MILENAGE = ../src/hlr_auc_gw/milenage.c ../src/crypto/aes_wrap.c ../src/crypto/aes.c ../src/utils/common.c ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).c | |
562 | test-milenage: $(TEST_SRC_MILENAGE) | |
563 | $(CC) -o test-milenage -Wall -Werror $(TEST_SRC_MILENAGE) \ | |
564 | -DTEST_MAIN_MILENAGE -I. -DINTERNAL_AES \ | |
565 | -I../src/crypto -I../src/utils | |
566 | ./test-milenage | |
567 | rm test-milenage | |
568 | ||
569 | hostapd-sparse: $(OBJS) | |
570 | @echo Sparse run completed | |
571 | ||
572 | run-sparse: | |
573 | CC="sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -D__INT_MAX__=2147483647 -D__SHRT_MAX__=32767 -D__LONG_MAX__=2147483647 -D__SCHAR_MAX__=127 -Wbitwise" $(MAKE) hostapd-sparse | |
574 | ||
575 | -include $(OBJS:%.o=%.d) |