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