Standardize on a single definition of auth_alg bitfield values
[hostap-gosc2009.git] / wpa_supplicant / Makefile
blob7b4474fc07fd741df91f5235bab9afeb2b91cbc8
1 ifndef CC
2 CC=gcc
3 endif
5 ifndef CFLAGS
6 CFLAGS = -MMD -O2 -Wall -g
7 endif
9 export LIBDIR ?= /usr/local/lib/
10 export BINDIR ?= /usr/local/sbin/
12 CFLAGS += -I../src
13 CFLAGS += -I../src/utils
15 ALL=wpa_supplicant wpa_passphrase wpa_cli
17 all: verify_config $(ALL) dynamic_eap_methods
19 verify_config:
20 @if [ ! -r .config ]; then \
21 echo 'Building wpa_supplicant requires a configuration file'; \
22 echo '(.config). See README for more instructions. You can'; \
23 echo 'run "cp defconfig .config" to create an example'; \
24 echo 'configuration.'; \
25 exit 1; \
28 mkconfig:
29 @if [ -e .config ]; then \
30 echo '.config exists - did not replace it'; \
31 exit 1; \
33 echo CONFIG_DRIVER_HOSTAP=y >> .config
34 echo CONFIG_DRIVER_WEXT=y >> .config
36 install: all
37 mkdir -p $(DESTDIR)$(BINDIR)
38 for i in $(ALL); do cp $$i $(DESTDIR)$(BINDIR)/$$i; done
39 $(MAKE) -C ../src install
41 OBJS = config.o
42 OBJS += notify.o
43 OBJS += bss.o
44 OBJS += eap_register.o
45 OBJS += ../src/utils/common.o
46 OBJS += ../src/utils/wpa_debug.o
47 OBJS += ../src/utils/wpabuf.o
48 OBJS_p = wpa_passphrase.o
49 OBJS_p += ../src/utils/common.o
50 OBJS_p += ../src/utils/wpa_debug.o
51 OBJS_p += ../src/utils/wpabuf.o
52 OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
54 -include .config
56 ifndef CONFIG_OS
57 ifdef CONFIG_NATIVE_WINDOWS
58 CONFIG_OS=win32
59 else
60 CONFIG_OS=unix
61 endif
62 endif
64 ifeq ($(CONFIG_OS), internal)
65 CFLAGS += -DOS_NO_C_LIB_DEFINES
66 endif
68 OBJS += ../src/utils/os_$(CONFIG_OS).o
69 OBJS_p += ../src/utils/os_$(CONFIG_OS).o
70 OBJS_c += ../src/utils/os_$(CONFIG_OS).o
72 ifdef CONFIG_WPA_TRACE
73 CFLAGS += -DWPA_TRACE
74 OBJS += ../src/utils/trace.o
75 OBJS_p += ../src/utils/trace.o
76 OBJS_c += ../src/utils/trace.o
77 OBJS_c += ../src/utils/wpa_debug.o
78 LDFLAGS += -rdynamic
79 CFLAGS += -funwind-tables
80 ifdef CONFIG_WPA_TRACE_BFD
81 CFLAGS += -DWPA_TRACE_BFD
82 LIBS += -lbfd
83 LIBS_p += -lbfd
84 LIBS_c += -lbfd
85 endif
86 endif
88 ifndef CONFIG_ELOOP
89 CONFIG_ELOOP=eloop
90 endif
91 OBJS += ../src/utils/$(CONFIG_ELOOP).o
94 ifdef CONFIG_EAPOL_TEST
95 CFLAGS += -Werror -DEAPOL_TEST
96 endif
98 ifndef CONFIG_BACKEND
99 CONFIG_BACKEND=file
100 endif
102 ifeq ($(CONFIG_BACKEND), file)
103 OBJS += config_file.o
104 ifndef CONFIG_NO_CONFIG_BLOBS
105 NEED_BASE64=y
106 endif
107 CFLAGS += -DCONFIG_BACKEND_FILE
108 endif
110 ifeq ($(CONFIG_BACKEND), winreg)
111 OBJS += config_winreg.o
112 endif
114 ifeq ($(CONFIG_BACKEND), none)
115 OBJS += config_none.o
116 endif
118 ifdef CONFIG_NO_CONFIG_WRITE
119 CFLAGS += -DCONFIG_NO_CONFIG_WRITE
120 endif
122 ifdef CONFIG_NO_CONFIG_BLOBS
123 CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
124 endif
126 ifdef CONFIG_NO_SCAN_PROCESSING
127 CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
128 endif
130 ifdef CONFIG_IEEE80211W
131 CFLAGS += -DCONFIG_IEEE80211W
132 NEED_SHA256=y
133 NEED_AES_OMAC1=y
134 endif
136 ifdef CONFIG_IEEE80211R
137 CFLAGS += -DCONFIG_IEEE80211R
138 OBJS += ../src/rsn_supp/wpa_ft.o
139 NEED_80211_COMMON=y
140 NEED_SHA256=y
141 NEED_AES_OMAC1=y
142 endif
144 ifdef CONFIG_PEERKEY
145 CFLAGS += -DCONFIG_PEERKEY
146 endif
148 ifndef CONFIG_NO_WPA
149 OBJS += ../src/rsn_supp/wpa.o
150 OBJS += ../src/rsn_supp/preauth.o
151 OBJS += ../src/rsn_supp/pmksa_cache.o
152 OBJS += ../src/rsn_supp/peerkey.o
153 OBJS += ../src/rsn_supp/wpa_ie.o
154 OBJS += ../src/common/wpa_common.o
155 NEED_AES=y
156 NEED_SHA1=y
157 NEED_MD5=y
158 NEED_RC4=y
159 else
160 CFLAGS += -DCONFIG_NO_WPA -DCONFIG_NO_WPA2
161 endif
163 ifdef CONFIG_IBSS_RSN
164 NEED_RSN_AUTHENTICATOR=y
165 CFLAGS += -DCONFIG_IBSS_RSN
166 OBJS += ibss_rsn.o
167 endif
169 ifdef CONFIG_NO_WPA2
170 CFLAGS += -DCONFIG_NO_WPA2
171 endif
173 include ../src/drivers/drivers.mak
174 ifdef CONFIG_AP
175 OBJS_d += $(DRV_BOTH_OBJS)
176 CFLAGS += $(DRV_BOTH_CFLAGS)
177 LDFLAGS += $(DRV_BOTH_LDFLAGS)
178 LIBS += $(DRV_BOTH_LIBS)
179 else
180 NEED_AP_MLME=
181 OBJS_d += $(DRV_WPA_OBJS)
182 CFLAGS += $(DRV_WPA_CFLAGS)
183 LDFLAGS += $(DRV_WPA_LDFLAGS)
184 LIBS += $(DRV_WPA_LIBS)
185 endif
187 ifndef CONFIG_L2_PACKET
188 CONFIG_L2_PACKET=linux
189 endif
191 OBJS_l2 += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o
193 ifeq ($(CONFIG_L2_PACKET), pcap)
194 ifdef CONFIG_WINPCAP
195 CFLAGS += -DCONFIG_WINPCAP
196 LIBS += -lwpcap -lpacket
197 LIBS_w += -lwpcap
198 else
199 LIBS += -ldnet -lpcap
200 endif
201 endif
203 ifeq ($(CONFIG_L2_PACKET), winpcap)
204 LIBS += -lwpcap -lpacket
205 LIBS_w += -lwpcap
206 endif
208 ifeq ($(CONFIG_L2_PACKET), freebsd)
209 LIBS += -lpcap
210 endif
212 ifdef CONFIG_EAP_TLS
213 # EAP-TLS
214 ifeq ($(CONFIG_EAP_TLS), dyn)
215 CFLAGS += -DEAP_TLS_DYNAMIC
216 EAPDYN += ../src/eap_peer/eap_tls.so
217 else
218 CFLAGS += -DEAP_TLS
219 OBJS += ../src/eap_peer/eap_tls.o
220 OBJS_h += ../src/eap_server/eap_tls.o
221 endif
222 TLS_FUNCS=y
223 CONFIG_IEEE8021X_EAPOL=y
224 endif
226 ifdef CONFIG_EAP_PEAP
227 # EAP-PEAP
228 ifeq ($(CONFIG_EAP_PEAP), dyn)
229 CFLAGS += -DEAP_PEAP_DYNAMIC
230 EAPDYN += ../src/eap_peer/eap_peap.so
231 else
232 CFLAGS += -DEAP_PEAP
233 OBJS += ../src/eap_peer/eap_peap.o
234 OBJS += ../src/eap_common/eap_peap_common.o
235 OBJS_h += ../src/eap_server/eap_peap.o
236 endif
237 TLS_FUNCS=y
238 CONFIG_IEEE8021X_EAPOL=y
239 endif
241 ifdef CONFIG_EAP_TTLS
242 # EAP-TTLS
243 ifeq ($(CONFIG_EAP_TTLS), dyn)
244 CFLAGS += -DEAP_TTLS_DYNAMIC
245 EAPDYN += ../src/eap_peer/eap_ttls.so
246 else
247 CFLAGS += -DEAP_TTLS
248 OBJS += ../src/eap_peer/eap_ttls.o
249 OBJS_h += ../src/eap_server/eap_ttls.o
250 endif
251 MS_FUNCS=y
252 TLS_FUNCS=y
253 CHAP=y
254 CONFIG_IEEE8021X_EAPOL=y
255 endif
257 ifdef CONFIG_EAP_MD5
258 # EAP-MD5
259 ifeq ($(CONFIG_EAP_MD5), dyn)
260 CFLAGS += -DEAP_MD5_DYNAMIC
261 EAPDYN += ../src/eap_peer/eap_md5.so
262 else
263 CFLAGS += -DEAP_MD5
264 OBJS += ../src/eap_peer/eap_md5.o
265 OBJS_h += ../src/eap_server/eap_md5.o
266 endif
267 CHAP=y
268 CONFIG_IEEE8021X_EAPOL=y
269 endif
271 # backwards compatibility for old spelling
272 ifdef CONFIG_MSCHAPV2
273 ifndef CONFIG_EAP_MSCHAPV2
274 CONFIG_EAP_MSCHAPV2=y
275 endif
276 endif
278 ifdef CONFIG_EAP_MSCHAPV2
279 # EAP-MSCHAPv2
280 ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
281 CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
282 EAPDYN += ../src/eap_peer/eap_mschapv2.so
283 EAPDYN += ../src/eap_peer/mschapv2.so
284 else
285 CFLAGS += -DEAP_MSCHAPv2
286 OBJS += ../src/eap_peer/eap_mschapv2.o
287 OBJS += ../src/eap_peer/mschapv2.o
288 OBJS_h += ../src/eap_server/eap_mschapv2.o
289 endif
290 MS_FUNCS=y
291 CONFIG_IEEE8021X_EAPOL=y
292 endif
294 ifdef CONFIG_EAP_GTC
295 # EAP-GTC
296 ifeq ($(CONFIG_EAP_GTC), dyn)
297 CFLAGS += -DEAP_GTC_DYNAMIC
298 EAPDYN += ../src/eap_peer/eap_gtc.so
299 else
300 CFLAGS += -DEAP_GTC
301 OBJS += ../src/eap_peer/eap_gtc.o
302 OBJS_h += ../src/eap_server/eap_gtc.o
303 endif
304 CONFIG_IEEE8021X_EAPOL=y
305 endif
307 ifdef CONFIG_EAP_OTP
308 # EAP-OTP
309 ifeq ($(CONFIG_EAP_OTP), dyn)
310 CFLAGS += -DEAP_OTP_DYNAMIC
311 EAPDYN += ../src/eap_peer/eap_otp.so
312 else
313 CFLAGS += -DEAP_OTP
314 OBJS += ../src/eap_peer/eap_otp.o
315 endif
316 CONFIG_IEEE8021X_EAPOL=y
317 endif
319 ifdef CONFIG_EAP_SIM
320 # EAP-SIM
321 ifeq ($(CONFIG_EAP_SIM), dyn)
322 CFLAGS += -DEAP_SIM_DYNAMIC
323 EAPDYN += ../src/eap_peer/eap_sim.so
324 else
325 CFLAGS += -DEAP_SIM
326 OBJS += ../src/eap_peer/eap_sim.o
327 OBJS_h += ../src/eap_server/eap_sim.o
328 endif
329 CONFIG_IEEE8021X_EAPOL=y
330 CONFIG_EAP_SIM_COMMON=y
331 NEED_AES_CBC=y
332 endif
334 ifdef CONFIG_EAP_LEAP
335 # EAP-LEAP
336 ifeq ($(CONFIG_EAP_LEAP), dyn)
337 CFLAGS += -DEAP_LEAP_DYNAMIC
338 EAPDYN += ../src/eap_peer/eap_leap.so
339 else
340 CFLAGS += -DEAP_LEAP
341 OBJS += ../src/eap_peer/eap_leap.o
342 endif
343 MS_FUNCS=y
344 CONFIG_IEEE8021X_EAPOL=y
345 endif
347 ifdef CONFIG_EAP_PSK
348 # EAP-PSK
349 ifeq ($(CONFIG_EAP_PSK), dyn)
350 CFLAGS += -DEAP_PSK_DYNAMIC
351 EAPDYN += ../src/eap_peer/eap_psk.so
352 else
353 CFLAGS += -DEAP_PSK
354 OBJS += ../src/eap_peer/eap_psk.o ../src/eap_common/eap_psk_common.o
355 OBJS_h += ../src/eap_server/eap_psk.o
356 endif
357 CONFIG_IEEE8021X_EAPOL=y
358 NEED_AES=y
359 NEED_AES_OMAC1=y
360 NEED_AES_ENCBLOCK=y
361 NEED_AES_EAX=y
362 endif
364 ifdef CONFIG_EAP_AKA
365 # EAP-AKA
366 ifeq ($(CONFIG_EAP_AKA), dyn)
367 CFLAGS += -DEAP_AKA_DYNAMIC
368 EAPDYN += ../src/eap_peer/eap_aka.so
369 else
370 CFLAGS += -DEAP_AKA
371 OBJS += ../src/eap_peer/eap_aka.o
372 OBJS_h += ../src/eap_server/eap_aka.o
373 endif
374 CONFIG_IEEE8021X_EAPOL=y
375 CONFIG_EAP_SIM_COMMON=y
376 NEED_AES_CBC=y
377 endif
379 ifdef CONFIG_EAP_AKA_PRIME
380 # EAP-AKA'
381 ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
382 CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
383 else
384 CFLAGS += -DEAP_AKA_PRIME
385 endif
386 NEED_SHA256=y
387 endif
389 ifdef CONFIG_EAP_SIM_COMMON
390 OBJS += ../src/eap_common/eap_sim_common.o
391 OBJS_h += ../src/eap_server/eap_sim_db.o
392 NEED_AES=y
393 NEED_FIPS186_2_PRF=y
394 endif
396 ifdef CONFIG_EAP_FAST
397 # EAP-FAST
398 ifeq ($(CONFIG_EAP_FAST), dyn)
399 CFLAGS += -DEAP_FAST_DYNAMIC
400 EAPDYN += ../src/eap_peer/eap_fast.so
401 EAPDYN += ../src/eap_common/eap_fast_common.o
402 else
403 CFLAGS += -DEAP_FAST
404 OBJS += ../src/eap_peer/eap_fast.o ../src/eap_peer/eap_fast_pac.o
405 OBJS += ../src/eap_common/eap_fast_common.o
406 OBJS_h += ../src/eap_server/eap_fast.o
407 endif
408 TLS_FUNCS=y
409 CONFIG_IEEE8021X_EAPOL=y
410 NEED_T_PRF=y
411 endif
413 ifdef CONFIG_EAP_PAX
414 # EAP-PAX
415 ifeq ($(CONFIG_EAP_PAX), dyn)
416 CFLAGS += -DEAP_PAX_DYNAMIC
417 EAPDYN += ../src/eap_peer/eap_pax.so
418 else
419 CFLAGS += -DEAP_PAX
420 OBJS += ../src/eap_peer/eap_pax.o ../src/eap_common/eap_pax_common.o
421 OBJS_h += ../src/eap_server/eap_pax.o
422 endif
423 CONFIG_IEEE8021X_EAPOL=y
424 endif
426 ifdef CONFIG_EAP_SAKE
427 # EAP-SAKE
428 ifeq ($(CONFIG_EAP_SAKE), dyn)
429 CFLAGS += -DEAP_SAKE_DYNAMIC
430 EAPDYN += ../src/eap_peer/eap_sake.so
431 else
432 CFLAGS += -DEAP_SAKE
433 OBJS += ../src/eap_peer/eap_sake.o ../src/eap_common/eap_sake_common.o
434 OBJS_h += ../src/eap_server/eap_sake.o
435 endif
436 CONFIG_IEEE8021X_EAPOL=y
437 endif
439 ifdef CONFIG_EAP_GPSK
440 # EAP-GPSK
441 ifeq ($(CONFIG_EAP_GPSK), dyn)
442 CFLAGS += -DEAP_GPSK_DYNAMIC
443 EAPDYN += ../src/eap_peer/eap_gpsk.so
444 else
445 CFLAGS += -DEAP_GPSK
446 OBJS += ../src/eap_peer/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o
447 OBJS_h += ../src/eap_server/eap_gpsk.o
448 endif
449 CONFIG_IEEE8021X_EAPOL=y
450 ifdef CONFIG_EAP_GPSK_SHA256
451 CFLAGS += -DEAP_GPSK_SHA256
452 endif
453 NEED_SHA256=y
454 NEED_AES_OMAC1=y
455 endif
457 ifdef CONFIG_WPS
458 # EAP-WSC
459 CFLAGS += -DCONFIG_WPS -DEAP_WSC
460 OBJS += wps_supplicant.o
461 OBJS += ../src/utils/uuid.o
462 OBJS += ../src/eap_peer/eap_wsc.o ../src/eap_common/eap_wsc_common.o
463 OBJS += ../src/wps/wps.o
464 OBJS += ../src/wps/wps_common.o
465 OBJS += ../src/wps/wps_attr_parse.o
466 OBJS += ../src/wps/wps_attr_build.o
467 OBJS += ../src/wps/wps_attr_process.o
468 OBJS += ../src/wps/wps_dev_attr.o
469 OBJS += ../src/wps/wps_enrollee.o
470 OBJS += ../src/wps/wps_registrar.o
471 OBJS_h += ../src/eap_server/eap_wsc.o
472 CONFIG_IEEE8021X_EAPOL=y
473 NEED_DH_GROUPS=y
474 NEED_SHA256=y
475 NEED_BASE64=y
476 NEED_80211_COMMON=y
477 NEED_AES_CBC=y
478 NEED_MODEXP=y
480 ifdef CONFIG_WPS_UFD
481 CFLAGS += -DCONFIG_WPS_UFD
482 OBJS += ../src/wps/wps_ufd.o
483 NEED_WPS_OOB=y
484 endif
486 ifdef CONFIG_WPS_NFC
487 CFLAGS += -DCONFIG_WPS_NFC
488 OBJS += ../src/wps/ndef.o
489 OBJS += ../src/wps/wps_nfc.o
490 NEED_WPS_OOB=y
491 ifdef CONFIG_WPS_NFC_PN531
492 PN531_PATH ?= /usr/local/src/nfc
493 CFLAGS += -DCONFIG_WPS_NFC_PN531
494 CFLAGS += -I${PN531_PATH}/inc
495 OBJS += ../src/wps/wps_nfc_pn531.o
496 LIBS += ${PN531_PATH}/lib/wpsnfc.dll
497 LIBS += ${PN531_PATH}/lib/libnfc_mapping_pn53x.dll
498 endif
499 endif
501 ifdef NEED_WPS_OOB
502 CFLAGS += -DCONFIG_WPS_OOB
503 endif
505 ifdef CONFIG_WPS_ER
506 CONFIG_WPS_UPNP=y
507 CFLAGS += -DCONFIG_WPS_ER
508 OBJS += ../src/wps/wps_er.o
509 OBJS += ../src/wps/wps_er_ssdp.o
510 endif
512 ifdef CONFIG_WPS_UPNP
513 CFLAGS += -DCONFIG_WPS_UPNP
514 OBJS += ../src/wps/wps_upnp.o
515 OBJS += ../src/wps/wps_upnp_ssdp.o
516 OBJS += ../src/wps/wps_upnp_web.o
517 OBJS += ../src/wps/wps_upnp_event.o
518 OBJS += ../src/wps/wps_upnp_ap.o
519 OBJS += ../src/wps/upnp_xml.o
520 OBJS += ../src/wps/httpread.o
521 OBJS += ../src/wps/http_client.o
522 OBJS += ../src/wps/http_server.o
523 endif
525 endif
527 ifdef CONFIG_EAP_IKEV2
528 # EAP-IKEv2
529 ifeq ($(CONFIG_EAP_IKEV2), dyn)
530 CFLAGS += -DEAP_IKEV2_DYNAMIC
531 EAPDYN += ../src/eap_peer/eap_ikev2.so ../src/eap_peer/ikev2.o
532 EAPDYN += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
533 else
534 CFLAGS += -DEAP_IKEV2
535 OBJS += ../src/eap_peer/eap_ikev2.o ../src/eap_peer/ikev2.o
536 OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
537 OBJS_h += ../src/eap_server/eap_ikev2.o
538 OBJS_h += ../src/eap_server/ikev2.o
539 endif
540 CONFIG_IEEE8021X_EAPOL=y
541 NEED_DH_GROUPS=y
542 NEED_DH_GROUPS_ALL=y
543 NEED_MODEXP=y
544 NEED_CIPHER=y
545 endif
547 ifdef CONFIG_EAP_VENDOR_TEST
548 ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
549 CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
550 EAPDYN += ../src/eap_peer/eap_vendor_test.so
551 else
552 CFLAGS += -DEAP_VENDOR_TEST
553 OBJS += ../src/eap_peer/eap_vendor_test.o
554 OBJS_h += ../src/eap_server/eap_vendor_test.o
555 endif
556 CONFIG_IEEE8021X_EAPOL=y
557 endif
559 ifdef CONFIG_EAP_TNC
560 # EAP-TNC
561 CFLAGS += -DEAP_TNC
562 OBJS += ../src/eap_peer/eap_tnc.o
563 OBJS += ../src/eap_peer/tncc.o
564 OBJS_h += ../src/eap_server/eap_tnc.o
565 OBJS_h += ../src/eap_server/tncs.o
566 NEED_BASE64=y
567 ifndef CONFIG_NATIVE_WINDOWS
568 ifndef CONFIG_DRIVER_BSD
569 LIBS += -ldl
570 endif
571 endif
572 endif
574 ifdef CONFIG_IEEE8021X_EAPOL
575 # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
576 CFLAGS += -DIEEE8021X_EAPOL
577 OBJS += ../src/eapol_supp/eapol_supp_sm.o ../src/eap_peer/eap.o ../src/eap_common/eap_common.o ../src/eap_peer/eap_methods.o
578 ifdef CONFIG_DYNAMIC_EAP_METHODS
579 CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
580 LIBS += -ldl -rdynamic
581 endif
582 endif
584 ifdef CONFIG_AP
585 NEED_RSN_AUTHENTICATOR=y
586 CFLAGS += -DCONFIG_AP
587 OBJS += ap.o
588 CFLAGS += -DCONFIG_NO_RADIUS
589 CFLAGS += -DCONFIG_NO_ACCOUNTING
590 CFLAGS += -DCONFIG_NO_VLAN
591 OBJS += ../src/ap/hostapd.o
592 OBJS += ../src/ap/wpa_auth_glue.o
593 OBJS += ../src/ap/utils.o
594 OBJS += ../src/ap/authsrv.o
595 OBJS += ../src/ap/ap_config.o
596 OBJS += ../src/utils/ip_addr.o
597 OBJS += ../src/ap/sta_info.o
598 OBJS += ../src/ap/tkip_countermeasures.o
599 OBJS += ../src/ap/ap_mlme.o
600 OBJS += ../src/ap/ieee802_1x.o
601 OBJS += ../src/eapol_auth/eapol_auth_sm.o
602 OBJS += ../src/ap/ieee802_11_auth.o
603 OBJS += ../src/ap/drv_callbacks.o
604 OBJS += ../src/ap/ap_drv_ops.o
605 ifdef CONFIG_CTRL_IFACE
606 OBJS += ../src/ap/ctrl_iface_ap.o
607 endif
609 CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
610 OBJS += ../src/eap_server/eap.o
611 OBJS += ../src/eap_server/eap_identity.o
612 OBJS += ../src/eap_server/eap_methods.o
614 ifdef CONFIG_IEEE80211N
615 CFLAGS += -DCONFIG_IEEE80211N
616 endif
618 ifdef NEED_AP_MLME
619 OBJS += ../src/ap/beacon.o
620 OBJS += ../src/ap/wmm.o
621 OBJS += ../src/ap/ap_list.o
622 OBJS += ../src/ap/ieee802_11.o
623 OBJS += ../src/ap/hw_features.o
624 ifdef CONFIG_IEEE80211N
625 OBJS += ../src/ap/ieee802_11_ht.o
626 endif
627 CFLAGS += -DNEED_AP_MLME
628 endif
629 ifdef CONFIG_WPS
630 CFLAGS += -DEAP_SERVER_WSC
631 OBJS += ../src/ap/wps_hostapd.o
632 OBJS += ../src/eap_server/eap_wsc.o
633 endif
634 endif
636 ifdef NEED_RSN_AUTHENTICATOR
637 CFLAGS += -DCONFIG_NO_RADIUS
638 NEED_AES_WRAP=y
639 OBJS += ../src/ap/wpa_auth.o
640 OBJS += ../src/ap/wpa_auth_ie.o
641 OBJS += ../src/ap/pmksa_cache_auth.o
642 ifdef CONFIG_IEEE80211R
643 OBJS += ../src/ap/wpa_auth_ft.o
644 endif
645 ifdef CONFIG_PEERKEY
646 OBJS += ../src/ap/peerkey_auth.o
647 endif
648 endif
650 ifdef CONFIG_EAP_SERVER
651 CFLAGS += -DEAP_SERVER
652 OBJS_h += ../src/eap_server/eap.o
653 OBJS_h += ../src/eap_server/eap_identity.o
654 OBJS_h += ../src/eap_server/eap_methods.o
655 endif
657 ifdef CONFIG_RADIUS_CLIENT
658 OBJS_h += ../src/utils/ip_addr.o
659 OBJS_h += ../src/radius/radius.o
660 OBJS_h += ../src/radius/radius_client.o
661 endif
663 ifdef CONFIG_AUTHENTICATOR
664 OBJS_h += ../src/eapol_auth/eapol_auth_sm.o
665 OBJS_h += ../src/ap/ieee802_1x.o
666 endif
668 ifdef CONFIG_WPA_AUTHENTICATOR
669 OBJS_h += ../src/ap/wpa_auth.o
670 OBJS_h += ../src/ap/wpa_auth_ie.o
671 OBJS_h += ../src/ap/pmksa_cache_auth.o
672 ifdef CONFIG_IEEE80211R
673 OBJS_h += ../src/ap/wpa_auth_ft.o
674 endif
675 ifdef CONFIG_PEERKEY
676 OBJS_h += ../src/ap/peerkey_auth.o
677 endif
678 endif
680 ifdef CONFIG_PCSC
681 # PC/SC interface for smartcards (USIM, GSM SIM)
682 CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
683 OBJS += ../src/utils/pcsc_funcs.o
684 # -lpthread may not be needed depending on how pcsc-lite was configured
685 ifdef CONFIG_NATIVE_WINDOWS
686 #Once MinGW gets support for WinScard, -lwinscard could be used instead of the
687 #dynamic symbol loading that is now used in pcsc_funcs.c
688 #LIBS += -lwinscard
689 else
690 LIBS += -lpcsclite -lpthread
691 endif
692 endif
694 ifdef CONFIG_SIM_SIMULATOR
695 CFLAGS += -DCONFIG_SIM_SIMULATOR
696 NEED_MILENAGE=y
697 endif
699 ifdef CONFIG_USIM_SIMULATOR
700 CFLAGS += -DCONFIG_USIM_SIMULATOR
701 NEED_MILENAGE=y
702 endif
704 ifdef NEED_MILENAGE
705 OBJS += ../src/crypto/milenage.o
706 endif
708 ifdef CONFIG_PKCS12
709 CFLAGS += -DPKCS12_FUNCS
710 endif
712 ifdef CONFIG_SMARTCARD
713 CFLAGS += -DCONFIG_SMARTCARD
714 endif
716 ifdef MS_FUNCS
717 OBJS += ../src/crypto/ms_funcs.o
718 NEED_DES=y
719 NEED_MD4=y
720 endif
722 ifdef CHAP
723 OBJS += ../src/eap_common/chap.o
724 endif
726 ifdef TLS_FUNCS
727 NEED_DES=y
728 # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
729 OBJS += ../src/eap_peer/eap_tls_common.o
730 OBJS_h += ../src/eap_server/eap_tls_common.o
731 NEED_TLS_PRF=y
732 endif
734 ifndef CONFIG_TLS
735 CONFIG_TLS=openssl
736 endif
738 ifeq ($(CONFIG_TLS), openssl)
739 ifdef TLS_FUNCS
740 CFLAGS += -DEAP_TLS_OPENSSL
741 OBJS += ../src/crypto/tls_openssl.o
742 LIBS += -lssl
743 endif
744 OBJS += ../src/crypto/crypto_openssl.o
745 OBJS_p += ../src/crypto/crypto_openssl.o
746 ifdef NEED_FIPS186_2_PRF
747 OBJS += ../src/crypto/fips_prf_openssl.o
748 endif
749 LIBS += -lcrypto
750 LIBS_p += -lcrypto
751 endif
753 ifeq ($(CONFIG_TLS), gnutls)
754 ifdef TLS_FUNCS
755 OBJS += ../src/crypto/tls_gnutls.o
756 LIBS += -lgnutls -lgpg-error
757 ifdef CONFIG_GNUTLS_EXTRA
758 CFLAGS += -DCONFIG_GNUTLS_EXTRA
759 LIBS += -lgnutls-extra
760 endif
761 endif
762 OBJS += ../src/crypto/crypto_gnutls.o
763 OBJS_p += ../src/crypto/crypto_gnutls.o
764 ifdef NEED_FIPS186_2_PRF
765 OBJS += ../src/crypto/fips_prf_gnutls.o
766 endif
767 LIBS += -lgcrypt
768 LIBS_p += -lgcrypt
769 CONFIG_INTERNAL_SHA256=y
770 CONFIG_INTERNAL_RC4=y
771 CONFIG_INTERNAL_DH_GROUP5=y
772 endif
774 ifeq ($(CONFIG_TLS), schannel)
775 ifdef TLS_FUNCS
776 OBJS += ../src/crypto/tls_schannel.o
777 endif
778 OBJS += ../src/crypto/crypto_cryptoapi.o
779 OBJS_p += ../src/crypto/crypto_cryptoapi.o
780 ifdef NEED_FIPS186_2_PRF
781 OBJS += ../src/crypto/fips_prf_cryptoapi.o
782 endif
783 CONFIG_INTERNAL_SHA256=y
784 CONFIG_INTERNAL_RC4=y
785 CONFIG_INTERNAL_DH_GROUP5=y
786 endif
788 ifeq ($(CONFIG_TLS), nss)
789 ifdef TLS_FUNCS
790 OBJS += ../src/crypto/tls_nss.o
791 LIBS += -lssl3
792 endif
793 OBJS += ../src/crypto/crypto_nss.o
794 OBJS_p += ../src/crypto/crypto_nss.o
795 ifdef NEED_FIPS186_2_PRF
796 OBJS += ../src/crypto/fips_prf_nss.o
797 endif
798 LIBS += -lnss3
799 LIBS_p += -lnss3
800 CONFIG_INTERNAL_MD4=y
801 CONFIG_INTERNAL_DH_GROUP5=y
802 endif
804 ifeq ($(CONFIG_TLS), internal)
805 ifndef CONFIG_CRYPTO
806 CONFIG_CRYPTO=internal
807 endif
808 ifdef TLS_FUNCS
809 OBJS += ../src/crypto/crypto_internal-rsa.o
810 OBJS += ../src/crypto/tls_internal.o
811 OBJS += ../src/tls/tlsv1_common.o
812 OBJS += ../src/tls/tlsv1_record.o
813 OBJS += ../src/tls/tlsv1_cred.o
814 OBJS += ../src/tls/tlsv1_client.o
815 OBJS += ../src/tls/tlsv1_client_write.o
816 OBJS += ../src/tls/tlsv1_client_read.o
817 OBJS += ../src/tls/asn1.o
818 OBJS += ../src/tls/rsa.o
819 OBJS += ../src/tls/x509v3.o
820 OBJS += ../src/tls/pkcs1.o
821 OBJS += ../src/tls/pkcs5.o
822 OBJS += ../src/tls/pkcs8.o
823 NEED_SHA256=y
824 NEED_BASE64=y
825 NEED_TLS_PRF=y
826 NEED_MODEXP=y
827 NEED_CIPHER=y
828 CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
829 endif
830 ifdef NEED_CIPHER
831 NEED_DES=y
832 OBJS += ../src/crypto/crypto_internal-cipher.o
833 endif
834 ifdef NEED_MODEXP
835 OBJS += ../src/crypto/crypto_internal-modexp.o
836 OBJS += ../src/tls/bignum.o
837 endif
838 ifeq ($(CONFIG_CRYPTO), libtomcrypt)
839 OBJS += ../src/crypto/crypto_libtomcrypt.o
840 OBJS_p += ../src/crypto/crypto_libtomcrypt.o
841 LIBS += -ltomcrypt -ltfm
842 LIBS_p += -ltomcrypt -ltfm
843 CONFIG_INTERNAL_SHA256=y
844 CONFIG_INTERNAL_RC4=y
845 CONFIG_INTERNAL_DH_GROUP5=y
846 endif
847 ifeq ($(CONFIG_CRYPTO), internal)
848 OBJS += ../src/crypto/crypto_internal.o
849 OBJS_p += ../src/crypto/crypto_internal.o
850 NEED_AES_ENC=y
851 CFLAGS += -DCONFIG_CRYPTO_INTERNAL
852 ifdef CONFIG_INTERNAL_LIBTOMMATH
853 CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
854 ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
855 CFLAGS += -DLTM_FAST
856 endif
857 else
858 LIBS += -ltommath
859 LIBS_p += -ltommath
860 endif
861 CONFIG_INTERNAL_AES=y
862 CONFIG_INTERNAL_DES=y
863 CONFIG_INTERNAL_SHA1=y
864 CONFIG_INTERNAL_MD4=y
865 CONFIG_INTERNAL_MD5=y
866 CONFIG_INTERNAL_SHA256=y
867 CONFIG_INTERNAL_RC4=y
868 CONFIG_INTERNAL_DH_GROUP5=y
869 endif
870 ifeq ($(CONFIG_CRYPTO), cryptoapi)
871 OBJS += ../src/crypto/crypto_cryptoapi.o
872 OBJS_p += ../src/crypto/crypto_cryptoapi.o
873 CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
874 CONFIG_INTERNAL_SHA256=y
875 CONFIG_INTERNAL_RC4=y
876 endif
877 endif
879 ifeq ($(CONFIG_TLS), none)
880 ifdef TLS_FUNCS
881 OBJS += ../src/crypto/tls_none.o
882 CFLAGS += -DEAP_TLS_NONE
883 CONFIG_INTERNAL_AES=y
884 CONFIG_INTERNAL_SHA1=y
885 CONFIG_INTERNAL_MD5=y
886 endif
887 OBJS += ../src/crypto/crypto_none.o
888 OBJS_p += ../src/crypto/crypto_none.o
889 CONFIG_INTERNAL_SHA256=y
890 CONFIG_INTERNAL_RC4=y
891 endif
893 ifdef TLS_FUNCS
894 ifdef CONFIG_SMARTCARD
895 ifndef CONFIG_NATIVE_WINDOWS
896 ifneq ($(CONFIG_L2_PACKET), freebsd)
897 LIBS += -ldl
898 endif
899 endif
900 endif
901 endif
903 ifndef TLS_FUNCS
904 OBJS += ../src/crypto/tls_none.o
905 ifeq ($(CONFIG_TLS), internal)
906 CONFIG_INTERNAL_AES=y
907 CONFIG_INTERNAL_SHA1=y
908 CONFIG_INTERNAL_MD5=y
909 CONFIG_INTERNAL_RC4=y
910 endif
911 endif
913 AESOBJS = # none so far (see below)
914 ifdef CONFIG_INTERNAL_AES
915 AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-dec.o
916 endif
918 AESOBJS += ../src/crypto/aes-unwrap.o
919 ifdef NEED_AES_EAX
920 AESOBJS += ../src/crypto/aes-eax.o
921 NEED_AES_CTR=y
922 endif
923 ifdef NEED_AES_CTR
924 AESOBJS += ../src/crypto/aes-ctr.o
925 endif
926 ifdef NEED_AES_ENCBLOCK
927 AESOBJS += ../src/crypto/aes-encblock.o
928 endif
929 ifdef NEED_AES_OMAC1
930 NEED_AES_ENC=y
931 AESOBJS += ../src/crypto/aes-omac1.o
932 endif
933 ifdef NEED_AES_WRAP
934 NEED_AES_ENC=y
935 AESOBJS += ../src/crypto/aes-wrap.o
936 endif
937 ifdef NEED_AES_CBC
938 NEED_AES_ENC=y
939 AESOBJS += ../src/crypto/aes-cbc.o
940 endif
941 ifdef NEED_AES_ENC
942 ifdef CONFIG_INTERNAL_AES
943 AESOBJS += ../src/crypto/aes-internal-enc.o
944 endif
945 endif
946 ifdef NEED_AES
947 OBJS += $(AESOBJS)
948 endif
950 ifdef NEED_SHA1
951 SHA1OBJS += ../src/crypto/sha1.o
952 ifdef CONFIG_INTERNAL_SHA1
953 SHA1OBJS += ../src/crypto/sha1-internal.o
954 ifdef NEED_FIPS186_2_PRF
955 SHA1OBJS += ../src/crypto/fips_prf_internal.o
956 endif
957 endif
958 ifndef CONFIG_NO_WPA_PASSPHRASE
959 SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
960 endif
961 ifdef NEED_T_PRF
962 SHA1OBJS += ../src/crypto/sha1-tprf.o
963 endif
964 ifdef NEED_TLS_PRF
965 SHA1OBJS += ../src/crypto/sha1-tlsprf.o
966 endif
967 endif
969 MD5OBJS = ../src/crypto/md5.o
970 ifdef NEED_MD5
971 ifdef CONFIG_INTERNAL_MD5
972 MD5OBJS += ../src/crypto/md5-internal.o
973 endif
974 ifdef CONFIG_FIPS
975 MD5OBJS += ../src/crypto/md5-non-fips.o
976 endif
977 OBJS += $(MD5OBJS)
978 OBJS_p += $(MD5OBJS)
979 endif
981 ifdef NEED_MD4
982 ifdef CONFIG_INTERNAL_MD4
983 OBJS += ../src/crypto/md4-internal.o
984 endif
985 endif
987 DESOBJS = # none needed when not internal
988 ifdef NEED_DES
989 ifdef CONFIG_INTERNAL_DES
990 DESOBJS += ../src/crypto/des-internal.o
991 endif
992 endif
994 ifdef NEED_RC4
995 ifdef CONFIG_INTERNAL_RC4
996 OBJS += ../src/crypto/rc4.o
997 endif
998 endif
1000 SHA256OBJS = # none by default
1001 ifdef NEED_SHA256
1002 SHA256OBJS += ../src/crypto/sha256.o
1003 ifdef CONFIG_INTERNAL_SHA256
1004 SHA256OBJS += ../src/crypto/sha256-internal.o
1005 endif
1006 OBJS += $(SHA256OBJS)
1007 endif
1009 ifdef NEED_DH_GROUPS
1010 OBJS += ../src/crypto/dh_groups.o
1011 endif
1012 ifdef NEED_DH_GROUPS_ALL
1013 CFLAGS += -DALL_DH_GROUPS
1014 endif
1015 ifdef CONFIG_INTERNAL_DH_GROUP5
1016 ifdef NEED_DH_GROUPS
1017 OBJS += ../src/crypto/dh_group5.o
1018 endif
1019 endif
1021 ifdef CONFIG_CTRL_IFACE
1022 ifeq ($(CONFIG_CTRL_IFACE), y)
1023 ifdef CONFIG_NATIVE_WINDOWS
1024 CONFIG_CTRL_IFACE=named_pipe
1025 else
1026 CONFIG_CTRL_IFACE=unix
1027 endif
1028 endif
1029 CFLAGS += -DCONFIG_CTRL_IFACE
1030 ifeq ($(CONFIG_CTRL_IFACE), unix)
1031 CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
1032 endif
1033 ifeq ($(CONFIG_CTRL_IFACE), udp)
1034 CFLAGS += -DCONFIG_CTRL_IFACE_UDP
1035 endif
1036 ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
1037 CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
1038 endif
1039 OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o
1040 endif
1042 ifdef CONFIG_CTRL_IFACE_DBUS
1043 DBUS=y
1044 DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
1045 DBUS_OBJS += dbus/dbus_old.o dbus/dbus_old_handlers.o
1046 ifdef CONFIG_WPS
1047 DBUS_OBJS += dbus/dbus_old_handlers_wps.o
1048 endif
1049 DBUS_OBJS += dbus/dbus_dict_helpers.o
1050 ifndef DBUS_LIBS
1051 DBUS_LIBS := $(shell pkg-config --libs dbus-1)
1052 endif
1053 ifndef DBUS_INCLUDE
1054 DBUS_INCLUDE := $(shell pkg-config --cflags dbus-1)
1055 endif
1056 dbus_version=$(subst ., ,$(shell pkg-config --modversion dbus-1))
1057 DBUS_VERSION_MAJOR=$(word 1,$(dbus_version))
1058 DBUS_VERSION_MINOR=$(word 2,$(dbus_version))
1059 ifeq ($(DBUS_VERSION_MAJOR),)
1060 DBUS_VERSION_MAJOR=0
1061 endif
1062 ifeq ($(DBUS_VERSION_MINOR),)
1063 DBUS_VERSION_MINOR=0
1064 endif
1065 DBUS_INCLUDE += -DDBUS_VERSION_MAJOR=$(DBUS_VERSION_MAJOR)
1066 DBUS_INCLUDE += -DDBUS_VERSION_MINOR=$(DBUS_VERSION_MINOR)
1067 DBUS_CFLAGS += $(DBUS_INCLUDE)
1068 endif
1070 ifdef CONFIG_CTRL_IFACE_DBUS_NEW
1071 DBUS=y
1072 DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
1073 DBUS_OBJS ?= dbus/dbus_dict_helpers.o
1074 DBUS_OBJS += dbus/dbus_new_helpers.o
1075 DBUS_OBJS += dbus/dbus_new.o dbus/dbus_new_handlers.o
1076 ifdef CONFIG_WPS
1077 DBUS_OBJS += dbus/dbus_new_handlers_wps.o
1078 endif
1079 ifndef DBUS_LIBS
1080 DBUS_LIBS := $(shell pkg-config --libs dbus-1)
1081 endif
1082 ifndef DBUS_INCLUDE
1083 DBUS_INCLUDE := $(shell pkg-config --cflags dbus-1)
1084 endif
1085 ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
1086 DBUS_OBJS += dbus/dbus_new_introspect.o
1087 DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
1088 endif
1089 DBUS_CFLAGS += $(DBUS_INCLUDE)
1090 endif
1092 ifdef DBUS
1093 DBUS_CFLAGS += -DCONFIG_DBUS
1094 DBUS_OBJS += dbus/dbus_common.o
1095 endif
1097 OBJS += $(DBUS_OBJS)
1098 CFLAGS += $(DBUS_CFLAGS)
1099 LIBS += $(DBUS_LIBS)
1101 ifdef CONFIG_READLINE
1102 CFLAGS += -DCONFIG_READLINE
1103 LIBS_c += -lncurses -lreadline
1104 endif
1106 ifdef CONFIG_NATIVE_WINDOWS
1107 CFLAGS += -DCONFIG_NATIVE_WINDOWS
1108 LIBS += -lws2_32 -lgdi32 -lcrypt32
1109 LIBS_c += -lws2_32
1110 LIBS_p += -lws2_32 -lgdi32
1111 ifeq ($(CONFIG_CRYPTO), cryptoapi)
1112 LIBS_p += -lcrypt32
1113 endif
1114 endif
1116 ifdef CONFIG_NO_STDOUT_DEBUG
1117 CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
1118 ifndef CONFIG_CTRL_IFACE
1119 CFLAGS += -DCONFIG_NO_WPA_MSG
1120 endif
1121 endif
1123 ifdef CONFIG_IPV6
1124 # for eapol_test only
1125 CFLAGS += -DCONFIG_IPV6
1126 endif
1128 ifdef NEED_BASE64
1129 OBJS += ../src/utils/base64.o
1130 endif
1132 ifdef NEED_SME
1133 OBJS += sme.o
1134 CFLAGS += -DCONFIG_SME
1135 endif
1137 ifdef CONFIG_CLIENT_MLME
1138 OBJS += mlme.o
1139 CFLAGS += -DCONFIG_CLIENT_MLME
1140 NEED_80211_COMMON=y
1141 endif
1143 ifdef NEED_80211_COMMON
1144 OBJS += ../src/common/ieee802_11_common.o
1145 endif
1147 ifndef CONFIG_MAIN
1148 CONFIG_MAIN=main
1149 endif
1151 ifdef CONFIG_DEBUG_SYSLOG
1152 CFLAGS += -DCONFIG_DEBUG_SYSLOG
1153 endif
1155 ifdef CONFIG_DEBUG_FILE
1156 CFLAGS += -DCONFIG_DEBUG_FILE
1157 endif
1159 ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
1160 CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
1161 endif
1163 ifdef CONFIG_FIPS
1164 CFLAGS += -DCONFIG_FIPS
1165 endif
1167 OBJS += $(SHA1OBJS) $(DESOBJS)
1169 OBJS_p += $(SHA1OBJS)
1171 ifdef CONFIG_BGSCAN_SIMPLE
1172 CFLAGS += -DCONFIG_BGSCAN_SIMPLE
1173 OBJS += bgscan_simple.o
1174 NEED_BGSCAN=y
1175 endif
1177 ifdef NEED_BGSCAN
1178 CFLAGS += -DCONFIG_BGSCAN
1179 OBJS += bgscan.o
1180 endif
1182 OBJS_wpa_rm := ctrl_iface.o mlme.o ctrl_iface_unix.o
1183 OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.o
1184 ifdef CONFIG_AUTHENTICATOR
1185 OBJS_wpa += tests/link_test.o
1186 endif
1187 OBJS_wpa += $(OBJS_l2)
1188 OBJS += wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o
1189 OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o
1190 OBJS_t += ../src/radius/radius_client.o
1191 OBJS_t += ../src/radius/radius.o
1192 ifndef CONFIG_AP
1193 OBJS_t += ../src/utils/ip_addr.o
1194 endif
1195 OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o
1196 OBJS += $(CONFIG_MAIN).o
1198 ifdef CONFIG_PRIVSEP
1199 OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o
1200 OBJS_priv += $(OBJS_l2)
1201 OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
1202 OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
1203 OBJS_priv += ../src/utils/common.o
1204 OBJS_priv += ../src/utils/wpa_debug.o
1205 OBJS_priv += ../src/utils/wpabuf.o
1206 OBJS_priv += wpa_priv.o
1207 ifdef CONFIG_DRIVER_TEST
1208 OBJS_priv += $(SHA1OBJS)
1209 OBJS_priv += $(MD5OBJS)
1210 ifeq ($(CONFIG_TLS), openssl)
1211 OBJS_priv += ../src/crypto/crypto_openssl.o
1212 endif
1213 ifeq ($(CONFIG_TLS), gnutls)
1214 OBJS_priv += ../src/crypto/crypto_gnutls.o
1215 endif
1216 ifeq ($(CONFIG_TLS), nss)
1217 OBJS_priv += ../src/crypto/crypto_nss.o
1218 endif
1219 ifeq ($(CONFIG_TLS), internal)
1220 ifeq ($(CONFIG_CRYPTO), libtomcrypt)
1221 OBJS_priv += ../src/crypto/crypto_libtomcrypt.o
1222 else
1223 OBJS_priv += ../src/crypto/crypto_internal.o
1224 endif
1225 endif
1226 endif # CONFIG_DRIVER_TEST
1227 OBJS += ../src/l2_packet/l2_packet_privsep.o
1228 OBJS += ../src/drivers/driver_privsep.o
1229 EXTRA_progs += wpa_priv
1230 else
1231 OBJS += $(OBJS_d) ../src/drivers/drivers.o
1232 OBJS += $(OBJS_l2)
1233 endif
1235 ifdef CONFIG_NDIS_EVENTS_INTEGRATED
1236 CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
1237 OBJS += ../src/drivers/ndis_events.o
1238 EXTRALIBS += -loleaut32 -lole32 -luuid
1239 ifdef PLATFORMSDKLIB
1240 EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
1241 else
1242 EXTRALIBS += WbemUuid.Lib
1243 endif
1244 endif
1246 ifndef LDO
1247 LDO=$(CC)
1248 endif
1250 dynamic_eap_methods: $(EAPDYN)
1252 ../src/drivers/build.wpa_supplicant:
1253 @if [ -e ../src/drivers/build.hostapd ]; then \
1254 $(MAKE) -C ../src/drivers clean; \
1256 @touch ../src/drivers/build.wpa_supplicant
1258 BCHECK=../src/drivers/build.wpa_supplicant
1260 wpa_priv: $(BCHECK) $(OBJS_priv)
1261 $(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
1263 wpa_supplicant: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
1264 $(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
1266 eapol_test: .config $(OBJS_t)
1267 $(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
1269 preauth_test: .config $(OBJS_t2)
1270 $(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
1272 wpa_passphrase: $(OBJS_p)
1273 $(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p)
1275 wpa_cli: $(OBJS_c)
1276 $(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
1278 link_test: $(OBJS) $(OBJS_h) tests/link_test.o
1279 $(LDO) $(LDFLAGS) -o link_test $(OBJS) $(OBJS_h) tests/link_test.o $(LIBS)
1281 test_wpa: $(OBJS_wpa) $(OBJS_h)
1282 $(LDO) $(LDFLAGS) -o test_wpa $(OBJS_wpa) $(LIBS)
1284 win_if_list: win_if_list.c
1285 $(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
1287 eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c
1288 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
1289 -Deap_peer_psk_register=eap_peer_method_dynamic_init
1291 eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c
1292 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
1293 -Deap_peer_pax_register=eap_peer_method_dynamic_init
1295 eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c
1296 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
1297 -Deap_peer_sake_register=eap_peer_method_dynamic_init
1299 eap_wsc.so: ../src/eap_peer/eap_wsc.c ../src/eap_common/eap_wsc_common.c ../src/wps/wps.c
1300 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
1301 -Deap_peer_wsc_register=eap_peer_method_dynamic_init
1303 eap_ikev2.so: ../src/eap_peer/eap_ikev2.c ../src/eap_peer/ikev2.c ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.c
1304 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
1305 -Deap_peer_ikev2_register=eap_peer_method_dynamic_init
1307 %.so: %.c
1308 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
1309 -D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
1312 E=echo
1313 ifeq ($(V), 1)
1315 E=true
1316 endif
1318 %.o: %.c
1319 $(Q)$(CC) -c -o $@ $(CFLAGS) $<
1320 @$(E) " CC " $<
1322 wpa_supplicant.exe: wpa_supplicant
1323 mv -f $< $@
1324 wpa_cli.exe: wpa_cli
1325 mv -f $< $@
1326 wpa_passphrase.exe: wpa_passphrase
1327 mv -f $< $@
1328 win_if_list.exe: win_if_list
1329 mv -f $< $@
1330 eapol_test.exe: eapol_test
1331 mv -f $< $@
1333 WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe
1335 windows-bin: $(WINALL)
1336 $(STRIP) $(WINALL)
1338 wpa_gui/Makefile:
1339 qmake -o wpa_gui/Makefile wpa_gui/wpa_gui.pro
1341 wpa_gui: wpa_gui/Makefile
1342 $(MAKE) -C wpa_gui
1344 wpa_gui-qt4/Makefile:
1345 qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro
1347 wpa_gui-qt4: wpa_gui-qt4/Makefile
1348 $(MAKE) -C wpa_gui-qt4
1350 TEST_EAP_SIM_COMMON_OBJS = $(SHA1OBJS) $(MD5OBJS) \
1351 ../src/utils/common.o ../src/utils/os_unix.o \
1352 ../src/utils/wpa_debug.o $(AESOBJS) \
1353 tests/test_eap_sim_common.o
1354 test-eap_sim_common: $(TEST_EAP_SIM_COMMON_OBJS)
1355 $(LDO) $(LDFLAGS) -o $@ $(TEST_EAP_SIM_COMMON_OBJS) $(LIBS)
1356 ./test-eap_sim_common
1357 rm test-eap_sim_common
1359 tests: test-eap_sim_common
1361 clean:
1362 $(MAKE) -C ../src clean
1363 $(MAKE) -C dbus clean
1364 rm -f core *~ *.o *.d eap_*.so $(ALL) $(WINALL) eapol_test preauth_test
1365 rm -f wpa_priv
1367 -include $(OBJS:%.o=%.d)