• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1ifndef CC
2CC=gcc
3endif
4
5ifndef CFLAGS
6CFLAGS = -MMD -O2 -Wall -g
7endif
8
9ifdef LIBS
10# If LIBS is set with some global build system defaults, clone those for
11# LIBS_c and LIBS_p to cover wpa_passphrase and wpa_cli as well.
12ifndef LIBS_c
13LIBS_c := $(LIBS)
14endif
15ifndef LIBS_p
16LIBS_p := $(LIBS)
17endif
18endif
19
20export LIBDIR ?= /usr/local/lib/
21export INCDIR ?= /usr/local/include/
22export BINDIR ?= /usr/local/sbin/
23PKG_CONFIG ?= pkg-config
24
25CFLAGS += $(EXTRA_CFLAGS)
26CFLAGS += -I$(abspath ../src)
27CFLAGS += -I$(abspath ../src/utils)
28
29-include .config
30
31ifndef CONFIG_NO_GITVER
32# Add VERSION_STR postfix for builds from a git repository
33ifeq ($(wildcard ../.git),../.git)
34GITVER := $(shell git describe --dirty=+)
35ifneq ($(GITVER),)
36CFLAGS += -DGIT_VERSION_STR_POSTFIX=\"-$(GITVER)\"
37endif
38endif
39endif
40
41ifdef CONFIG_TESTING_OPTIONS
42CFLAGS += -DCONFIG_TESTING_OPTIONS
43CONFIG_WPS_TESTING=y
44CONFIG_TDLS_TESTING=y
45endif
46
47BINALL=wpa_supplicant wpa_cli
48
49ifndef CONFIG_NO_WPA_PASSPHRASE
50BINALL += wpa_passphrase
51endif
52
53ALL = $(BINALL)
54ALL += systemd/wpa_supplicant.service
55ALL += systemd/wpa_supplicant@.service
56ALL += systemd/wpa_supplicant-nl80211@.service
57ALL += systemd/wpa_supplicant-wired@.service
58ALL += dbus/fi.w1.wpa_supplicant1.service
59ifdef CONFIG_BUILD_WPA_CLIENT_SO
60ALL += libwpa_client.so
61endif
62
63
64all: verify_config $(ALL) dynamic_eap_methods
65
66verify_config:
67	@if [ ! -r .config ]; then \
68		echo 'Building wpa_supplicant requires a configuration file'; \
69		echo '(.config). See README for more instructions. You can'; \
70		echo 'run "cp defconfig .config" to create an example'; \
71		echo 'configuration.'; \
72		exit 1; \
73	fi
74
75mkconfig:
76	@if [ -f .config ]; then \
77		echo '.config exists - did not replace it'; \
78		exit 1; \
79	fi
80	echo CONFIG_DRIVER_HOSTAP=y >> .config
81	echo CONFIG_DRIVER_WEXT=y >> .config
82
83$(DESTDIR)$(BINDIR)/%: %
84	install -D $(<) $(@)
85
86install: $(addprefix $(DESTDIR)$(BINDIR)/,$(BINALL))
87	$(MAKE) -C ../src install
88ifdef CONFIG_BUILD_WPA_CLIENT_SO
89	install -m 0644 -D libwpa_client.so $(DESTDIR)/$(LIBDIR)/libwpa_client.so
90	install -m 0644 -D ../src/common/wpa_ctrl.h $(DESTDIR)/$(INCDIR)/wpa_ctrl.h
91endif
92
93ifdef CONFIG_FIPS
94CONFIG_NO_RANDOM_POOL=
95CONFIG_OPENSSL_CMAC=y
96endif
97
98OBJS = config.o
99OBJS += notify.o
100OBJS += bss.o
101OBJS += eap_register.o
102OBJS += ../src/utils/common.o
103OBJS += ../src/utils/wpa_debug.o
104OBJS += ../src/utils/wpabuf.o
105OBJS += ../src/utils/bitfield.o
106OBJS += op_classes.o
107OBJS += rrm.o
108OBJS_p = wpa_passphrase.o
109OBJS_p += ../src/utils/common.o
110OBJS_p += ../src/utils/wpa_debug.o
111OBJS_p += ../src/utils/wpabuf.o
112OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
113OBJS_c += ../src/utils/wpa_debug.o
114OBJS_c += ../src/utils/common.o
115OBJS_c += ../src/common/cli.o
116OBJS += wmm_ac.o
117
118ifndef CONFIG_OS
119ifdef CONFIG_NATIVE_WINDOWS
120CONFIG_OS=win32
121else
122CONFIG_OS=unix
123endif
124endif
125
126ifeq ($(CONFIG_OS), internal)
127CFLAGS += -DOS_NO_C_LIB_DEFINES
128endif
129
130OBJS += ../src/utils/os_$(CONFIG_OS).o
131OBJS_p += ../src/utils/os_$(CONFIG_OS).o
132OBJS_c += ../src/utils/os_$(CONFIG_OS).o
133
134ifdef CONFIG_WPA_TRACE
135CFLAGS += -DWPA_TRACE
136OBJS += ../src/utils/trace.o
137OBJS_p += ../src/utils/trace.o
138OBJS_c += ../src/utils/trace.o
139OBJS_priv += ../src/utils/trace.o
140LIBCTRL += ../src/utils/trace.o
141LIBCTRLSO += ../src/utils/trace.c
142LDFLAGS += -rdynamic
143CFLAGS += -funwind-tables
144ifdef CONFIG_WPA_TRACE_BFD
145CFLAGS += -DPACKAGE="wpa_supplicant" -DWPA_TRACE_BFD
146LIBS += -lbfd -ldl -liberty -lz
147LIBS_p += -lbfd -ldl -liberty -lz
148LIBS_c += -lbfd -ldl -liberty -lz
149endif
150endif
151
152ifndef CONFIG_ELOOP
153CONFIG_ELOOP=eloop
154endif
155OBJS += ../src/utils/$(CONFIG_ELOOP).o
156OBJS_c += ../src/utils/$(CONFIG_ELOOP).o
157
158ifndef CONFIG_OSX
159ifeq ($(CONFIG_ELOOP), eloop)
160# Using glibc < 2.17 requires -lrt for clock_gettime()
161# OS X has an alternate implementation
162LIBS += -lrt
163LIBS_c += -lrt
164LIBS_p += -lrt
165endif
166endif
167
168ifdef CONFIG_ELOOP_POLL
169CFLAGS += -DCONFIG_ELOOP_POLL
170endif
171
172ifdef CONFIG_ELOOP_EPOLL
173CFLAGS += -DCONFIG_ELOOP_EPOLL
174endif
175
176ifdef CONFIG_ELOOP_KQUEUE
177CFLAGS += -DCONFIG_ELOOP_KQUEUE
178endif
179
180ifdef CONFIG_EAPOL_TEST
181CFLAGS += -Werror -DEAPOL_TEST
182endif
183
184ifdef CONFIG_CODE_COVERAGE
185CFLAGS += -O0 -fprofile-arcs -ftest-coverage
186LIBS += -lgcov
187LIBS_c += -lgcov
188LIBS_p += -lgcov
189endif
190
191ifdef CONFIG_HT_OVERRIDES
192CFLAGS += -DCONFIG_HT_OVERRIDES
193endif
194
195ifdef CONFIG_VHT_OVERRIDES
196CFLAGS += -DCONFIG_VHT_OVERRIDES
197endif
198
199ifndef CONFIG_BACKEND
200CONFIG_BACKEND=file
201endif
202
203ifeq ($(CONFIG_BACKEND), file)
204OBJS += config_file.o
205ifndef CONFIG_NO_CONFIG_BLOBS
206NEED_BASE64=y
207endif
208CFLAGS += -DCONFIG_BACKEND_FILE
209endif
210
211ifeq ($(CONFIG_BACKEND), winreg)
212OBJS += config_winreg.o
213endif
214
215ifeq ($(CONFIG_BACKEND), none)
216OBJS += config_none.o
217endif
218
219ifdef CONFIG_NO_CONFIG_WRITE
220CFLAGS += -DCONFIG_NO_CONFIG_WRITE
221endif
222
223ifdef CONFIG_NO_CONFIG_BLOBS
224CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
225endif
226
227ifdef CONFIG_NO_SCAN_PROCESSING
228CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
229endif
230
231ifdef CONFIG_SUITEB
232CFLAGS += -DCONFIG_SUITEB
233NEED_SHA256=y
234NEED_AES_OMAC1=y
235endif
236
237ifdef CONFIG_SUITEB192
238CFLAGS += -DCONFIG_SUITEB192
239NEED_SHA384=y
240endif
241
242ifdef CONFIG_OCV
243CFLAGS += -DCONFIG_OCV
244OBJS += ../src/common/ocv.o
245CONFIG_IEEE80211W=y
246endif
247
248ifdef CONFIG_IEEE80211W
249CFLAGS += -DCONFIG_IEEE80211W
250NEED_SHA256=y
251NEED_AES_OMAC1=y
252endif
253
254ifdef CONFIG_IEEE80211R
255CFLAGS += -DCONFIG_IEEE80211R
256OBJS += ../src/rsn_supp/wpa_ft.o
257NEED_SHA256=y
258NEED_AES_OMAC1=y
259endif
260
261ifdef CONFIG_MESH
262NEED_80211_COMMON=y
263NEED_SHA256=y
264NEED_AES_SIV=y
265CONFIG_SAE=y
266CONFIG_AP=y
267CFLAGS += -DCONFIG_MESH
268OBJS += mesh.o
269OBJS += mesh_mpm.o
270OBJS += mesh_rsn.o
271endif
272
273ifdef CONFIG_SAE
274CFLAGS += -DCONFIG_SAE
275OBJS += ../src/common/sae.o
276NEED_ECC=y
277NEED_DH_GROUPS=y
278endif
279
280ifdef CONFIG_DPP
281CFLAGS += -DCONFIG_DPP
282OBJS += ../src/common/dpp.o
283OBJS += dpp_supplicant.o
284NEED_AES_SIV=y
285NEED_HMAC_SHA256_KDF=y
286NEED_HMAC_SHA384_KDF=y
287NEED_HMAC_SHA512_KDF=y
288NEED_SHA256=y
289NEED_SHA384=y
290NEED_SHA512=y
291NEED_JSON=y
292NEED_GAS_SERVER=y
293NEED_BASE64=y
294ifdef CONFIG_DPP2
295CFLAGS += -DCONFIG_DPP2
296endif
297endif
298
299ifdef CONFIG_OWE
300CFLAGS += -DCONFIG_OWE
301NEED_ECC=y
302NEED_HMAC_SHA256_KDF=y
303NEED_HMAC_SHA384_KDF=y
304NEED_HMAC_SHA512_KDF=y
305NEED_SHA256=y
306NEED_SHA384=y
307NEED_SHA512=y
308endif
309
310ifdef CONFIG_FILS
311CFLAGS += -DCONFIG_FILS
312NEED_SHA384=y
313NEED_AES_SIV=y
314ifdef CONFIG_FILS_SK_PFS
315CFLAGS += -DCONFIG_FILS_SK_PFS
316NEED_ECC=y
317endif
318endif
319
320ifdef CONFIG_MBO
321CONFIG_WNM=y
322endif
323
324ifdef CONFIG_WNM
325CFLAGS += -DCONFIG_WNM
326OBJS += wnm_sta.o
327endif
328
329ifdef CONFIG_TDLS
330CFLAGS += -DCONFIG_TDLS
331OBJS += ../src/rsn_supp/tdls.o
332NEED_SHA256=y
333NEED_AES_OMAC1=y
334endif
335
336ifdef CONFIG_TDLS_TESTING
337CFLAGS += -DCONFIG_TDLS_TESTING
338endif
339
340ifdef CONFIG_PMKSA_CACHE_EXTERNAL
341CFLAGS += -DCONFIG_PMKSA_CACHE_EXTERNAL
342endif
343
344ifndef CONFIG_NO_WPA
345OBJS += ../src/rsn_supp/wpa.o
346OBJS += ../src/rsn_supp/preauth.o
347OBJS += ../src/rsn_supp/pmksa_cache.o
348OBJS += ../src/rsn_supp/wpa_ie.o
349OBJS += ../src/common/wpa_common.o
350NEED_AES=y
351NEED_SHA1=y
352NEED_MD5=y
353NEED_RC4=y
354else
355CFLAGS += -DCONFIG_NO_WPA
356ifeq ($(CONFIG_TLS), internal)
357NEED_SHA1=y
358NEED_MD5=y
359endif
360endif
361
362ifdef CONFIG_IBSS_RSN
363NEED_RSN_AUTHENTICATOR=y
364CFLAGS += -DCONFIG_IBSS_RSN
365CFLAGS += -DCONFIG_NO_VLAN
366OBJS += ibss_rsn.o
367endif
368
369ifdef CONFIG_MATCH_IFACE
370CFLAGS += -DCONFIG_MATCH_IFACE
371endif
372
373ifdef CONFIG_P2P
374OBJS += p2p_supplicant.o
375OBJS += p2p_supplicant_sd.o
376OBJS += ../src/p2p/p2p.o
377OBJS += ../src/p2p/p2p_utils.o
378OBJS += ../src/p2p/p2p_parse.o
379OBJS += ../src/p2p/p2p_build.o
380OBJS += ../src/p2p/p2p_go_neg.o
381OBJS += ../src/p2p/p2p_sd.o
382OBJS += ../src/p2p/p2p_pd.o
383OBJS += ../src/p2p/p2p_invitation.o
384OBJS += ../src/p2p/p2p_dev_disc.o
385OBJS += ../src/p2p/p2p_group.o
386OBJS += ../src/ap/p2p_hostapd.o
387CFLAGS += -DCONFIG_P2P
388NEED_GAS=y
389NEED_OFFCHANNEL=y
390CONFIG_WPS=y
391CONFIG_AP=y
392ifdef CONFIG_P2P_STRICT
393CFLAGS += -DCONFIG_P2P_STRICT
394endif
395endif
396
397ifdef CONFIG_WIFI_DISPLAY
398CFLAGS += -DCONFIG_WIFI_DISPLAY
399OBJS += wifi_display.o
400endif
401
402ifdef CONFIG_HS20
403OBJS += hs20_supplicant.o
404CFLAGS += -DCONFIG_HS20
405CONFIG_INTERWORKING=y
406NEED_AES_OMAC1=y
407endif
408
409ifdef CONFIG_INTERWORKING
410OBJS += interworking.o
411CFLAGS += -DCONFIG_INTERWORKING
412NEED_GAS=y
413endif
414
415ifdef CONFIG_NO_ROAMING
416CFLAGS += -DCONFIG_NO_ROAMING
417endif
418
419include ../src/drivers/drivers.mak
420ifdef CONFIG_AP
421OBJS_d += $(DRV_BOTH_OBJS)
422CFLAGS += $(DRV_BOTH_CFLAGS)
423LDFLAGS += $(DRV_BOTH_LDFLAGS)
424LIBS += $(DRV_BOTH_LIBS)
425else
426NEED_AP_MLME=
427OBJS_d += $(DRV_WPA_OBJS)
428CFLAGS += $(DRV_WPA_CFLAGS)
429LDFLAGS += $(DRV_WPA_LDFLAGS)
430LIBS += $(DRV_WPA_LIBS)
431endif
432
433ifndef CONFIG_L2_PACKET
434CONFIG_L2_PACKET=linux
435endif
436
437OBJS_l2 += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o
438
439ifeq ($(CONFIG_L2_PACKET), pcap)
440ifdef CONFIG_WINPCAP
441CFLAGS += -DCONFIG_WINPCAP
442LIBS += -lwpcap -lpacket
443LIBS_w += -lwpcap
444else
445LIBS += -ldnet -lpcap
446endif
447endif
448
449ifeq ($(CONFIG_L2_PACKET), winpcap)
450LIBS += -lwpcap -lpacket
451LIBS_w += -lwpcap
452endif
453
454ifeq ($(CONFIG_L2_PACKET), freebsd)
455LIBS += -lpcap
456endif
457
458ifdef CONFIG_ERP
459CFLAGS += -DCONFIG_ERP
460NEED_SHA256=y
461NEED_HMAC_SHA256_KDF=y
462endif
463
464ifdef CONFIG_EAP_TLS
465# EAP-TLS
466ifeq ($(CONFIG_EAP_TLS), dyn)
467CFLAGS += -DEAP_TLS_DYNAMIC
468EAPDYN += ../src/eap_peer/eap_tls.so
469else
470CFLAGS += -DEAP_TLS
471OBJS += ../src/eap_peer/eap_tls.o
472endif
473TLS_FUNCS=y
474CONFIG_IEEE8021X_EAPOL=y
475endif
476
477ifdef CONFIG_EAP_UNAUTH_TLS
478# EAP-UNAUTH-TLS
479CFLAGS += -DEAP_UNAUTH_TLS
480ifndef CONFIG_EAP_TLS
481OBJS += ../src/eap_peer/eap_tls.o
482TLS_FUNCS=y
483endif
484CONFIG_IEEE8021X_EAPOL=y
485endif
486
487ifdef CONFIG_EAP_PEAP
488# EAP-PEAP
489ifeq ($(CONFIG_EAP_PEAP), dyn)
490CFLAGS += -DEAP_PEAP_DYNAMIC
491EAPDYN += ../src/eap_peer/eap_peap.so
492else
493CFLAGS += -DEAP_PEAP
494OBJS += ../src/eap_peer/eap_peap.o
495OBJS += ../src/eap_common/eap_peap_common.o
496endif
497TLS_FUNCS=y
498CONFIG_IEEE8021X_EAPOL=y
499endif
500
501ifdef CONFIG_EAP_TTLS
502# EAP-TTLS
503ifeq ($(CONFIG_EAP_TTLS), dyn)
504CFLAGS += -DEAP_TTLS_DYNAMIC
505EAPDYN += ../src/eap_peer/eap_ttls.so
506else
507CFLAGS += -DEAP_TTLS
508OBJS += ../src/eap_peer/eap_ttls.o
509endif
510TLS_FUNCS=y
511ifndef CONFIG_FIPS
512MS_FUNCS=y
513CHAP=y
514endif
515CONFIG_IEEE8021X_EAPOL=y
516endif
517
518ifdef CONFIG_EAP_MD5
519# EAP-MD5
520ifeq ($(CONFIG_EAP_MD5), dyn)
521CFLAGS += -DEAP_MD5_DYNAMIC
522EAPDYN += ../src/eap_peer/eap_md5.so
523else
524CFLAGS += -DEAP_MD5
525OBJS += ../src/eap_peer/eap_md5.o
526endif
527CHAP=y
528CONFIG_IEEE8021X_EAPOL=y
529endif
530
531# backwards compatibility for old spelling
532ifdef CONFIG_MSCHAPV2
533ifndef CONFIG_EAP_MSCHAPV2
534CONFIG_EAP_MSCHAPV2=y
535endif
536endif
537
538ifdef CONFIG_EAP_MSCHAPV2
539# EAP-MSCHAPv2
540ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
541CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
542EAPDYN += ../src/eap_peer/eap_mschapv2.so
543EAPDYN += ../src/eap_peer/mschapv2.so
544else
545CFLAGS += -DEAP_MSCHAPv2
546OBJS += ../src/eap_peer/eap_mschapv2.o
547OBJS += ../src/eap_peer/mschapv2.o
548endif
549MS_FUNCS=y
550CONFIG_IEEE8021X_EAPOL=y
551endif
552
553ifdef CONFIG_EAP_GTC
554# EAP-GTC
555ifeq ($(CONFIG_EAP_GTC), dyn)
556CFLAGS += -DEAP_GTC_DYNAMIC
557EAPDYN += ../src/eap_peer/eap_gtc.so
558else
559CFLAGS += -DEAP_GTC
560OBJS += ../src/eap_peer/eap_gtc.o
561endif
562CONFIG_IEEE8021X_EAPOL=y
563endif
564
565ifdef CONFIG_EAP_OTP
566# EAP-OTP
567ifeq ($(CONFIG_EAP_OTP), dyn)
568CFLAGS += -DEAP_OTP_DYNAMIC
569EAPDYN += ../src/eap_peer/eap_otp.so
570else
571CFLAGS += -DEAP_OTP
572OBJS += ../src/eap_peer/eap_otp.o
573endif
574CONFIG_IEEE8021X_EAPOL=y
575endif
576
577ifdef CONFIG_EAP_SIM
578# EAP-SIM
579ifeq ($(CONFIG_EAP_SIM), dyn)
580CFLAGS += -DEAP_SIM_DYNAMIC
581EAPDYN += ../src/eap_peer/eap_sim.so
582else
583CFLAGS += -DEAP_SIM
584OBJS += ../src/eap_peer/eap_sim.o
585endif
586CONFIG_IEEE8021X_EAPOL=y
587CONFIG_EAP_SIM_COMMON=y
588NEED_AES_CBC=y
589endif
590
591ifdef CONFIG_EAP_LEAP
592# EAP-LEAP
593ifeq ($(CONFIG_EAP_LEAP), dyn)
594CFLAGS += -DEAP_LEAP_DYNAMIC
595EAPDYN += ../src/eap_peer/eap_leap.so
596else
597CFLAGS += -DEAP_LEAP
598OBJS += ../src/eap_peer/eap_leap.o
599endif
600MS_FUNCS=y
601CONFIG_IEEE8021X_EAPOL=y
602endif
603
604ifdef CONFIG_EAP_PSK
605# EAP-PSK
606ifeq ($(CONFIG_EAP_PSK), dyn)
607CFLAGS += -DEAP_PSK_DYNAMIC
608EAPDYN += ../src/eap_peer/eap_psk.so
609else
610CFLAGS += -DEAP_PSK
611OBJS += ../src/eap_peer/eap_psk.o ../src/eap_common/eap_psk_common.o
612endif
613CONFIG_IEEE8021X_EAPOL=y
614NEED_AES=y
615NEED_AES_OMAC1=y
616NEED_AES_ENCBLOCK=y
617NEED_AES_EAX=y
618endif
619
620ifdef CONFIG_EAP_AKA
621# EAP-AKA
622ifeq ($(CONFIG_EAP_AKA), dyn)
623CFLAGS += -DEAP_AKA_DYNAMIC
624EAPDYN += ../src/eap_peer/eap_aka.so
625else
626CFLAGS += -DEAP_AKA
627OBJS += ../src/eap_peer/eap_aka.o
628endif
629CONFIG_IEEE8021X_EAPOL=y
630CONFIG_EAP_SIM_COMMON=y
631NEED_AES_CBC=y
632endif
633
634ifdef CONFIG_EAP_PROXY
635CFLAGS += -DCONFIG_EAP_PROXY
636OBJS += ../src/eap_peer/eap_proxy_$(CONFIG_EAP_PROXY).o
637include eap_proxy_$(CONFIG_EAP_PROXY).mak
638CONFIG_IEEE8021X_EAPOL=y
639endif
640
641ifdef CONFIG_EAP_AKA_PRIME
642# EAP-AKA'
643ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
644CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
645else
646CFLAGS += -DEAP_AKA_PRIME
647endif
648NEED_SHA256=y
649endif
650
651ifdef CONFIG_EAP_SIM_COMMON
652OBJS += ../src/eap_common/eap_sim_common.o
653NEED_AES=y
654NEED_FIPS186_2_PRF=y
655endif
656
657ifdef CONFIG_EAP_FAST
658# EAP-FAST
659ifeq ($(CONFIG_EAP_FAST), dyn)
660CFLAGS += -DEAP_FAST_DYNAMIC
661EAPDYN += ../src/eap_peer/eap_fast.so
662EAPDYN += ../src/eap_common/eap_fast_common.o
663else
664CFLAGS += -DEAP_FAST
665OBJS += ../src/eap_peer/eap_fast.o ../src/eap_peer/eap_fast_pac.o
666OBJS += ../src/eap_common/eap_fast_common.o
667endif
668TLS_FUNCS=y
669CONFIG_IEEE8021X_EAPOL=y
670NEED_T_PRF=y
671endif
672
673ifdef CONFIG_EAP_PAX
674# EAP-PAX
675ifeq ($(CONFIG_EAP_PAX), dyn)
676CFLAGS += -DEAP_PAX_DYNAMIC
677EAPDYN += ../src/eap_peer/eap_pax.so
678else
679CFLAGS += -DEAP_PAX
680OBJS += ../src/eap_peer/eap_pax.o ../src/eap_common/eap_pax_common.o
681endif
682CONFIG_IEEE8021X_EAPOL=y
683endif
684
685ifdef CONFIG_EAP_SAKE
686# EAP-SAKE
687ifeq ($(CONFIG_EAP_SAKE), dyn)
688CFLAGS += -DEAP_SAKE_DYNAMIC
689EAPDYN += ../src/eap_peer/eap_sake.so
690else
691CFLAGS += -DEAP_SAKE
692OBJS += ../src/eap_peer/eap_sake.o ../src/eap_common/eap_sake_common.o
693endif
694CONFIG_IEEE8021X_EAPOL=y
695endif
696
697ifdef CONFIG_EAP_GPSK
698# EAP-GPSK
699ifeq ($(CONFIG_EAP_GPSK), dyn)
700CFLAGS += -DEAP_GPSK_DYNAMIC
701EAPDYN += ../src/eap_peer/eap_gpsk.so
702else
703CFLAGS += -DEAP_GPSK
704OBJS += ../src/eap_peer/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o
705endif
706CONFIG_IEEE8021X_EAPOL=y
707ifdef CONFIG_EAP_GPSK_SHA256
708CFLAGS += -DEAP_GPSK_SHA256
709endif
710NEED_SHA256=y
711NEED_AES_OMAC1=y
712endif
713
714ifdef CONFIG_EAP_PWD
715CFLAGS += -DEAP_PWD
716ifeq ($(CONFIG_TLS), wolfssl)
717CFLAGS += -DCONFIG_ECC
718endif
719OBJS += ../src/eap_peer/eap_pwd.o ../src/eap_common/eap_pwd_common.o
720CONFIG_IEEE8021X_EAPOL=y
721NEED_SHA256=y
722NEED_ECC=y
723endif
724
725ifdef CONFIG_EAP_EKE
726# EAP-EKE
727ifeq ($(CONFIG_EAP_EKE), dyn)
728CFLAGS += -DEAP_EKE_DYNAMIC
729EAPDYN += ../src/eap_peer/eap_eke.so
730else
731CFLAGS += -DEAP_EKE
732OBJS += ../src/eap_peer/eap_eke.o ../src/eap_common/eap_eke_common.o
733endif
734CONFIG_IEEE8021X_EAPOL=y
735NEED_DH_GROUPS=y
736NEED_DH_GROUPS_ALL=y
737NEED_SHA256=y
738NEED_AES_CBC=y
739endif
740
741ifdef CONFIG_WPS
742# EAP-WSC
743CFLAGS += -DCONFIG_WPS -DEAP_WSC
744OBJS += wps_supplicant.o
745OBJS += ../src/utils/uuid.o
746OBJS += ../src/eap_peer/eap_wsc.o ../src/eap_common/eap_wsc_common.o
747OBJS += ../src/wps/wps.o
748OBJS += ../src/wps/wps_common.o
749OBJS += ../src/wps/wps_attr_parse.o
750OBJS += ../src/wps/wps_attr_build.o
751OBJS += ../src/wps/wps_attr_process.o
752OBJS += ../src/wps/wps_dev_attr.o
753OBJS += ../src/wps/wps_enrollee.o
754OBJS += ../src/wps/wps_registrar.o
755CONFIG_IEEE8021X_EAPOL=y
756NEED_DH_GROUPS=y
757NEED_SHA256=y
758NEED_BASE64=y
759NEED_AES_CBC=y
760NEED_MODEXP=y
761
762ifdef CONFIG_WPS_NFC
763CFLAGS += -DCONFIG_WPS_NFC
764OBJS += ../src/wps/ndef.o
765NEED_WPS_OOB=y
766endif
767
768ifdef NEED_WPS_OOB
769CFLAGS += -DCONFIG_WPS_OOB
770endif
771
772ifdef CONFIG_WPS_ER
773CONFIG_WPS_UPNP=y
774CFLAGS += -DCONFIG_WPS_ER
775OBJS += ../src/wps/wps_er.o
776OBJS += ../src/wps/wps_er_ssdp.o
777endif
778
779ifdef CONFIG_WPS_UPNP
780CFLAGS += -DCONFIG_WPS_UPNP
781OBJS += ../src/wps/wps_upnp.o
782OBJS += ../src/wps/wps_upnp_ssdp.o
783OBJS += ../src/wps/wps_upnp_web.o
784OBJS += ../src/wps/wps_upnp_event.o
785OBJS += ../src/wps/wps_upnp_ap.o
786OBJS += ../src/wps/upnp_xml.o
787OBJS += ../src/wps/httpread.o
788OBJS += ../src/wps/http_client.o
789OBJS += ../src/wps/http_server.o
790endif
791
792ifdef CONFIG_WPS_STRICT
793CFLAGS += -DCONFIG_WPS_STRICT
794OBJS += ../src/wps/wps_validate.o
795endif
796
797ifdef CONFIG_WPS_TESTING
798CFLAGS += -DCONFIG_WPS_TESTING
799endif
800
801ifdef CONFIG_WPS_REG_DISABLE_OPEN
802CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
803endif
804
805endif
806
807ifdef CONFIG_EAP_IKEV2
808# EAP-IKEv2
809ifeq ($(CONFIG_EAP_IKEV2), dyn)
810CFLAGS += -DEAP_IKEV2_DYNAMIC
811EAPDYN += ../src/eap_peer/eap_ikev2.so ../src/eap_peer/ikev2.o
812EAPDYN += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
813else
814CFLAGS += -DEAP_IKEV2
815OBJS += ../src/eap_peer/eap_ikev2.o ../src/eap_peer/ikev2.o
816OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
817endif
818CONFIG_IEEE8021X_EAPOL=y
819NEED_DH_GROUPS=y
820NEED_DH_GROUPS_ALL=y
821NEED_MODEXP=y
822NEED_CIPHER=y
823endif
824
825ifdef CONFIG_EAP_VENDOR_TEST
826ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
827CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
828EAPDYN += ../src/eap_peer/eap_vendor_test.so
829else
830CFLAGS += -DEAP_VENDOR_TEST
831OBJS += ../src/eap_peer/eap_vendor_test.o
832endif
833CONFIG_IEEE8021X_EAPOL=y
834endif
835
836ifdef CONFIG_EAP_TNC
837# EAP-TNC
838CFLAGS += -DEAP_TNC
839OBJS += ../src/eap_peer/eap_tnc.o
840OBJS += ../src/eap_peer/tncc.o
841NEED_BASE64=y
842ifndef CONFIG_NATIVE_WINDOWS
843ifndef CONFIG_DRIVER_BSD
844LIBS += -ldl
845endif
846endif
847endif
848
849ifdef CONFIG_MACSEC
850CFLAGS += -DCONFIG_MACSEC
851CONFIG_IEEE8021X_EAPOL=y
852NEED_AES_ENCBLOCK=y
853NEED_AES_UNWRAP=y
854NEED_AES_WRAP=y
855NEED_AES_OMAC1=y
856OBJS += wpas_kay.o
857OBJS += ../src/pae/ieee802_1x_cp.o
858OBJS += ../src/pae/ieee802_1x_kay.o
859OBJS += ../src/pae/ieee802_1x_key.o
860OBJS += ../src/pae/ieee802_1x_secy_ops.o
861endif
862
863ifdef CONFIG_IEEE8021X_EAPOL
864# IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
865CFLAGS += -DIEEE8021X_EAPOL
866OBJS += ../src/eapol_supp/eapol_supp_sm.o
867OBJS += ../src/eap_peer/eap.o ../src/eap_peer/eap_methods.o
868NEED_EAP_COMMON=y
869ifdef CONFIG_DYNAMIC_EAP_METHODS
870CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
871LIBS += -ldl -rdynamic
872endif
873endif
874
875ifdef CONFIG_AP
876NEED_EAP_COMMON=y
877NEED_RSN_AUTHENTICATOR=y
878CFLAGS += -DCONFIG_AP
879OBJS += ap.o
880CFLAGS += -DCONFIG_NO_RADIUS
881CFLAGS += -DCONFIG_NO_ACCOUNTING
882CFLAGS += -DCONFIG_NO_VLAN
883OBJS += ../src/ap/hostapd.o
884OBJS += ../src/ap/wpa_auth_glue.o
885OBJS += ../src/ap/utils.o
886OBJS += ../src/ap/authsrv.o
887OBJS += ../src/ap/ap_config.o
888OBJS += ../src/utils/ip_addr.o
889OBJS += ../src/ap/sta_info.o
890OBJS += ../src/ap/tkip_countermeasures.o
891OBJS += ../src/ap/ap_mlme.o
892OBJS += ../src/ap/ieee802_1x.o
893OBJS += ../src/eapol_auth/eapol_auth_sm.o
894OBJS += ../src/ap/ieee802_11_auth.o
895OBJS += ../src/ap/ieee802_11_shared.o
896OBJS += ../src/ap/drv_callbacks.o
897OBJS += ../src/ap/ap_drv_ops.o
898OBJS += ../src/ap/beacon.o
899OBJS += ../src/ap/bss_load.o
900OBJS += ../src/ap/eap_user_db.o
901OBJS += ../src/ap/neighbor_db.o
902OBJS += ../src/ap/rrm.o
903ifdef CONFIG_IEEE80211N
904OBJS += ../src/ap/ieee802_11_ht.o
905ifdef CONFIG_IEEE80211AC
906OBJS += ../src/ap/ieee802_11_vht.o
907endif
908ifdef CONFIG_IEEE80211AX
909OBJS += ../src/ap/ieee802_11_he.o
910endif
911endif
912ifdef CONFIG_WNM_AP
913CFLAGS += -DCONFIG_WNM_AP
914OBJS += ../src/ap/wnm_ap.o
915endif
916ifdef CONFIG_MBO
917OBJS += ../src/ap/mbo_ap.o
918endif
919ifdef CONFIG_FILS
920OBJS += ../src/ap/fils_hlp.o
921endif
922ifdef CONFIG_CTRL_IFACE
923OBJS += ../src/ap/ctrl_iface_ap.o
924endif
925
926CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
927OBJS += ../src/eap_server/eap_server.o
928OBJS += ../src/eap_server/eap_server_identity.o
929OBJS += ../src/eap_server/eap_server_methods.o
930
931ifdef CONFIG_IEEE80211N
932CFLAGS += -DCONFIG_IEEE80211N
933ifdef CONFIG_IEEE80211AC
934CFLAGS += -DCONFIG_IEEE80211AC
935endif
936ifdef CONFIG_IEEE80211AX
937CFLAGS += -DCONFIG_IEEE80211AX
938endif
939endif
940
941ifdef NEED_AP_MLME
942OBJS += ../src/ap/wmm.o
943OBJS += ../src/ap/ap_list.o
944OBJS += ../src/ap/ieee802_11.o
945OBJS += ../src/ap/hw_features.o
946OBJS += ../src/ap/dfs.o
947CFLAGS += -DNEED_AP_MLME
948endif
949ifdef CONFIG_WPS
950CFLAGS += -DEAP_SERVER_WSC
951OBJS += ../src/ap/wps_hostapd.o
952OBJS += ../src/eap_server/eap_server_wsc.o
953endif
954ifdef CONFIG_DPP
955OBJS += ../src/ap/dpp_hostapd.o
956OBJS += ../src/ap/gas_query_ap.o
957endif
958ifdef CONFIG_INTERWORKING
959OBJS += ../src/ap/gas_serv.o
960endif
961ifdef CONFIG_HS20
962OBJS += ../src/ap/hs20.o
963endif
964endif
965
966ifdef CONFIG_MBO
967OBJS += mbo.o
968CFLAGS += -DCONFIG_MBO
969endif
970
971ifdef NEED_RSN_AUTHENTICATOR
972CFLAGS += -DCONFIG_NO_RADIUS
973NEED_AES_WRAP=y
974OBJS += ../src/ap/wpa_auth.o
975OBJS += ../src/ap/wpa_auth_ie.o
976OBJS += ../src/ap/pmksa_cache_auth.o
977endif
978
979ifdef CONFIG_ACS
980CFLAGS += -DCONFIG_ACS
981OBJS += ../src/ap/acs.o
982LIBS += -lm
983endif
984
985ifdef CONFIG_PCSC
986# PC/SC interface for smartcards (USIM, GSM SIM)
987CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
988OBJS += ../src/utils/pcsc_funcs.o
989# -lpthread may not be needed depending on how pcsc-lite was configured
990ifdef CONFIG_NATIVE_WINDOWS
991#Once MinGW gets support for WinScard, -lwinscard could be used instead of the
992#dynamic symbol loading that is now used in pcsc_funcs.c
993#LIBS += -lwinscard
994else
995ifdef CONFIG_OSX
996LIBS += -framework PCSC
997else
998LIBS += -lpcsclite -lpthread
999endif
1000endif
1001endif
1002
1003ifdef CONFIG_SIM_SIMULATOR
1004CFLAGS += -DCONFIG_SIM_SIMULATOR
1005NEED_MILENAGE=y
1006endif
1007
1008ifdef CONFIG_USIM_SIMULATOR
1009CFLAGS += -DCONFIG_USIM_SIMULATOR
1010NEED_MILENAGE=y
1011endif
1012
1013ifdef NEED_MILENAGE
1014OBJS += ../src/crypto/milenage.o
1015NEED_AES_ENCBLOCK=y
1016endif
1017
1018ifdef CONFIG_PKCS12
1019CFLAGS += -DPKCS12_FUNCS
1020endif
1021
1022ifdef CONFIG_SMARTCARD
1023CFLAGS += -DCONFIG_SMARTCARD
1024endif
1025
1026ifdef MS_FUNCS
1027OBJS += ../src/crypto/ms_funcs.o
1028NEED_DES=y
1029NEED_MD4=y
1030endif
1031
1032ifdef CHAP
1033OBJS += ../src/eap_common/chap.o
1034endif
1035
1036ifdef TLS_FUNCS
1037NEED_DES=y
1038# Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
1039OBJS += ../src/eap_peer/eap_tls_common.o
1040ifndef CONFIG_FIPS
1041NEED_TLS_PRF=y
1042NEED_SHA1=y
1043NEED_MD5=y
1044endif
1045endif
1046
1047ifndef CONFIG_TLS
1048CONFIG_TLS=openssl
1049endif
1050
1051ifdef CONFIG_TLSV11
1052CFLAGS += -DCONFIG_TLSV11
1053endif
1054
1055ifdef CONFIG_TLSV12
1056CFLAGS += -DCONFIG_TLSV12
1057NEED_SHA256=y
1058endif
1059
1060ifeq ($(CONFIG_TLS), wolfssl)
1061ifdef TLS_FUNCS
1062CFLAGS += -DWOLFSSL_DER_LOAD -I/usr/local/include/wolfssl
1063OBJS += ../src/crypto/tls_wolfssl.o
1064endif
1065OBJS += ../src/crypto/crypto_wolfssl.o
1066OBJS_p += ../src/crypto/crypto_wolfssl.o
1067ifdef NEED_FIPS186_2_PRF
1068OBJS += ../src/crypto/fips_prf_wolfssl.o
1069endif
1070NEED_TLS_PRF_SHA256=y
1071LIBS += -lwolfssl -lm
1072LIBS_p += -lwolfssl -lm
1073endif
1074
1075ifeq ($(CONFIG_TLS), openssl)
1076ifdef TLS_FUNCS
1077CFLAGS += -DEAP_TLS_OPENSSL
1078OBJS += ../src/crypto/tls_openssl.o
1079OBJS += ../src/crypto/tls_openssl_ocsp.o
1080LIBS += -lssl
1081endif
1082OBJS += ../src/crypto/crypto_openssl.o
1083OBJS_p += ../src/crypto/crypto_openssl.o
1084OBJS_priv += ../src/crypto/crypto_openssl.o
1085ifdef NEED_FIPS186_2_PRF
1086OBJS += ../src/crypto/fips_prf_openssl.o
1087endif
1088NEED_SHA256=y
1089NEED_TLS_PRF_SHA256=y
1090LIBS += -lcrypto
1091LIBS_p += -lcrypto
1092ifdef CONFIG_TLS_ADD_DL
1093LIBS += -ldl
1094LIBS_p += -ldl
1095endif
1096ifndef CONFIG_TLS_DEFAULT_CIPHERS
1097CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW"
1098endif
1099CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\"
1100endif
1101
1102ifeq ($(CONFIG_TLS), gnutls)
1103ifndef CONFIG_CRYPTO
1104# default to libgcrypt
1105CONFIG_CRYPTO=gnutls
1106endif
1107ifdef TLS_FUNCS
1108OBJS += ../src/crypto/tls_gnutls.o
1109LIBS += -lgnutls -lgpg-error
1110endif
1111OBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
1112OBJS_p += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
1113OBJS_priv += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
1114ifdef NEED_FIPS186_2_PRF
1115OBJS += ../src/crypto/fips_prf_internal.o
1116SHA1OBJS += ../src/crypto/sha1-internal.o
1117endif
1118ifeq ($(CONFIG_CRYPTO), gnutls)
1119LIBS += -lgcrypt
1120LIBS_p += -lgcrypt
1121CONFIG_INTERNAL_RC4=y
1122CONFIG_INTERNAL_DH_GROUP5=y
1123endif
1124ifeq ($(CONFIG_CRYPTO), nettle)
1125LIBS += -lnettle -lgmp
1126LIBS_p += -lnettle -lgmp
1127CONFIG_INTERNAL_RC4=y
1128CONFIG_INTERNAL_DH_GROUP5=y
1129endif
1130endif
1131
1132ifeq ($(CONFIG_TLS), internal)
1133ifndef CONFIG_CRYPTO
1134CONFIG_CRYPTO=internal
1135endif
1136ifdef TLS_FUNCS
1137OBJS += ../src/crypto/crypto_internal-rsa.o
1138OBJS += ../src/crypto/tls_internal.o
1139OBJS += ../src/tls/tlsv1_common.o
1140OBJS += ../src/tls/tlsv1_record.o
1141OBJS += ../src/tls/tlsv1_cred.o
1142OBJS += ../src/tls/tlsv1_client.o
1143OBJS += ../src/tls/tlsv1_client_write.o
1144OBJS += ../src/tls/tlsv1_client_read.o
1145OBJS += ../src/tls/tlsv1_client_ocsp.o
1146OBJS += ../src/tls/asn1.o
1147OBJS += ../src/tls/rsa.o
1148OBJS += ../src/tls/x509v3.o
1149OBJS += ../src/tls/pkcs1.o
1150OBJS += ../src/tls/pkcs5.o
1151OBJS += ../src/tls/pkcs8.o
1152NEED_SHA256=y
1153NEED_BASE64=y
1154NEED_TLS_PRF=y
1155ifdef CONFIG_TLSV12
1156NEED_TLS_PRF_SHA256=y
1157endif
1158NEED_MODEXP=y
1159NEED_CIPHER=y
1160CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
1161endif
1162ifdef NEED_CIPHER
1163NEED_DES=y
1164OBJS += ../src/crypto/crypto_internal-cipher.o
1165endif
1166ifdef NEED_MODEXP
1167OBJS += ../src/crypto/crypto_internal-modexp.o
1168OBJS += ../src/tls/bignum.o
1169endif
1170ifeq ($(CONFIG_CRYPTO), libtomcrypt)
1171OBJS += ../src/crypto/crypto_libtomcrypt.o
1172OBJS_p += ../src/crypto/crypto_libtomcrypt.o
1173LIBS += -ltomcrypt -ltfm
1174LIBS_p += -ltomcrypt -ltfm
1175CONFIG_INTERNAL_SHA256=y
1176CONFIG_INTERNAL_RC4=y
1177CONFIG_INTERNAL_DH_GROUP5=y
1178endif
1179ifeq ($(CONFIG_CRYPTO), internal)
1180OBJS += ../src/crypto/crypto_internal.o
1181OBJS_p += ../src/crypto/crypto_internal.o
1182NEED_AES_ENC=y
1183CFLAGS += -DCONFIG_CRYPTO_INTERNAL
1184ifdef CONFIG_INTERNAL_LIBTOMMATH
1185CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
1186ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
1187CFLAGS += -DLTM_FAST
1188endif
1189else
1190LIBS += -ltommath
1191LIBS_p += -ltommath
1192endif
1193CONFIG_INTERNAL_AES=y
1194CONFIG_INTERNAL_DES=y
1195CONFIG_INTERNAL_SHA1=y
1196CONFIG_INTERNAL_MD4=y
1197CONFIG_INTERNAL_MD5=y
1198CONFIG_INTERNAL_SHA256=y
1199CONFIG_INTERNAL_SHA384=y
1200CONFIG_INTERNAL_SHA512=y
1201CONFIG_INTERNAL_RC4=y
1202CONFIG_INTERNAL_DH_GROUP5=y
1203endif
1204ifeq ($(CONFIG_CRYPTO), cryptoapi)
1205OBJS += ../src/crypto/crypto_cryptoapi.o
1206OBJS_p += ../src/crypto/crypto_cryptoapi.o
1207CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
1208CONFIG_INTERNAL_SHA256=y
1209CONFIG_INTERNAL_RC4=y
1210endif
1211endif
1212
1213ifeq ($(CONFIG_TLS), linux)
1214OBJS += ../src/crypto/crypto_linux.o
1215OBJS_p += ../src/crypto/crypto_linux.o
1216ifdef TLS_FUNCS
1217OBJS += ../src/crypto/crypto_internal-rsa.o
1218OBJS += ../src/crypto/tls_internal.o
1219OBJS += ../src/tls/tlsv1_common.o
1220OBJS += ../src/tls/tlsv1_record.o
1221OBJS += ../src/tls/tlsv1_cred.o
1222OBJS += ../src/tls/tlsv1_client.o
1223OBJS += ../src/tls/tlsv1_client_write.o
1224OBJS += ../src/tls/tlsv1_client_read.o
1225OBJS += ../src/tls/tlsv1_client_ocsp.o
1226OBJS += ../src/tls/asn1.o
1227OBJS += ../src/tls/rsa.o
1228OBJS += ../src/tls/x509v3.o
1229OBJS += ../src/tls/pkcs1.o
1230OBJS += ../src/tls/pkcs5.o
1231OBJS += ../src/tls/pkcs8.o
1232NEED_SHA256=y
1233NEED_BASE64=y
1234NEED_TLS_PRF=y
1235ifdef CONFIG_TLSV12
1236NEED_TLS_PRF_SHA256=y
1237endif
1238NEED_MODEXP=y
1239NEED_CIPHER=y
1240CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
1241endif
1242ifdef NEED_MODEXP
1243OBJS += ../src/crypto/crypto_internal-modexp.o
1244OBJS += ../src/tls/bignum.o
1245CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
1246CFLAGS += -DLTM_FAST
1247endif
1248CONFIG_INTERNAL_DH_GROUP5=y
1249ifdef NEED_FIPS186_2_PRF
1250OBJS += ../src/crypto/fips_prf_internal.o
1251OBJS += ../src/crypto/sha1-internal.o
1252endif
1253endif
1254
1255ifeq ($(CONFIG_TLS), none)
1256ifdef TLS_FUNCS
1257OBJS += ../src/crypto/tls_none.o
1258CFLAGS += -DEAP_TLS_NONE
1259CONFIG_INTERNAL_AES=y
1260CONFIG_INTERNAL_SHA1=y
1261CONFIG_INTERNAL_MD5=y
1262endif
1263OBJS += ../src/crypto/crypto_none.o
1264OBJS_p += ../src/crypto/crypto_none.o
1265CONFIG_INTERNAL_SHA256=y
1266CONFIG_INTERNAL_RC4=y
1267endif
1268
1269ifdef TLS_FUNCS
1270ifdef CONFIG_SMARTCARD
1271ifndef CONFIG_NATIVE_WINDOWS
1272ifneq ($(CONFIG_L2_PACKET), freebsd)
1273LIBS += -ldl
1274endif
1275endif
1276endif
1277endif
1278
1279ifndef TLS_FUNCS
1280OBJS += ../src/crypto/tls_none.o
1281ifeq ($(CONFIG_TLS), internal)
1282CONFIG_INTERNAL_AES=y
1283CONFIG_INTERNAL_SHA1=y
1284CONFIG_INTERNAL_MD5=y
1285CONFIG_INTERNAL_RC4=y
1286endif
1287endif
1288
1289AESOBJS = # none so far (see below)
1290ifdef CONFIG_INTERNAL_AES
1291AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-dec.o
1292endif
1293
1294ifneq ($(CONFIG_TLS), openssl)
1295ifneq ($(CONFIG_TLS), wolfssl)
1296NEED_INTERNAL_AES_WRAP=y
1297endif
1298endif
1299ifdef CONFIG_OPENSSL_INTERNAL_AES_WRAP
1300# Seems to be needed at least with BoringSSL
1301NEED_INTERNAL_AES_WRAP=y
1302CFLAGS += -DCONFIG_OPENSSL_INTERNAL_AES_WRAP
1303endif
1304ifdef CONFIG_FIPS
1305# Have to use internal AES key wrap routines to use OpenSSL EVP since the
1306# OpenSSL AES_wrap_key()/AES_unwrap_key() API is not available in FIPS mode.
1307NEED_INTERNAL_AES_WRAP=y
1308endif
1309
1310ifdef NEED_INTERNAL_AES_WRAP
1311ifneq ($(CONFIG_TLS), linux)
1312AESOBJS += ../src/crypto/aes-unwrap.o
1313endif
1314endif
1315ifdef NEED_AES_EAX
1316AESOBJS += ../src/crypto/aes-eax.o
1317NEED_AES_CTR=y
1318NEED_AES_OMAC1=y
1319endif
1320ifdef NEED_AES_SIV
1321AESOBJS += ../src/crypto/aes-siv.o
1322NEED_AES_CTR=y
1323NEED_AES_OMAC1=y
1324endif
1325ifdef NEED_AES_CTR
1326AESOBJS += ../src/crypto/aes-ctr.o
1327endif
1328ifdef NEED_AES_ENCBLOCK
1329AESOBJS += ../src/crypto/aes-encblock.o
1330endif
1331ifdef NEED_AES_OMAC1
1332NEED_AES_ENC=y
1333ifdef CONFIG_OPENSSL_CMAC
1334CFLAGS += -DCONFIG_OPENSSL_CMAC
1335else
1336ifneq ($(CONFIG_TLS), linux)
1337ifneq ($(CONFIG_TLS), wolfssl)
1338AESOBJS += ../src/crypto/aes-omac1.o
1339endif
1340endif
1341endif
1342endif
1343ifdef NEED_AES_WRAP
1344NEED_AES_ENC=y
1345ifdef NEED_INTERNAL_AES_WRAP
1346AESOBJS += ../src/crypto/aes-wrap.o
1347endif
1348endif
1349ifdef NEED_AES_CBC
1350NEED_AES_ENC=y
1351ifneq ($(CONFIG_TLS), openssl)
1352ifneq ($(CONFIG_TLS), linux)
1353ifneq ($(CONFIG_TLS), wolfssl)
1354AESOBJS += ../src/crypto/aes-cbc.o
1355endif
1356endif
1357endif
1358endif
1359ifdef NEED_AES_ENC
1360ifdef CONFIG_INTERNAL_AES
1361AESOBJS += ../src/crypto/aes-internal-enc.o
1362endif
1363endif
1364ifdef NEED_AES
1365OBJS += $(AESOBJS)
1366endif
1367
1368ifdef NEED_SHA1
1369ifneq ($(CONFIG_TLS), openssl)
1370ifneq ($(CONFIG_TLS), linux)
1371ifneq ($(CONFIG_TLS), gnutls)
1372ifneq ($(CONFIG_TLS), wolfssl)
1373SHA1OBJS += ../src/crypto/sha1.o
1374endif
1375endif
1376endif
1377endif
1378SHA1OBJS += ../src/crypto/sha1-prf.o
1379ifdef CONFIG_INTERNAL_SHA1
1380SHA1OBJS += ../src/crypto/sha1-internal.o
1381ifdef NEED_FIPS186_2_PRF
1382SHA1OBJS += ../src/crypto/fips_prf_internal.o
1383endif
1384endif
1385ifdef CONFIG_NO_WPA_PASSPHRASE
1386CFLAGS += -DCONFIG_NO_PBKDF2
1387else
1388ifneq ($(CONFIG_TLS), openssl)
1389ifneq ($(CONFIG_TLS), wolfssl)
1390SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
1391endif
1392endif
1393endif
1394ifdef NEED_T_PRF
1395SHA1OBJS += ../src/crypto/sha1-tprf.o
1396endif
1397ifdef NEED_TLS_PRF
1398SHA1OBJS += ../src/crypto/sha1-tlsprf.o
1399endif
1400endif
1401
1402ifndef CONFIG_FIPS
1403ifneq ($(CONFIG_TLS), openssl)
1404ifneq ($(CONFIG_TLS), linux)
1405ifneq ($(CONFIG_TLS), gnutls)
1406ifneq ($(CONFIG_TLS), wolfssl)
1407MD5OBJS += ../src/crypto/md5.o
1408endif
1409endif
1410endif
1411endif
1412endif
1413ifdef NEED_MD5
1414ifdef CONFIG_INTERNAL_MD5
1415MD5OBJS += ../src/crypto/md5-internal.o
1416endif
1417OBJS += $(MD5OBJS)
1418OBJS_p += $(MD5OBJS)
1419OBJS_priv += $(MD5OBJS)
1420endif
1421
1422ifdef NEED_MD4
1423ifdef CONFIG_INTERNAL_MD4
1424OBJS += ../src/crypto/md4-internal.o
1425endif
1426endif
1427
1428DESOBJS = # none needed when not internal
1429ifdef NEED_DES
1430ifndef CONFIG_FIPS
1431CFLAGS += -DCONFIG_DES
1432endif
1433ifdef CONFIG_INTERNAL_DES
1434DESOBJS += ../src/crypto/des-internal.o
1435endif
1436endif
1437
1438ifdef CONFIG_NO_RC4
1439CFLAGS += -DCONFIG_NO_RC4
1440endif
1441
1442ifdef NEED_RC4
1443ifdef CONFIG_INTERNAL_RC4
1444ifndef CONFIG_NO_RC4
1445OBJS += ../src/crypto/rc4.o
1446endif
1447endif
1448endif
1449
1450SHA256OBJS = # none by default
1451ifdef NEED_SHA256
1452CFLAGS += -DCONFIG_SHA256
1453ifneq ($(CONFIG_TLS), openssl)
1454ifneq ($(CONFIG_TLS), linux)
1455ifneq ($(CONFIG_TLS), gnutls)
1456ifneq ($(CONFIG_TLS), wolfssl)
1457SHA256OBJS += ../src/crypto/sha256.o
1458endif
1459endif
1460endif
1461endif
1462SHA256OBJS += ../src/crypto/sha256-prf.o
1463ifdef CONFIG_INTERNAL_SHA256
1464SHA256OBJS += ../src/crypto/sha256-internal.o
1465endif
1466ifdef CONFIG_INTERNAL_SHA384
1467CFLAGS += -DCONFIG_INTERNAL_SHA384
1468SHA256OBJS += ../src/crypto/sha384-internal.o
1469endif
1470ifdef CONFIG_INTERNAL_SHA512
1471CFLAGS += -DCONFIG_INTERNAL_SHA512
1472SHA256OBJS += ../src/crypto/sha512-internal.o
1473endif
1474ifdef NEED_TLS_PRF_SHA256
1475SHA256OBJS += ../src/crypto/sha256-tlsprf.o
1476endif
1477ifdef NEED_HMAC_SHA256_KDF
1478CFLAGS += -DCONFIG_HMAC_SHA256_KDF
1479OBJS += ../src/crypto/sha256-kdf.o
1480endif
1481ifdef NEED_HMAC_SHA384_KDF
1482CFLAGS += -DCONFIG_HMAC_SHA384_KDF
1483OBJS += ../src/crypto/sha384-kdf.o
1484endif
1485ifdef NEED_HMAC_SHA512_KDF
1486CFLAGS += -DCONFIG_HMAC_SHA512_KDF
1487OBJS += ../src/crypto/sha512-kdf.o
1488endif
1489OBJS += $(SHA256OBJS)
1490endif
1491ifdef NEED_SHA384
1492ifneq ($(CONFIG_TLS), openssl)
1493ifneq ($(CONFIG_TLS), linux)
1494ifneq ($(CONFIG_TLS), gnutls)
1495ifneq ($(CONFIG_TLS), wolfssl)
1496OBJS += ../src/crypto/sha384.o
1497endif
1498endif
1499endif
1500endif
1501CFLAGS += -DCONFIG_SHA384
1502OBJS += ../src/crypto/sha384-prf.o
1503endif
1504ifdef NEED_SHA512
1505ifneq ($(CONFIG_TLS), openssl)
1506ifneq ($(CONFIG_TLS), linux)
1507ifneq ($(CONFIG_TLS), gnutls)
1508ifneq ($(CONFIG_TLS), wolfssl)
1509OBJS += ../src/crypto/sha512.o
1510endif
1511endif
1512endif
1513endif
1514CFLAGS += -DCONFIG_SHA512
1515OBJS += ../src/crypto/sha512-prf.o
1516endif
1517
1518ifdef NEED_DH_GROUPS
1519OBJS += ../src/crypto/dh_groups.o
1520endif
1521ifdef NEED_DH_GROUPS_ALL
1522CFLAGS += -DALL_DH_GROUPS
1523endif
1524ifdef CONFIG_INTERNAL_DH_GROUP5
1525ifdef NEED_DH_GROUPS
1526OBJS += ../src/crypto/dh_group5.o
1527endif
1528endif
1529
1530ifdef NEED_ECC
1531CFLAGS += -DCONFIG_ECC
1532endif
1533
1534ifdef CONFIG_NO_RANDOM_POOL
1535CFLAGS += -DCONFIG_NO_RANDOM_POOL
1536else
1537ifdef CONFIG_GETRANDOM
1538CFLAGS += -DCONFIG_GETRANDOM
1539endif
1540OBJS += ../src/crypto/random.o
1541endif
1542
1543ifdef CONFIG_CTRL_IFACE
1544ifeq ($(CONFIG_CTRL_IFACE), y)
1545ifdef CONFIG_NATIVE_WINDOWS
1546CONFIG_CTRL_IFACE=named_pipe
1547else
1548CONFIG_CTRL_IFACE=unix
1549endif
1550endif
1551CFLAGS += -DCONFIG_CTRL_IFACE
1552ifeq ($(CONFIG_CTRL_IFACE), unix)
1553CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
1554OBJS += ../src/common/ctrl_iface_common.o
1555endif
1556ifeq ($(CONFIG_CTRL_IFACE), udp)
1557CFLAGS += -DCONFIG_CTRL_IFACE_UDP
1558endif
1559ifeq ($(CONFIG_CTRL_IFACE), udp6)
1560CONFIG_CTRL_IFACE=udp
1561CFLAGS += -DCONFIG_CTRL_IFACE_UDP
1562CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
1563endif
1564ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
1565CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
1566endif
1567ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
1568CONFIG_CTRL_IFACE=udp
1569CFLAGS += -DCONFIG_CTRL_IFACE_UDP
1570CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
1571endif
1572ifeq ($(CONFIG_CTRL_IFACE), udp6-remote)
1573CONFIG_CTRL_IFACE=udp
1574CFLAGS += -DCONFIG_CTRL_IFACE_UDP
1575CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
1576CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
1577endif
1578OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o
1579endif
1580
1581ifdef CONFIG_CTRL_IFACE_DBUS_NEW
1582CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
1583OBJS += dbus/dbus_dict_helpers.o
1584OBJS += dbus/dbus_new_helpers.o
1585OBJS += dbus/dbus_new.o dbus/dbus_new_handlers.o
1586OBJS += dbus/dbus_common.o
1587ifdef CONFIG_WPS
1588OBJS += dbus/dbus_new_handlers_wps.o
1589endif
1590ifdef CONFIG_P2P
1591OBJS += dbus/dbus_new_handlers_p2p.o
1592endif
1593ifndef DBUS_LIBS
1594DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
1595endif
1596ifndef DBUS_INCLUDE
1597DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
1598endif
1599ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
1600OBJS += dbus/dbus_new_introspect.o
1601CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
1602endif
1603CFLAGS += $(DBUS_INCLUDE)
1604LIBS += $(DBUS_LIBS)
1605endif
1606
1607ifdef CONFIG_READLINE
1608OBJS_c += ../src/utils/edit_readline.o
1609LIBS_c += -lreadline -lncurses
1610else
1611ifdef CONFIG_WPA_CLI_EDIT
1612OBJS_c += ../src/utils/edit.o
1613else
1614OBJS_c += ../src/utils/edit_simple.o
1615endif
1616endif
1617
1618ifdef CONFIG_NATIVE_WINDOWS
1619CFLAGS += -DCONFIG_NATIVE_WINDOWS
1620LIBS += -lws2_32 -lgdi32 -lcrypt32
1621LIBS_c += -lws2_32
1622LIBS_p += -lws2_32 -lgdi32
1623ifeq ($(CONFIG_CRYPTO), cryptoapi)
1624LIBS_p += -lcrypt32
1625endif
1626endif
1627
1628ifdef CONFIG_NO_STDOUT_DEBUG
1629CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
1630ifndef CONFIG_CTRL_IFACE
1631CFLAGS += -DCONFIG_NO_WPA_MSG
1632endif
1633endif
1634
1635ifdef CONFIG_IPV6
1636# for eapol_test only
1637CFLAGS += -DCONFIG_IPV6
1638endif
1639
1640ifdef CONFIG_NO_LINUX_PACKET_SOCKET_WAR
1641CFLAGS += -DCONFIG_NO_LINUX_PACKET_SOCKET_WAR
1642endif
1643
1644ifdef NEED_BASE64
1645OBJS += ../src/utils/base64.o
1646endif
1647
1648ifdef NEED_SME
1649OBJS += sme.o
1650CFLAGS += -DCONFIG_SME
1651endif
1652
1653OBJS += ../src/common/ieee802_11_common.o
1654OBJS += ../src/common/hw_features_common.o
1655
1656ifdef NEED_EAP_COMMON
1657OBJS += ../src/eap_common/eap_common.o
1658endif
1659
1660ifndef CONFIG_MAIN
1661CONFIG_MAIN=main
1662endif
1663
1664ifdef CONFIG_DEBUG_SYSLOG
1665CFLAGS += -DCONFIG_DEBUG_SYSLOG
1666ifdef CONFIG_DEBUG_SYSLOG_FACILITY
1667CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
1668endif
1669endif
1670
1671ifdef CONFIG_DEBUG_LINUX_TRACING
1672CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
1673endif
1674
1675ifdef CONFIG_DEBUG_FILE
1676CFLAGS += -DCONFIG_DEBUG_FILE
1677endif
1678
1679ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
1680CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
1681endif
1682
1683ifdef CONFIG_FIPS
1684CFLAGS += -DCONFIG_FIPS
1685ifneq ($(CONFIG_TLS), openssl)
1686ifneq ($(CONFIG_TLS), wolfssl)
1687$(error CONFIG_FIPS=y requires CONFIG_TLS=openssl)
1688endif
1689endif
1690endif
1691
1692OBJS += $(SHA1OBJS) $(DESOBJS)
1693
1694OBJS_p += $(SHA1OBJS)
1695OBJS_p += $(SHA256OBJS)
1696OBJS_priv += $(SHA1OBJS)
1697
1698ifdef CONFIG_BGSCAN_SIMPLE
1699CFLAGS += -DCONFIG_BGSCAN_SIMPLE
1700OBJS += bgscan_simple.o
1701NEED_BGSCAN=y
1702endif
1703
1704ifdef CONFIG_BGSCAN_LEARN
1705CFLAGS += -DCONFIG_BGSCAN_LEARN
1706OBJS += bgscan_learn.o
1707NEED_BGSCAN=y
1708endif
1709
1710ifdef NEED_BGSCAN
1711CFLAGS += -DCONFIG_BGSCAN
1712OBJS += bgscan.o
1713endif
1714
1715ifdef CONFIG_AUTOSCAN_EXPONENTIAL
1716CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL
1717OBJS += autoscan_exponential.o
1718NEED_AUTOSCAN=y
1719endif
1720
1721ifdef CONFIG_AUTOSCAN_PERIODIC
1722CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC
1723OBJS += autoscan_periodic.o
1724NEED_AUTOSCAN=y
1725endif
1726
1727ifdef NEED_AUTOSCAN
1728CFLAGS += -DCONFIG_AUTOSCAN
1729OBJS += autoscan.o
1730endif
1731
1732ifdef CONFIG_EXT_PASSWORD_TEST
1733OBJS += ../src/utils/ext_password_test.o
1734CFLAGS += -DCONFIG_EXT_PASSWORD_TEST
1735NEED_EXT_PASSWORD=y
1736endif
1737
1738ifdef NEED_EXT_PASSWORD
1739OBJS += ../src/utils/ext_password.o
1740CFLAGS += -DCONFIG_EXT_PASSWORD
1741endif
1742
1743ifdef NEED_GAS_SERVER
1744OBJS += ../src/common/gas_server.o
1745CFLAGS += -DCONFIG_GAS_SERVER
1746NEED_GAS=y
1747endif
1748
1749ifdef NEED_GAS
1750OBJS += ../src/common/gas.o
1751OBJS += gas_query.o
1752CFLAGS += -DCONFIG_GAS
1753NEED_OFFCHANNEL=y
1754endif
1755
1756ifdef NEED_OFFCHANNEL
1757OBJS += offchannel.o
1758CFLAGS += -DCONFIG_OFFCHANNEL
1759endif
1760
1761ifdef NEED_JSON
1762OBJS += ../src/utils/json.o
1763CFLAGS += -DCONFIG_JSON
1764endif
1765
1766ifdef CONFIG_MODULE_TESTS
1767CFLAGS += -DCONFIG_MODULE_TESTS
1768OBJS += wpas_module_tests.o
1769OBJS += ../src/utils/utils_module_tests.o
1770OBJS += ../src/common/common_module_tests.o
1771OBJS += ../src/crypto/crypto_module_tests.o
1772ifdef CONFIG_WPS
1773OBJS += ../src/wps/wps_module_tests.o
1774endif
1775endif
1776
1777OBJS += ../src/drivers/driver_common.o
1778OBJS_priv += ../src/drivers/driver_common.o
1779
1780OBJS += wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o
1781OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o
1782OBJS_t += ../src/radius/radius_client.o
1783OBJS_t += ../src/radius/radius.o
1784ifndef CONFIG_AP
1785OBJS_t += ../src/utils/ip_addr.o
1786endif
1787OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o
1788
1789OBJS_nfc := $(OBJS) $(OBJS_l2) nfc_pw_token.o
1790OBJS_nfc += $(OBJS_d) ../src/drivers/drivers.o
1791
1792OBJS += $(CONFIG_MAIN).o
1793
1794ifdef CONFIG_PRIVSEP
1795OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o
1796OBJS_priv += $(OBJS_l2)
1797OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
1798OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
1799OBJS_priv += ../src/utils/common.o
1800OBJS_priv += ../src/utils/wpa_debug.o
1801OBJS_priv += ../src/utils/wpabuf.o
1802OBJS_priv += wpa_priv.o
1803ifdef CONFIG_DRIVER_NL80211
1804OBJS_priv += ../src/common/ieee802_11_common.o
1805endif
1806OBJS += ../src/l2_packet/l2_packet_privsep.o
1807OBJS += ../src/drivers/driver_privsep.o
1808EXTRA_progs += wpa_priv
1809else
1810OBJS += $(OBJS_d) ../src/drivers/drivers.o
1811OBJS += $(OBJS_l2)
1812endif
1813
1814ifdef CONFIG_NDIS_EVENTS_INTEGRATED
1815CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
1816OBJS += ../src/drivers/ndis_events.o
1817EXTRALIBS += -loleaut32 -lole32 -luuid
1818ifdef PLATFORMSDKLIB
1819EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
1820else
1821EXTRALIBS += WbemUuid.Lib
1822endif
1823endif
1824
1825ifdef CONFIG_FST
1826CFLAGS += -DCONFIG_FST
1827ifdef CONFIG_FST_TEST
1828CFLAGS += -DCONFIG_FST_TEST
1829endif
1830FST_OBJS += ../src/fst/fst.o
1831FST_OBJS += ../src/fst/fst_session.o
1832FST_OBJS += ../src/fst/fst_iface.o
1833FST_OBJS += ../src/fst/fst_group.o
1834FST_OBJS += ../src/fst/fst_ctrl_aux.o
1835ifdef CONFIG_CTRL_IFACE
1836FST_OBJS += ../src/fst/fst_ctrl_iface.o
1837endif
1838OBJS += $(FST_OBJS)
1839OBJS_t += $(FST_OBJS)
1840OBJS_t2 += $(FST_OBJS)
1841OBJS_nfc += $(FST_OBJS)
1842endif
1843
1844ifndef LDO
1845LDO=$(CC)
1846endif
1847
1848Q=@
1849E=echo
1850ifeq ($(V), 1)
1851Q=
1852E=true
1853endif
1854ifeq ($(QUIET), 1)
1855Q=@
1856E=true
1857endif
1858
1859dynamic_eap_methods: $(EAPDYN)
1860
1861../src/drivers/build.wpa_supplicant:
1862	@if [ -f ../src/drivers/build.hostapd ]; then \
1863		$(MAKE) -C ../src/drivers clean; \
1864	fi
1865	@touch ../src/drivers/build.wpa_supplicant
1866
1867BCHECK=../src/drivers/build.wpa_supplicant
1868
1869wpa_priv: $(BCHECK) $(OBJS_priv)
1870	$(Q)$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
1871	@$(E) "  LD " $@
1872
1873$(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
1874
1875wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
1876	$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
1877	@$(E) "  LD " $@
1878
1879eapol_test: $(OBJS_t)
1880	$(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
1881	@$(E) "  LD " $@
1882
1883preauth_test: $(OBJS_t2)
1884	$(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
1885	@$(E) "  LD " $@
1886
1887wpa_passphrase: $(OBJS_p)
1888	$(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS)
1889	@$(E) "  LD " $@
1890
1891wpa_cli: $(OBJS_c)
1892	$(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
1893	@$(E) "  LD " $@
1894
1895LIBCTRL += ../src/common/wpa_ctrl.o
1896LIBCTRL += ../src/utils/os_$(CONFIG_OS).o
1897LIBCTRL += ../src/utils/common.o
1898LIBCTRL += ../src/utils/wpa_debug.o
1899LIBCTRLSO += ../src/common/wpa_ctrl.c
1900LIBCTRLSO += ../src/utils/os_$(CONFIG_OS).c
1901LIBCTRLSO += ../src/utils/common.c
1902LIBCTRLSO += ../src/utils/wpa_debug.c
1903
1904libwpa_client.a: $(LIBCTRL)
1905	$(Q)rm -f $@
1906	$(Q)$(AR) crs $@ $?
1907	@$(E) "  AR " $@
1908
1909libwpa_client.so: $(LIBCTRLSO)
1910	@$(E) "  CC  $@ ($^)"
1911	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -fPIC $^
1912
1913libwpa_test1: libwpa_test.o libwpa_client.a
1914	$(Q)$(LDO) $(LDFLAGS) -o libwpa_test1 libwpa_test.o libwpa_client.a $(LIBS_c)
1915	@$(E) "  LD " $@
1916
1917libwpa_test2: libwpa_test.o libwpa_client.so
1918	$(Q)$(LDO) $(LDFLAGS) -o libwpa_test2 libwpa_test.o -L. -lwpa_client $(LIBS_c)
1919	@$(E) "  LD " $@
1920
1921nfc_pw_token: $(OBJS_nfc)
1922	$(Q)$(LDO) $(LDFLAGS) -o nfc_pw_token $(OBJS_nfc) $(LIBS)
1923	@$(E) "  LD " $@
1924
1925win_if_list: win_if_list.c
1926	$(Q)$(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
1927	@$(E) "  LD " $@
1928
1929eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c
1930	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
1931		-Deap_peer_psk_register=eap_peer_method_dynamic_init
1932
1933eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c
1934	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
1935		-Deap_peer_pax_register=eap_peer_method_dynamic_init
1936
1937eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c
1938	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
1939		-Deap_peer_sake_register=eap_peer_method_dynamic_init
1940
1941eap_wsc.so: ../src/eap_peer/eap_wsc.c ../src/eap_common/eap_wsc_common.c ../src/wps/wps.c
1942	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
1943		-Deap_peer_wsc_register=eap_peer_method_dynamic_init
1944
1945eap_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
1946	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
1947		-Deap_peer_ikev2_register=eap_peer_method_dynamic_init
1948
1949eap_eke.so: ../src/eap_peer/eap_eke.c ../src/eap_common/eap_eke_common.c
1950	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
1951		-Deap_peer_eke_register=eap_peer_method_dynamic_init
1952
1953%.so: %.c
1954	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
1955		-D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
1956
1957ifdef CONFIG_CODE_COVERAGE
1958%.o: %.c
1959	@$(E) "  CC " $<
1960	$(Q)cd $(dir $@); $(CC) -c -o $(notdir $@) $(CFLAGS) $(notdir $<)
1961else
1962%.o: %.c
1963	$(Q)$(CC) -c -o $@ $(CFLAGS) $<
1964	@$(E) "  CC " $<
1965endif
1966
1967%.service: %.service.in
1968	$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
1969	@$(E) "  sed" $<
1970
1971%@.service: %.service.arg.in
1972	$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
1973	@$(E) "  sed" $<
1974
1975wpa_supplicant.exe: wpa_supplicant
1976	mv -f $< $@
1977wpa_cli.exe: wpa_cli
1978	mv -f $< $@
1979wpa_passphrase.exe: wpa_passphrase
1980	mv -f $< $@
1981win_if_list.exe: win_if_list
1982	mv -f $< $@
1983eapol_test.exe: eapol_test
1984	mv -f $< $@
1985
1986WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe
1987
1988windows-bin: $(WINALL)
1989	$(STRIP) $(WINALL)
1990
1991wpa_gui:
1992	@echo "wpa_gui has been removed - see wpa_gui-qt4 for replacement"
1993
1994wpa_gui-qt4/Makefile:
1995	qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro
1996
1997wpa_gui-qt4/lang/wpa_gui_de.qm: wpa_gui-qt4/lang/wpa_gui_de.ts
1998	lrelease wpa_gui-qt4/wpa_gui.pro
1999
2000wpa_gui-qt4: wpa_gui-qt4/Makefile wpa_gui-qt4/lang/wpa_gui_de.qm
2001	$(MAKE) -C wpa_gui-qt4
2002
2003FIPSDIR=/usr/local/ssl/fips-2.0
2004FIPSLD=$(FIPSDIR)/bin/fipsld
2005fips:
2006	$(MAKE) CC=$(FIPSLD) FIPSLD_CC="$(CC)"
2007
2008lcov-html: wpa_supplicant.gcda
2009	lcov -c -d .. > lcov.info
2010	genhtml lcov.info --output-directory lcov-html
2011
2012clean:
2013	$(MAKE) -C ../src clean
2014	$(MAKE) -C dbus clean
2015	rm -f core *~ *.o *.d *.gcno *.gcda *.gcov
2016	rm -f eap_*.so $(ALL) $(WINALL) eapol_test preauth_test
2017	rm -f wpa_priv
2018	rm -f nfc_pw_token
2019	rm -f lcov.info
2020	rm -rf lcov-html
2021	rm -f libwpa_client.a
2022	rm -f libwpa_client.so
2023	rm -f libwpa_test1 libwpa_test2
2024
2025-include $(OBJS:%.o=%.d)
2026