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