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