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