]> git.ipfire.org Git - thirdparty/hostap.git/blame - wpa_supplicant/Makefile
P2P: Use P2P Device ID attribute if Device Info not available
[thirdparty/hostap.git] / wpa_supplicant / Makefile
CommitLineData
6fc6879b
JM
1ifndef CC
2CC=gcc
3endif
4
5ifndef CFLAGS
6CFLAGS = -MMD -O2 -Wall -g
7endif
8
d94d4baf
DM
9export LIBDIR ?= /usr/local/lib/
10export BINDIR ?= /usr/local/sbin/
572a171f 11PKG_CONFIG ?= pkg-config
d94d4baf 12
6fc6879b 13CFLAGS += -I../src
6fc6879b 14CFLAGS += -I../src/utils
6fc6879b 15
62b98282
JM
16-include .config
17
ea5cb06e 18BINALL=wpa_supplicant wpa_cli
62b98282
JM
19
20ifndef CONFIG_NO_WPA_PASSPHRASE
ea5cb06e 21BINALL += wpa_passphrase
62b98282 22endif
6fc6879b 23
ea5cb06e 24ALL = $(BINALL)
f0573c79
HG
25ALL += systemd/wpa_supplicant.service
26ALL += systemd/wpa_supplicant@.service
27ALL += systemd/wpa_supplicant-nl80211@.service
28ALL += systemd/wpa_supplicant-wired@.service
29ALL += dbus/fi.epitest.hostap.WPASupplicant.service
30ALL += dbus/fi.w1.wpa_supplicant1.service
31
32
6fc6879b
JM
33all: verify_config $(ALL) dynamic_eap_methods
34
35verify_config:
36 @if [ ! -r .config ]; then \
37 echo 'Building wpa_supplicant requires a configuration file'; \
38 echo '(.config). See README for more instructions. You can'; \
39 echo 'run "cp defconfig .config" to create an example'; \
40 echo 'configuration.'; \
41 exit 1; \
42 fi
43
44mkconfig:
5008cb5e 45 @if [ -f .config ]; then \
6fc6879b
JM
46 echo '.config exists - did not replace it'; \
47 exit 1; \
48 fi
49 echo CONFIG_DRIVER_HOSTAP=y >> .config
50 echo CONFIG_DRIVER_WEXT=y >> .config
6fc6879b 51
b1117643
GE
52$(DESTDIR)$(BINDIR)/%: %
53 install -D $(<) $(@)
54
ea5cb06e 55install: $(addprefix $(DESTDIR)$(BINDIR)/,$(BINALL))
d94d4baf 56 $(MAKE) -C ../src install
6fc6879b
JM
57
58OBJS = config.o
8bac466b 59OBJS += notify.o
34359a3f 60OBJS += bss.o
12760815 61OBJS += eap_register.o
6fc6879b
JM
62OBJS += ../src/utils/common.o
63OBJS += ../src/utils/wpa_debug.o
64OBJS += ../src/utils/wpabuf.o
6fc6879b
JM
65OBJS_p = wpa_passphrase.o
66OBJS_p += ../src/utils/common.o
67OBJS_p += ../src/utils/wpa_debug.o
f042122a 68OBJS_p += ../src/utils/wpabuf.o
6fc6879b 69OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
aee680e8 70OBJS_c += ../src/utils/wpa_debug.o
a624f20b 71OBJS_c += ../src/utils/common.o
6fc6879b 72
6fc6879b
JM
73ifndef CONFIG_OS
74ifdef CONFIG_NATIVE_WINDOWS
75CONFIG_OS=win32
76else
77CONFIG_OS=unix
78endif
79endif
80
81ifeq ($(CONFIG_OS), internal)
82CFLAGS += -DOS_NO_C_LIB_DEFINES
83endif
84
85OBJS += ../src/utils/os_$(CONFIG_OS).o
86OBJS_p += ../src/utils/os_$(CONFIG_OS).o
87OBJS_c += ../src/utils/os_$(CONFIG_OS).o
88
930f704a
JM
89ifdef CONFIG_WPA_TRACE
90CFLAGS += -DWPA_TRACE
91OBJS += ../src/utils/trace.o
fb4baa68
JM
92OBJS_p += ../src/utils/trace.o
93OBJS_c += ../src/utils/trace.o
d5695081 94OBJS_priv += ../src/utils/trace.o
f2f7d965
JM
95LDFLAGS += -rdynamic
96CFLAGS += -funwind-tables
97ifdef CONFIG_WPA_TRACE_BFD
98CFLAGS += -DWPA_TRACE_BFD
99LIBS += -lbfd
100LIBS_p += -lbfd
101LIBS_c += -lbfd
102endif
930f704a
JM
103endif
104
6fc6879b
JM
105ifndef CONFIG_ELOOP
106CONFIG_ELOOP=eloop
107endif
108OBJS += ../src/utils/$(CONFIG_ELOOP).o
cd101567 109OBJS_c += ../src/utils/$(CONFIG_ELOOP).o
6fc6879b 110
2df4c4ef
BG
111ifdef CONFIG_ELOOP_POLL
112CFLAGS += -DCONFIG_ELOOP_POLL
113endif
114
6fc6879b
JM
115
116ifdef CONFIG_EAPOL_TEST
117CFLAGS += -Werror -DEAPOL_TEST
118endif
119
80e8a5ee
BG
120ifdef CONFIG_HT_OVERRIDES
121CFLAGS += -DCONFIG_HT_OVERRIDES
122endif
123
6fc6879b
JM
124ifndef CONFIG_BACKEND
125CONFIG_BACKEND=file
126endif
127
128ifeq ($(CONFIG_BACKEND), file)
129OBJS += config_file.o
130ifndef CONFIG_NO_CONFIG_BLOBS
131NEED_BASE64=y
132endif
133CFLAGS += -DCONFIG_BACKEND_FILE
134endif
135
136ifeq ($(CONFIG_BACKEND), winreg)
137OBJS += config_winreg.o
138endif
139
140ifeq ($(CONFIG_BACKEND), none)
141OBJS += config_none.o
142endif
143
144ifdef CONFIG_NO_CONFIG_WRITE
145CFLAGS += -DCONFIG_NO_CONFIG_WRITE
146endif
147
148ifdef CONFIG_NO_CONFIG_BLOBS
149CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
150endif
151
152ifdef CONFIG_NO_SCAN_PROCESSING
153CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
154endif
155
38b46286
JM
156ifdef CONFIG_IEEE80211W
157CFLAGS += -DCONFIG_IEEE80211W
158NEED_SHA256=y
279d859b 159NEED_AES_OMAC1=y
38b46286
JM
160endif
161
162ifdef CONFIG_IEEE80211R
163CFLAGS += -DCONFIG_IEEE80211R
164OBJS += ../src/rsn_supp/wpa_ft.o
165NEED_80211_COMMON=y
166NEED_SHA256=y
279d859b 167NEED_AES_OMAC1=y
38b46286
JM
168endif
169
281ff0aa
GP
170ifdef CONFIG_TDLS
171CFLAGS += -DCONFIG_TDLS
172OBJS += ../src/rsn_supp/tdls.o
173NEED_SHA256=y
174NEED_AES_OMAC1=y
175endif
176
ba3936d9
AN
177ifdef CONFIG_TDLS_TESTING
178CFLAGS += -DCONFIG_TDLS_TESTING
179endif
180
38b46286
JM
181ifdef CONFIG_PEERKEY
182CFLAGS += -DCONFIG_PEERKEY
183endif
184
185ifndef CONFIG_NO_WPA
186OBJS += ../src/rsn_supp/wpa.o
187OBJS += ../src/rsn_supp/preauth.o
188OBJS += ../src/rsn_supp/pmksa_cache.o
189OBJS += ../src/rsn_supp/peerkey.o
190OBJS += ../src/rsn_supp/wpa_ie.o
191OBJS += ../src/common/wpa_common.o
192NEED_AES=y
193NEED_SHA1=y
194NEED_MD5=y
195NEED_RC4=y
196else
197CFLAGS += -DCONFIG_NO_WPA -DCONFIG_NO_WPA2
198endif
199
200ifdef CONFIG_IBSS_RSN
3680a5db 201NEED_RSN_AUTHENTICATOR=y
38b46286
JM
202CFLAGS += -DCONFIG_IBSS_RSN
203OBJS += ibss_rsn.o
38b46286
JM
204endif
205
b22128ef
JM
206ifdef CONFIG_P2P
207OBJS += p2p_supplicant.o
208OBJS += ../src/p2p/p2p.o
209OBJS += ../src/p2p/p2p_utils.o
210OBJS += ../src/p2p/p2p_parse.o
211OBJS += ../src/p2p/p2p_build.o
212OBJS += ../src/p2p/p2p_go_neg.o
213OBJS += ../src/p2p/p2p_sd.o
214OBJS += ../src/p2p/p2p_pd.o
215OBJS += ../src/p2p/p2p_invitation.o
216OBJS += ../src/p2p/p2p_dev_disc.o
217OBJS += ../src/p2p/p2p_group.o
218OBJS += ../src/ap/p2p_hostapd.o
219CFLAGS += -DCONFIG_P2P
0c840c33 220NEED_GAS=y
24f6497c 221NEED_OFFCHANNEL=y
b22128ef 222NEED_80211_COMMON=y
8271f14a
JM
223CONFIG_WPS=y
224CONFIG_AP=y
b22128ef
JM
225ifdef CONFIG_P2P_STRICT
226CFLAGS += -DCONFIG_P2P_STRICT
227endif
228endif
229
46ee0427 230ifdef CONFIG_INTERWORKING
afc064fe 231OBJS += interworking.o
46ee0427
JM
232CFLAGS += -DCONFIG_INTERWORKING
233NEED_GAS=y
234endif
235
38b46286
JM
236ifdef CONFIG_NO_WPA2
237CFLAGS += -DCONFIG_NO_WPA2
238endif
239
e7cd16ca
JB
240include ../src/drivers/drivers.mak
241ifdef CONFIG_AP
242OBJS_d += $(DRV_BOTH_OBJS)
243CFLAGS += $(DRV_BOTH_CFLAGS)
244LDFLAGS += $(DRV_BOTH_LDFLAGS)
245LIBS += $(DRV_BOTH_LIBS)
246else
247NEED_AP_MLME=
248OBJS_d += $(DRV_WPA_OBJS)
249CFLAGS += $(DRV_WPA_CFLAGS)
250LDFLAGS += $(DRV_WPA_LDFLAGS)
251LIBS += $(DRV_WPA_LIBS)
e519314e
JW
252endif
253
6fc6879b
JM
254ifndef CONFIG_L2_PACKET
255CONFIG_L2_PACKET=linux
256endif
257
258OBJS_l2 += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o
259
260ifeq ($(CONFIG_L2_PACKET), pcap)
261ifdef CONFIG_WINPCAP
262CFLAGS += -DCONFIG_WINPCAP
263LIBS += -lwpcap -lpacket
264LIBS_w += -lwpcap
265else
266LIBS += -ldnet -lpcap
267endif
268endif
269
270ifeq ($(CONFIG_L2_PACKET), winpcap)
271LIBS += -lwpcap -lpacket
272LIBS_w += -lwpcap
273endif
274
275ifeq ($(CONFIG_L2_PACKET), freebsd)
276LIBS += -lpcap
277endif
278
279ifdef CONFIG_EAP_TLS
280# EAP-TLS
281ifeq ($(CONFIG_EAP_TLS), dyn)
282CFLAGS += -DEAP_TLS_DYNAMIC
283EAPDYN += ../src/eap_peer/eap_tls.so
284else
285CFLAGS += -DEAP_TLS
286OBJS += ../src/eap_peer/eap_tls.o
94d9bfd5 287OBJS_h += ../src/eap_server/eap_server_tls.o
6fc6879b
JM
288endif
289TLS_FUNCS=y
290CONFIG_IEEE8021X_EAPOL=y
291endif
292
293ifdef CONFIG_EAP_PEAP
294# EAP-PEAP
295ifeq ($(CONFIG_EAP_PEAP), dyn)
296CFLAGS += -DEAP_PEAP_DYNAMIC
297EAPDYN += ../src/eap_peer/eap_peap.so
298else
299CFLAGS += -DEAP_PEAP
300OBJS += ../src/eap_peer/eap_peap.o
2eeaa5c9 301OBJS += ../src/eap_common/eap_peap_common.o
94d9bfd5 302OBJS_h += ../src/eap_server/eap_server_peap.o
6fc6879b
JM
303endif
304TLS_FUNCS=y
305CONFIG_IEEE8021X_EAPOL=y
6fc6879b
JM
306endif
307
308ifdef CONFIG_EAP_TTLS
309# EAP-TTLS
310ifeq ($(CONFIG_EAP_TTLS), dyn)
311CFLAGS += -DEAP_TTLS_DYNAMIC
312EAPDYN += ../src/eap_peer/eap_ttls.so
313else
314CFLAGS += -DEAP_TTLS
315OBJS += ../src/eap_peer/eap_ttls.o
94d9bfd5 316OBJS_h += ../src/eap_server/eap_server_ttls.o
6fc6879b
JM
317endif
318MS_FUNCS=y
319TLS_FUNCS=y
320CHAP=y
321CONFIG_IEEE8021X_EAPOL=y
322endif
323
324ifdef CONFIG_EAP_MD5
325# EAP-MD5
326ifeq ($(CONFIG_EAP_MD5), dyn)
327CFLAGS += -DEAP_MD5_DYNAMIC
328EAPDYN += ../src/eap_peer/eap_md5.so
329else
330CFLAGS += -DEAP_MD5
331OBJS += ../src/eap_peer/eap_md5.o
94d9bfd5 332OBJS_h += ../src/eap_server/eap_server_md5.o
6fc6879b
JM
333endif
334CHAP=y
335CONFIG_IEEE8021X_EAPOL=y
336endif
337
338# backwards compatibility for old spelling
339ifdef CONFIG_MSCHAPV2
340ifndef CONFIG_EAP_MSCHAPV2
341CONFIG_EAP_MSCHAPV2=y
342endif
343endif
344
345ifdef CONFIG_EAP_MSCHAPV2
346# EAP-MSCHAPv2
347ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
348CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
349EAPDYN += ../src/eap_peer/eap_mschapv2.so
350EAPDYN += ../src/eap_peer/mschapv2.so
351else
352CFLAGS += -DEAP_MSCHAPv2
353OBJS += ../src/eap_peer/eap_mschapv2.o
354OBJS += ../src/eap_peer/mschapv2.o
94d9bfd5 355OBJS_h += ../src/eap_server/eap_server_mschapv2.o
6fc6879b
JM
356endif
357MS_FUNCS=y
358CONFIG_IEEE8021X_EAPOL=y
359endif
360
361ifdef CONFIG_EAP_GTC
362# EAP-GTC
363ifeq ($(CONFIG_EAP_GTC), dyn)
364CFLAGS += -DEAP_GTC_DYNAMIC
365EAPDYN += ../src/eap_peer/eap_gtc.so
366else
367CFLAGS += -DEAP_GTC
368OBJS += ../src/eap_peer/eap_gtc.o
94d9bfd5 369OBJS_h += ../src/eap_server/eap_server_gtc.o
6fc6879b
JM
370endif
371CONFIG_IEEE8021X_EAPOL=y
372endif
373
374ifdef CONFIG_EAP_OTP
375# EAP-OTP
376ifeq ($(CONFIG_EAP_OTP), dyn)
377CFLAGS += -DEAP_OTP_DYNAMIC
378EAPDYN += ../src/eap_peer/eap_otp.so
379else
380CFLAGS += -DEAP_OTP
381OBJS += ../src/eap_peer/eap_otp.o
382endif
383CONFIG_IEEE8021X_EAPOL=y
384endif
385
386ifdef CONFIG_EAP_SIM
387# EAP-SIM
388ifeq ($(CONFIG_EAP_SIM), dyn)
389CFLAGS += -DEAP_SIM_DYNAMIC
390EAPDYN += ../src/eap_peer/eap_sim.so
391else
392CFLAGS += -DEAP_SIM
393OBJS += ../src/eap_peer/eap_sim.o
94d9bfd5 394OBJS_h += ../src/eap_server/eap_server_sim.o
6fc6879b
JM
395endif
396CONFIG_IEEE8021X_EAPOL=y
397CONFIG_EAP_SIM_COMMON=y
bd4e9d03 398NEED_AES_CBC=y
6fc6879b
JM
399endif
400
401ifdef CONFIG_EAP_LEAP
402# EAP-LEAP
403ifeq ($(CONFIG_EAP_LEAP), dyn)
404CFLAGS += -DEAP_LEAP_DYNAMIC
405EAPDYN += ../src/eap_peer/eap_leap.so
406else
407CFLAGS += -DEAP_LEAP
408OBJS += ../src/eap_peer/eap_leap.o
409endif
410MS_FUNCS=y
411CONFIG_IEEE8021X_EAPOL=y
412endif
413
414ifdef CONFIG_EAP_PSK
415# EAP-PSK
416ifeq ($(CONFIG_EAP_PSK), dyn)
417CFLAGS += -DEAP_PSK_DYNAMIC
418EAPDYN += ../src/eap_peer/eap_psk.so
419else
420CFLAGS += -DEAP_PSK
421OBJS += ../src/eap_peer/eap_psk.o ../src/eap_common/eap_psk_common.o
94d9bfd5 422OBJS_h += ../src/eap_server/eap_server_psk.o
6fc6879b
JM
423endif
424CONFIG_IEEE8021X_EAPOL=y
425NEED_AES=y
bd4e9d03
JM
426NEED_AES_OMAC1=y
427NEED_AES_ENCBLOCK=y
428NEED_AES_EAX=y
6fc6879b
JM
429endif
430
431ifdef CONFIG_EAP_AKA
432# EAP-AKA
433ifeq ($(CONFIG_EAP_AKA), dyn)
434CFLAGS += -DEAP_AKA_DYNAMIC
435EAPDYN += ../src/eap_peer/eap_aka.so
436else
437CFLAGS += -DEAP_AKA
438OBJS += ../src/eap_peer/eap_aka.o
94d9bfd5 439OBJS_h += ../src/eap_server/eap_server_aka.o
6fc6879b
JM
440endif
441CONFIG_IEEE8021X_EAPOL=y
442CONFIG_EAP_SIM_COMMON=y
bd4e9d03 443NEED_AES_CBC=y
6fc6879b
JM
444endif
445
8c37556c
JM
446ifdef CONFIG_EAP_AKA_PRIME
447# EAP-AKA'
448ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
449CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
8c37556c
JM
450else
451CFLAGS += -DEAP_AKA_PRIME
8c37556c 452endif
1edb9533 453NEED_SHA256=y
8c37556c
JM
454endif
455
6fc6879b
JM
456ifdef CONFIG_EAP_SIM_COMMON
457OBJS += ../src/eap_common/eap_sim_common.o
458OBJS_h += ../src/eap_server/eap_sim_db.o
459NEED_AES=y
460NEED_FIPS186_2_PRF=y
461endif
462
6fc6879b
JM
463ifdef CONFIG_EAP_FAST
464# EAP-FAST
465ifeq ($(CONFIG_EAP_FAST), dyn)
466CFLAGS += -DEAP_FAST_DYNAMIC
467EAPDYN += ../src/eap_peer/eap_fast.so
a4819630 468EAPDYN += ../src/eap_common/eap_fast_common.o
6fc6879b
JM
469else
470CFLAGS += -DEAP_FAST
471OBJS += ../src/eap_peer/eap_fast.o ../src/eap_peer/eap_fast_pac.o
a4819630 472OBJS += ../src/eap_common/eap_fast_common.o
94d9bfd5 473OBJS_h += ../src/eap_server/eap_server_fast.o
6fc6879b
JM
474endif
475TLS_FUNCS=y
58d1f6d1 476CONFIG_IEEE8021X_EAPOL=y
6fc6879b
JM
477NEED_T_PRF=y
478endif
479
480ifdef CONFIG_EAP_PAX
481# EAP-PAX
482ifeq ($(CONFIG_EAP_PAX), dyn)
483CFLAGS += -DEAP_PAX_DYNAMIC
484EAPDYN += ../src/eap_peer/eap_pax.so
485else
486CFLAGS += -DEAP_PAX
487OBJS += ../src/eap_peer/eap_pax.o ../src/eap_common/eap_pax_common.o
94d9bfd5 488OBJS_h += ../src/eap_server/eap_server_pax.o
6fc6879b
JM
489endif
490CONFIG_IEEE8021X_EAPOL=y
491endif
492
493ifdef CONFIG_EAP_SAKE
494# EAP-SAKE
495ifeq ($(CONFIG_EAP_SAKE), dyn)
496CFLAGS += -DEAP_SAKE_DYNAMIC
497EAPDYN += ../src/eap_peer/eap_sake.so
498else
499CFLAGS += -DEAP_SAKE
500OBJS += ../src/eap_peer/eap_sake.o ../src/eap_common/eap_sake_common.o
94d9bfd5 501OBJS_h += ../src/eap_server/eap_server_sake.o
6fc6879b
JM
502endif
503CONFIG_IEEE8021X_EAPOL=y
504endif
505
506ifdef CONFIG_EAP_GPSK
507# EAP-GPSK
508ifeq ($(CONFIG_EAP_GPSK), dyn)
509CFLAGS += -DEAP_GPSK_DYNAMIC
510EAPDYN += ../src/eap_peer/eap_gpsk.so
511else
512CFLAGS += -DEAP_GPSK
513OBJS += ../src/eap_peer/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o
94d9bfd5 514OBJS_h += ../src/eap_server/eap_server_gpsk.o
6fc6879b
JM
515endif
516CONFIG_IEEE8021X_EAPOL=y
517ifdef CONFIG_EAP_GPSK_SHA256
518CFLAGS += -DEAP_GPSK_SHA256
519endif
520NEED_SHA256=y
bd4e9d03 521NEED_AES_OMAC1=y
6fc6879b
JM
522endif
523
df684d82
DH
524ifdef CONFIG_EAP_PWD
525CFLAGS += -DEAP_PWD
526OBJS += ../src/eap_peer/eap_pwd.o ../src/eap_common/eap_pwd_common.o
527OBJS_h += ../src/eap_server/eap_pwd.o
528CONFIG_IEEE8021X_EAPOL=y
529NEED_SHA256=y
530endif
531
ad08c363 532ifdef CONFIG_WPS
53587ec1
JM
533ifdef CONFIG_WPS2
534CFLAGS += -DCONFIG_WPS2
535endif
536
ad08c363 537# EAP-WSC
ad08c363 538CFLAGS += -DCONFIG_WPS -DEAP_WSC
fa201b69 539OBJS += wps_supplicant.o
ad08c363
JM
540OBJS += ../src/utils/uuid.o
541OBJS += ../src/eap_peer/eap_wsc.o ../src/eap_common/eap_wsc_common.o
542OBJS += ../src/wps/wps.o
543OBJS += ../src/wps/wps_common.o
7d7b8e96
JM
544OBJS += ../src/wps/wps_attr_parse.o
545OBJS += ../src/wps/wps_attr_build.o
546OBJS += ../src/wps/wps_attr_process.o
ad08c363
JM
547OBJS += ../src/wps/wps_dev_attr.o
548OBJS += ../src/wps/wps_enrollee.o
549OBJS += ../src/wps/wps_registrar.o
94d9bfd5 550OBJS_h += ../src/eap_server/eap_server_wsc.o
ad08c363
JM
551CONFIG_IEEE8021X_EAPOL=y
552NEED_DH_GROUPS=y
1edb9533 553NEED_SHA256=y
d9f56262 554NEED_BASE64=y
f1b0de09 555NEED_80211_COMMON=y
0dba0175 556NEED_AES_CBC=y
38b46286 557NEED_MODEXP=y
e1c7954d 558
390cd310
JM
559ifdef CONFIG_WPS_UFD
560CFLAGS += -DCONFIG_WPS_UFD
561OBJS += ../src/wps/wps_ufd.o
116f7bb0
JM
562NEED_WPS_OOB=y
563endif
564
e1ee6b60
MH
565ifdef CONFIG_WPS_NFC
566CFLAGS += -DCONFIG_WPS_NFC
567OBJS += ../src/wps/ndef.o
568OBJS += ../src/wps/wps_nfc.o
569NEED_WPS_OOB=y
570ifdef CONFIG_WPS_NFC_PN531
9cf548c0 571PN531_PATH ?= /usr/local/src/nfc
e1ee6b60
MH
572CFLAGS += -DCONFIG_WPS_NFC_PN531
573CFLAGS += -I${PN531_PATH}/inc
574OBJS += ../src/wps/wps_nfc_pn531.o
575LIBS += ${PN531_PATH}/lib/wpsnfc.dll
576LIBS += ${PN531_PATH}/lib/libnfc_mapping_pn53x.dll
577endif
578endif
579
116f7bb0
JM
580ifdef NEED_WPS_OOB
581CFLAGS += -DCONFIG_WPS_OOB
390cd310
JM
582endif
583
e9bcfebf
JM
584ifdef CONFIG_WPS_ER
585CONFIG_WPS_UPNP=y
586CFLAGS += -DCONFIG_WPS_ER
587OBJS += ../src/wps/wps_er.o
ec72bd0c 588OBJS += ../src/wps/wps_er_ssdp.o
e9bcfebf
JM
589endif
590
e1c7954d
JM
591ifdef CONFIG_WPS_UPNP
592CFLAGS += -DCONFIG_WPS_UPNP
593OBJS += ../src/wps/wps_upnp.o
594OBJS += ../src/wps/wps_upnp_ssdp.o
595OBJS += ../src/wps/wps_upnp_web.o
596OBJS += ../src/wps/wps_upnp_event.o
7e683cee 597OBJS += ../src/wps/wps_upnp_ap.o
0b40d033 598OBJS += ../src/wps/upnp_xml.o
e1c7954d 599OBJS += ../src/wps/httpread.o
092794f4 600OBJS += ../src/wps/http_client.o
b905c4a3 601OBJS += ../src/wps/http_server.o
e1c7954d
JM
602endif
603
cae67937
JM
604ifdef CONFIG_WPS_STRICT
605CFLAGS += -DCONFIG_WPS_STRICT
606OBJS += ../src/wps/wps_validate.o
607endif
608
b4e34f2f
JM
609ifdef CONFIG_WPS_TESTING
610CFLAGS += -DCONFIG_WPS_TESTING
611endif
612
f981eabc
JM
613ifdef CONFIG_WPS_REG_DISABLE_OPEN
614CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
615endif
616
ad08c363
JM
617endif
618
6fc6879b
JM
619ifdef CONFIG_EAP_IKEV2
620# EAP-IKEv2
621ifeq ($(CONFIG_EAP_IKEV2), dyn)
622CFLAGS += -DEAP_IKEV2_DYNAMIC
623EAPDYN += ../src/eap_peer/eap_ikev2.so ../src/eap_peer/ikev2.o
624EAPDYN += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
625else
626CFLAGS += -DEAP_IKEV2
627OBJS += ../src/eap_peer/eap_ikev2.o ../src/eap_peer/ikev2.o
628OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
94d9bfd5 629OBJS_h += ../src/eap_server/eap_server_ikev2.o
6fc6879b
JM
630OBJS_h += ../src/eap_server/ikev2.o
631endif
632CONFIG_IEEE8021X_EAPOL=y
633NEED_DH_GROUPS=y
dd01b1ff 634NEED_DH_GROUPS_ALL=y
38b46286 635NEED_MODEXP=y
be473f3f 636NEED_CIPHER=y
6fc6879b
JM
637endif
638
639ifdef CONFIG_EAP_VENDOR_TEST
640ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
641CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
642EAPDYN += ../src/eap_peer/eap_vendor_test.so
643else
644CFLAGS += -DEAP_VENDOR_TEST
645OBJS += ../src/eap_peer/eap_vendor_test.o
94d9bfd5 646OBJS_h += ../src/eap_server/eap_server_vendor_test.o
6fc6879b
JM
647endif
648CONFIG_IEEE8021X_EAPOL=y
649endif
650
651ifdef CONFIG_EAP_TNC
652# EAP-TNC
653CFLAGS += -DEAP_TNC
654OBJS += ../src/eap_peer/eap_tnc.o
655OBJS += ../src/eap_peer/tncc.o
94d9bfd5 656OBJS_h += ../src/eap_server/eap_server_tnc.o
93ea8ed0 657OBJS_h += ../src/eap_server/tncs.o
6fc6879b 658NEED_BASE64=y
53c256a4 659ifndef CONFIG_NATIVE_WINDOWS
7d737d6b 660ifndef CONFIG_DRIVER_BSD
b77eab28 661LIBS += -ldl
6fc6879b 662endif
53c256a4 663endif
7d737d6b 664endif
6fc6879b
JM
665
666ifdef CONFIG_IEEE8021X_EAPOL
667# IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
668CFLAGS += -DIEEE8021X_EAPOL
25c226ea
JM
669OBJS += ../src/eapol_supp/eapol_supp_sm.o
670OBJS += ../src/eap_peer/eap.o ../src/eap_peer/eap_methods.o
671NEED_EAP_COMMON=y
6fc6879b
JM
672ifdef CONFIG_DYNAMIC_EAP_METHODS
673CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
674LIBS += -ldl -rdynamic
675endif
676endif
677
1581b38b 678ifdef CONFIG_AP
37a86b7b 679NEED_80211_COMMON=y
25c226ea 680NEED_EAP_COMMON=y
3680a5db 681NEED_RSN_AUTHENTICATOR=y
1581b38b 682CFLAGS += -DCONFIG_AP
f1a48710
JM
683OBJS += ap.o
684CFLAGS += -DCONFIG_NO_RADIUS
685CFLAGS += -DCONFIG_NO_ACCOUNTING
686CFLAGS += -DCONFIG_NO_VLAN
70db2ab3
JM
687OBJS += ../src/ap/hostapd.o
688OBJS += ../src/ap/wpa_auth_glue.o
32da61d9 689OBJS += ../src/ap/utils.o
2586bc64 690OBJS += ../src/ap/authsrv.o
6226e38d 691OBJS += ../src/ap/ap_config.o
2d5b792d 692OBJS += ../src/utils/ip_addr.o
1057d78e
JM
693OBJS += ../src/ap/sta_info.o
694OBJS += ../src/ap/tkip_countermeasures.o
6226e38d 695OBJS += ../src/ap/ap_mlme.o
1057d78e 696OBJS += ../src/ap/ieee802_1x.o
281c950b 697OBJS += ../src/eapol_auth/eapol_auth_sm.o
1057d78e 698OBJS += ../src/ap/ieee802_11_auth.o
d4370eac 699OBJS += ../src/ap/ieee802_11_shared.o
70db2ab3
JM
700OBJS += ../src/ap/drv_callbacks.o
701OBJS += ../src/ap/ap_drv_ops.o
062390ef 702OBJS += ../src/ap/beacon.o
34dbfc0c
JM
703ifdef CONFIG_IEEE80211N
704OBJS += ../src/ap/ieee802_11_ht.o
705endif
e653b622 706ifdef CONFIG_CTRL_IFACE
0e2d35c6 707OBJS += ../src/ap/ctrl_iface_ap.o
e653b622 708endif
f1a48710 709
12760815 710CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
94d9bfd5
JM
711OBJS += ../src/eap_server/eap_server.o
712OBJS += ../src/eap_server/eap_server_identity.o
713OBJS += ../src/eap_server/eap_server_methods.o
f1a48710 714
803a811b
JM
715ifdef CONFIG_IEEE80211N
716CFLAGS += -DCONFIG_IEEE80211N
717endif
718
f1a48710 719ifdef NEED_AP_MLME
1057d78e
JM
720OBJS += ../src/ap/wmm.o
721OBJS += ../src/ap/ap_list.o
722OBJS += ../src/ap/ieee802_11.o
70db2ab3 723OBJS += ../src/ap/hw_features.o
fe6bdb77 724CFLAGS += -DNEED_AP_MLME
f1a48710
JM
725endif
726ifdef CONFIG_WPS
727CFLAGS += -DEAP_SERVER_WSC
32da61d9 728OBJS += ../src/ap/wps_hostapd.o
94d9bfd5 729OBJS += ../src/eap_server/eap_server_wsc.o
f1a48710 730endif
1d4839ee
JM
731ifdef CONFIG_INTERWORKING
732OBJS += ../src/ap/gas_serv.o
733endif
1581b38b
JM
734endif
735
3680a5db
JM
736ifdef NEED_RSN_AUTHENTICATOR
737CFLAGS += -DCONFIG_NO_RADIUS
738NEED_AES_WRAP=y
6226e38d 739OBJS += ../src/ap/wpa_auth.o
1057d78e 740OBJS += ../src/ap/wpa_auth_ie.o
6226e38d 741OBJS += ../src/ap/pmksa_cache_auth.o
3680a5db 742ifdef CONFIG_IEEE80211R
6226e38d 743OBJS += ../src/ap/wpa_auth_ft.o
3680a5db
JM
744endif
745ifdef CONFIG_PEERKEY
6226e38d 746OBJS += ../src/ap/peerkey_auth.o
3680a5db
JM
747endif
748endif
749
6fc6879b
JM
750ifdef CONFIG_EAP_SERVER
751CFLAGS += -DEAP_SERVER
94d9bfd5
JM
752OBJS_h += ../src/eap_server/eap_server.o
753OBJS_h += ../src/eap_server/eap_server_identity.o
754OBJS_h += ../src/eap_server/eap_server_methods.o
6fc6879b
JM
755endif
756
757ifdef CONFIG_RADIUS_CLIENT
758OBJS_h += ../src/utils/ip_addr.o
759OBJS_h += ../src/radius/radius.o
760OBJS_h += ../src/radius/radius_client.o
761endif
762
763ifdef CONFIG_AUTHENTICATOR
bed4d574 764OBJS_h += ../src/eapol_auth/eapol_auth_sm.o
1057d78e 765OBJS_h += ../src/ap/ieee802_1x.o
6fc6879b
JM
766endif
767
768ifdef CONFIG_WPA_AUTHENTICATOR
6226e38d 769OBJS_h += ../src/ap/wpa_auth.o
1057d78e 770OBJS_h += ../src/ap/wpa_auth_ie.o
6226e38d 771OBJS_h += ../src/ap/pmksa_cache_auth.o
6fc6879b 772ifdef CONFIG_IEEE80211R
6226e38d 773OBJS_h += ../src/ap/wpa_auth_ft.o
6fc6879b
JM
774endif
775ifdef CONFIG_PEERKEY
6226e38d 776OBJS_h += ../src/ap/peerkey_auth.o
6fc6879b
JM
777endif
778endif
779
780ifdef CONFIG_PCSC
781# PC/SC interface for smartcards (USIM, GSM SIM)
782CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
783OBJS += ../src/utils/pcsc_funcs.o
784# -lpthread may not be needed depending on how pcsc-lite was configured
785ifdef CONFIG_NATIVE_WINDOWS
786#Once MinGW gets support for WinScard, -lwinscard could be used instead of the
787#dynamic symbol loading that is now used in pcsc_funcs.c
788#LIBS += -lwinscard
789else
790LIBS += -lpcsclite -lpthread
791endif
792endif
793
81eec387
JM
794ifdef CONFIG_SIM_SIMULATOR
795CFLAGS += -DCONFIG_SIM_SIMULATOR
796NEED_MILENAGE=y
797endif
798
2a24bb31
JM
799ifdef CONFIG_USIM_SIMULATOR
800CFLAGS += -DCONFIG_USIM_SIMULATOR
81eec387
JM
801NEED_MILENAGE=y
802endif
803
804ifdef NEED_MILENAGE
43df4cc2 805OBJS += ../src/crypto/milenage.o
5e67037b 806NEED_AES_ENCBLOCK=y
2a24bb31
JM
807endif
808
71374569
JM
809ifdef CONFIG_PKCS12
810CFLAGS += -DPKCS12_FUNCS
811endif
812
813ifdef CONFIG_SMARTCARD
814CFLAGS += -DCONFIG_SMARTCARD
815endif
816
817ifdef MS_FUNCS
818OBJS += ../src/crypto/ms_funcs.o
38b46286
JM
819NEED_DES=y
820NEED_MD4=y
71374569
JM
821endif
822
823ifdef CHAP
824OBJS += ../src/eap_common/chap.o
825endif
826
6fc6879b 827ifdef TLS_FUNCS
38b46286 828NEED_DES=y
6fc6879b 829# Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
6fc6879b 830OBJS += ../src/eap_peer/eap_tls_common.o
94d9bfd5 831OBJS_h += ../src/eap_server/eap_server_tls_common.o
6fc6879b 832NEED_TLS_PRF=y
000bbd77
JM
833endif
834
38b46286
JM
835ifndef CONFIG_TLS
836CONFIG_TLS=openssl
837endif
838
5c47af9a
JM
839ifdef CONFIG_TLSV11
840CFLAGS += -DCONFIG_TLSV11
841endif
842
ca84eed7
JM
843ifdef CONFIG_TLSV12
844CFLAGS += -DCONFIG_TLSV12
845NEED_SHA256=y
846endif
847
6fc6879b 848ifeq ($(CONFIG_TLS), openssl)
38b46286 849ifdef TLS_FUNCS
6fc6879b
JM
850CFLAGS += -DEAP_TLS_OPENSSL
851OBJS += ../src/crypto/tls_openssl.o
38b46286
JM
852LIBS += -lssl
853endif
854OBJS += ../src/crypto/crypto_openssl.o
855OBJS_p += ../src/crypto/crypto_openssl.o
856ifdef NEED_FIPS186_2_PRF
857OBJS += ../src/crypto/fips_prf_openssl.o
858endif
859LIBS += -lcrypto
6fc6879b
JM
860LIBS_p += -lcrypto
861endif
38b46286 862
6fc6879b 863ifeq ($(CONFIG_TLS), gnutls)
38b46286 864ifdef TLS_FUNCS
6fc6879b 865OBJS += ../src/crypto/tls_gnutls.o
38b46286 866LIBS += -lgnutls -lgpg-error
6fc6879b 867endif
6fc6879b
JM
868OBJS += ../src/crypto/crypto_gnutls.o
869OBJS_p += ../src/crypto/crypto_gnutls.o
05edfe29
JB
870ifdef NEED_FIPS186_2_PRF
871OBJS += ../src/crypto/fips_prf_gnutls.o
05edfe29 872endif
38b46286
JM
873LIBS += -lgcrypt
874LIBS_p += -lgcrypt
6fc6879b 875CONFIG_INTERNAL_SHA256=y
ac73690c 876CONFIG_INTERNAL_RC4=y
f042122a 877CONFIG_INTERNAL_DH_GROUP5=y
6fc6879b 878endif
38b46286 879
6fc6879b 880ifeq ($(CONFIG_TLS), schannel)
38b46286
JM
881ifdef TLS_FUNCS
882OBJS += ../src/crypto/tls_schannel.o
883endif
6fc6879b
JM
884OBJS += ../src/crypto/crypto_cryptoapi.o
885OBJS_p += ../src/crypto/crypto_cryptoapi.o
94c3e91f
JM
886ifdef NEED_FIPS186_2_PRF
887OBJS += ../src/crypto/fips_prf_cryptoapi.o
888endif
6fc6879b 889CONFIG_INTERNAL_SHA256=y
ac73690c 890CONFIG_INTERNAL_RC4=y
f042122a 891CONFIG_INTERNAL_DH_GROUP5=y
6fc6879b 892endif
38b46286 893
289ffc2b 894ifeq ($(CONFIG_TLS), nss)
38b46286
JM
895ifdef TLS_FUNCS
896OBJS += ../src/crypto/tls_nss.o
897LIBS += -lssl3
898endif
289ffc2b
JM
899OBJS += ../src/crypto/crypto_nss.o
900OBJS_p += ../src/crypto/crypto_nss.o
289ffc2b
JM
901ifdef NEED_FIPS186_2_PRF
902OBJS += ../src/crypto/fips_prf_nss.o
903endif
38b46286
JM
904LIBS += -lnss3
905LIBS_p += -lnss3
906CONFIG_INTERNAL_MD4=y
f042122a 907CONFIG_INTERNAL_DH_GROUP5=y
289ffc2b 908endif
38b46286 909
6fc6879b 910ifeq ($(CONFIG_TLS), internal)
38b46286
JM
911ifndef CONFIG_CRYPTO
912CONFIG_CRYPTO=internal
913endif
914ifdef TLS_FUNCS
be473f3f 915OBJS += ../src/crypto/crypto_internal-rsa.o
38b46286
JM
916OBJS += ../src/crypto/tls_internal.o
917OBJS += ../src/tls/tlsv1_common.o
918OBJS += ../src/tls/tlsv1_record.o
919OBJS += ../src/tls/tlsv1_cred.o
920OBJS += ../src/tls/tlsv1_client.o
921OBJS += ../src/tls/tlsv1_client_write.o
922OBJS += ../src/tls/tlsv1_client_read.o
923OBJS += ../src/tls/asn1.o
924OBJS += ../src/tls/rsa.o
925OBJS += ../src/tls/x509v3.o
f1739bac
JM
926OBJS += ../src/tls/pkcs1.o
927OBJS += ../src/tls/pkcs5.o
928OBJS += ../src/tls/pkcs8.o
1a707778 929NEED_SHA256=y
38b46286
JM
930NEED_BASE64=y
931NEED_TLS_PRF=y
ca84eed7
JM
932ifdef CONFIG_TLSV12
933NEED_TLS_PRF_SHA256=y
934endif
38b46286 935NEED_MODEXP=y
be473f3f 936NEED_CIPHER=y
38b46286
JM
937CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
938endif
be473f3f
JM
939ifdef NEED_CIPHER
940NEED_DES=y
941OBJS += ../src/crypto/crypto_internal-cipher.o
942endif
38b46286 943ifdef NEED_MODEXP
be473f3f 944OBJS += ../src/crypto/crypto_internal-modexp.o
38b46286 945OBJS += ../src/tls/bignum.o
38b46286 946endif
6fc6879b
JM
947ifeq ($(CONFIG_CRYPTO), libtomcrypt)
948OBJS += ../src/crypto/crypto_libtomcrypt.o
949OBJS_p += ../src/crypto/crypto_libtomcrypt.o
38b46286
JM
950LIBS += -ltomcrypt -ltfm
951LIBS_p += -ltomcrypt -ltfm
6fc6879b 952CONFIG_INTERNAL_SHA256=y
ac73690c 953CONFIG_INTERNAL_RC4=y
f042122a 954CONFIG_INTERNAL_DH_GROUP5=y
6fc6879b
JM
955endif
956ifeq ($(CONFIG_CRYPTO), internal)
38b46286
JM
957OBJS += ../src/crypto/crypto_internal.o
958OBJS_p += ../src/crypto/crypto_internal.o
73d0ad78 959NEED_AES_ENC=y
6fc6879b 960CFLAGS += -DCONFIG_CRYPTO_INTERNAL
049a292f
JM
961ifdef CONFIG_INTERNAL_LIBTOMMATH
962CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
963ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
964CFLAGS += -DLTM_FAST
965endif
966else
967LIBS += -ltommath
968LIBS_p += -ltommath
969endif
6fc6879b
JM
970CONFIG_INTERNAL_AES=y
971CONFIG_INTERNAL_DES=y
972CONFIG_INTERNAL_SHA1=y
973CONFIG_INTERNAL_MD4=y
974CONFIG_INTERNAL_MD5=y
975CONFIG_INTERNAL_SHA256=y
ac73690c 976CONFIG_INTERNAL_RC4=y
f042122a 977CONFIG_INTERNAL_DH_GROUP5=y
6fc6879b
JM
978endif
979ifeq ($(CONFIG_CRYPTO), cryptoapi)
980OBJS += ../src/crypto/crypto_cryptoapi.o
981OBJS_p += ../src/crypto/crypto_cryptoapi.o
982CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
983CONFIG_INTERNAL_SHA256=y
ac73690c 984CONFIG_INTERNAL_RC4=y
6fc6879b
JM
985endif
986endif
38b46286 987
6fc6879b 988ifeq ($(CONFIG_TLS), none)
38b46286
JM
989ifdef TLS_FUNCS
990OBJS += ../src/crypto/tls_none.o
991CFLAGS += -DEAP_TLS_NONE
992CONFIG_INTERNAL_AES=y
993CONFIG_INTERNAL_SHA1=y
994CONFIG_INTERNAL_MD5=y
995endif
6fc6879b
JM
996OBJS += ../src/crypto/crypto_none.o
997OBJS_p += ../src/crypto/crypto_none.o
998CONFIG_INTERNAL_SHA256=y
ac73690c 999CONFIG_INTERNAL_RC4=y
6fc6879b 1000endif
38b46286
JM
1001
1002ifdef TLS_FUNCS
1003ifdef CONFIG_SMARTCARD
1004ifndef CONFIG_NATIVE_WINDOWS
1005ifneq ($(CONFIG_L2_PACKET), freebsd)
1006LIBS += -ldl
1007endif
1008endif
1009endif
1010endif
1011
1012ifndef TLS_FUNCS
1013OBJS += ../src/crypto/tls_none.o
1014ifeq ($(CONFIG_TLS), internal)
6fc6879b
JM
1015CONFIG_INTERNAL_AES=y
1016CONFIG_INTERNAL_SHA1=y
1017CONFIG_INTERNAL_MD5=y
9d388d50 1018CONFIG_INTERNAL_RC4=y
6fc6879b 1019endif
38b46286 1020endif
6fc6879b 1021
38b46286 1022AESOBJS = # none so far (see below)
6fc6879b 1023ifdef CONFIG_INTERNAL_AES
381fcbc9 1024AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-dec.o
6fc6879b 1025endif
38b46286
JM
1026
1027AESOBJS += ../src/crypto/aes-unwrap.o
bd4e9d03 1028ifdef NEED_AES_EAX
38b46286 1029AESOBJS += ../src/crypto/aes-eax.o
bd4e9d03
JM
1030NEED_AES_CTR=y
1031endif
1032ifdef NEED_AES_CTR
1033AESOBJS += ../src/crypto/aes-ctr.o
1034endif
1035ifdef NEED_AES_ENCBLOCK
38b46286 1036AESOBJS += ../src/crypto/aes-encblock.o
bd4e9d03
JM
1037endif
1038ifdef NEED_AES_OMAC1
279d859b 1039NEED_AES_ENC=y
38b46286 1040AESOBJS += ../src/crypto/aes-omac1.o
bd4e9d03
JM
1041endif
1042ifdef NEED_AES_WRAP
3afe7b61 1043NEED_AES_ENC=y
38b46286
JM
1044AESOBJS += ../src/crypto/aes-wrap.o
1045endif
1046ifdef NEED_AES_CBC
279d859b
MH
1047NEED_AES_ENC=y
1048AESOBJS += ../src/crypto/aes-cbc.o
1049endif
1050ifdef NEED_AES_ENC
38b46286
JM
1051ifdef CONFIG_INTERNAL_AES
1052AESOBJS += ../src/crypto/aes-internal-enc.o
1053endif
38b46286
JM
1054endif
1055ifdef NEED_AES
1056OBJS += $(AESOBJS)
38b46286
JM
1057endif
1058
1059ifdef NEED_SHA1
1060SHA1OBJS += ../src/crypto/sha1.o
6fc6879b 1061ifdef CONFIG_INTERNAL_SHA1
928a50a3 1062SHA1OBJS += ../src/crypto/sha1-internal.o
05edfe29
JB
1063ifdef NEED_FIPS186_2_PRF
1064SHA1OBJS += ../src/crypto/fips_prf_internal.o
1065endif
6fc6879b 1066endif
62b98282
JM
1067ifdef CONFIG_NO_WPA_PASSPHRASE
1068CFLAGS += -DCONFIG_NO_PBKDF2
1069else
38b46286
JM
1070SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
1071endif
1072ifdef NEED_T_PRF
1073SHA1OBJS += ../src/crypto/sha1-tprf.o
1074endif
1075ifdef NEED_TLS_PRF
1076SHA1OBJS += ../src/crypto/sha1-tlsprf.o
1077endif
1078endif
1079
1080MD5OBJS = ../src/crypto/md5.o
1081ifdef NEED_MD5
6fc6879b 1082ifdef CONFIG_INTERNAL_MD5
ad01a531 1083MD5OBJS += ../src/crypto/md5-internal.o
6fc6879b 1084endif
38b46286
JM
1085ifdef CONFIG_FIPS
1086MD5OBJS += ../src/crypto/md5-non-fips.o
6fc6879b 1087endif
38b46286 1088OBJS += $(MD5OBJS)
3e91d242 1089OBJS_p += $(MD5OBJS)
38b46286
JM
1090endif
1091
1092ifdef NEED_MD4
1093ifdef CONFIG_INTERNAL_MD4
1094OBJS += ../src/crypto/md4-internal.o
1095endif
1096endif
bd4e2895 1097
38b46286
JM
1098DESOBJS = # none needed when not internal
1099ifdef NEED_DES
6fc6879b 1100ifdef CONFIG_INTERNAL_DES
657f0381 1101DESOBJS += ../src/crypto/des-internal.o
6fc6879b 1102endif
38b46286 1103endif
6fc6879b 1104
38b46286 1105ifdef NEED_RC4
ac73690c
JM
1106ifdef CONFIG_INTERNAL_RC4
1107OBJS += ../src/crypto/rc4.o
1108endif
1d8ce433
JM
1109endif
1110
38b46286 1111SHA256OBJS = # none by default
6fc6879b 1112ifdef NEED_SHA256
00468b46 1113CFLAGS += -DCONFIG_SHA256
598a792d 1114SHA256OBJS += ../src/crypto/sha256.o
598a792d
JB
1115ifdef CONFIG_INTERNAL_SHA256
1116SHA256OBJS += ../src/crypto/sha256-internal.o
1117endif
83074898
JM
1118ifdef NEED_TLS_PRF_SHA256
1119SHA256OBJS += ../src/crypto/sha256-tlsprf.o
1120endif
598a792d 1121OBJS += $(SHA256OBJS)
38b46286
JM
1122endif
1123
38b46286
JM
1124ifdef NEED_DH_GROUPS
1125OBJS += ../src/crypto/dh_groups.o
38b46286 1126endif
38b46286 1127ifdef NEED_DH_GROUPS_ALL
38b46286
JM
1128CFLAGS += -DALL_DH_GROUPS
1129endif
50ceddcf
JM
1130ifdef CONFIG_INTERNAL_DH_GROUP5
1131ifdef NEED_DH_GROUPS
1132OBJS += ../src/crypto/dh_group5.o
1133endif
38b46286 1134endif
6fc6879b 1135
bbb921da
JM
1136ifdef CONFIG_NO_RANDOM_POOL
1137CFLAGS += -DCONFIG_NO_RANDOM_POOL
1138else
1139OBJS += ../src/crypto/random.o
1140endif
1141
6fc6879b
JM
1142ifdef CONFIG_CTRL_IFACE
1143ifeq ($(CONFIG_CTRL_IFACE), y)
1144ifdef CONFIG_NATIVE_WINDOWS
1145CONFIG_CTRL_IFACE=named_pipe
1146else
1147CONFIG_CTRL_IFACE=unix
1148endif
1149endif
1150CFLAGS += -DCONFIG_CTRL_IFACE
1151ifeq ($(CONFIG_CTRL_IFACE), unix)
1152CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
1153endif
1154ifeq ($(CONFIG_CTRL_IFACE), udp)
1155CFLAGS += -DCONFIG_CTRL_IFACE_UDP
1156endif
1157ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
1158CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
1159endif
1160OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o
1161endif
1162
1163ifdef CONFIG_CTRL_IFACE_DBUS
8ddef94b 1164DBUS=y
8fc2fb56 1165DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
bacfd05f 1166DBUS_OBJS += dbus/dbus_old.o dbus/dbus_old_handlers.o
36da1358 1167ifdef CONFIG_WPS
bacfd05f 1168DBUS_OBJS += dbus/dbus_old_handlers_wps.o
36da1358 1169endif
19b3211d 1170DBUS_OBJS += dbus/dbus_dict_helpers.o
6fc6879b 1171ifndef DBUS_LIBS
572a171f 1172DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
6fc6879b 1173endif
6fc6879b 1174ifndef DBUS_INCLUDE
572a171f 1175DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
6fc6879b 1176endif
8fc2fb56
WS
1177DBUS_CFLAGS += $(DBUS_INCLUDE)
1178endif
1179
1180ifdef CONFIG_CTRL_IFACE_DBUS_NEW
8ddef94b 1181DBUS=y
8fc2fb56 1182DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
19b3211d 1183DBUS_OBJS ?= dbus/dbus_dict_helpers.o
a206a29a
JM
1184DBUS_OBJS += dbus/dbus_new_helpers.o
1185DBUS_OBJS += dbus/dbus_new.o dbus/dbus_new_handlers.o
36da1358
JM
1186ifdef CONFIG_WPS
1187DBUS_OBJS += dbus/dbus_new_handlers_wps.o
1188endif
9abafccc
JB
1189ifdef CONFIG_P2P
1190DBUS_OBJS += dbus/dbus_new_handlers_p2p.o
1191endif
8fc2fb56 1192ifndef DBUS_LIBS
572a171f 1193DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
8fc2fb56
WS
1194endif
1195ifndef DBUS_INCLUDE
572a171f 1196DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
8fc2fb56
WS
1197endif
1198ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
04551ee6 1199DBUS_OBJS += dbus/dbus_new_introspect.o
8fc2fb56 1200DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
6fc6879b 1201endif
8fc2fb56
WS
1202DBUS_CFLAGS += $(DBUS_INCLUDE)
1203endif
1204
8ddef94b
JM
1205ifdef DBUS
1206DBUS_CFLAGS += -DCONFIG_DBUS
1207DBUS_OBJS += dbus/dbus_common.o
1208endif
1209
8fc2fb56
WS
1210OBJS += $(DBUS_OBJS)
1211CFLAGS += $(DBUS_CFLAGS)
1212LIBS += $(DBUS_LIBS)
6fc6879b
JM
1213
1214ifdef CONFIG_READLINE
e8ecb5fb 1215OBJS_c += ../src/utils/edit_readline.o
6fc6879b 1216LIBS_c += -lncurses -lreadline
82a855bd 1217else
aee680e8 1218ifdef CONFIG_WPA_CLI_EDIT
82a855bd
JM
1219OBJS_c += ../src/utils/edit.o
1220else
1221OBJS_c += ../src/utils/edit_simple.o
1222endif
aee680e8
JM
1223endif
1224
6fc6879b
JM
1225ifdef CONFIG_NATIVE_WINDOWS
1226CFLAGS += -DCONFIG_NATIVE_WINDOWS
1227LIBS += -lws2_32 -lgdi32 -lcrypt32
1228LIBS_c += -lws2_32
1229LIBS_p += -lws2_32 -lgdi32
1230ifeq ($(CONFIG_CRYPTO), cryptoapi)
1231LIBS_p += -lcrypt32
1232endif
1233endif
1234
1235ifdef CONFIG_NO_STDOUT_DEBUG
1236CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
1237ifndef CONFIG_CTRL_IFACE
1238CFLAGS += -DCONFIG_NO_WPA_MSG
1239endif
1240endif
1241
1242ifdef CONFIG_IPV6
1243# for eapol_test only
1244CFLAGS += -DCONFIG_IPV6
1245endif
1246
6fc6879b
JM
1247ifdef NEED_BASE64
1248OBJS += ../src/utils/base64.o
1249endif
1250
c2a04078 1251ifdef NEED_SME
20e26395 1252NEED_80211_COMMON=y
c2a04078
JM
1253OBJS += sme.o
1254CFLAGS += -DCONFIG_SME
1255endif
1256
26c9d7ea
JM
1257ifdef NEED_80211_COMMON
1258OBJS += ../src/common/ieee802_11_common.o
6fc6879b
JM
1259endif
1260
25c226ea
JM
1261ifdef NEED_EAP_COMMON
1262OBJS += ../src/eap_common/eap_common.o
1263endif
1264
6fc6879b
JM
1265ifndef CONFIG_MAIN
1266CONFIG_MAIN=main
1267endif
1268
cca87731
SL
1269ifdef CONFIG_DEBUG_SYSLOG
1270CFLAGS += -DCONFIG_DEBUG_SYSLOG
3e199621
SL
1271ifdef CONFIG_DEBUG_SYSLOG_FACILITY
1272CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
1273endif
cca87731
SL
1274endif
1275
6fc6879b
JM
1276ifdef CONFIG_DEBUG_FILE
1277CFLAGS += -DCONFIG_DEBUG_FILE
1278endif
1279
46690a3b
JM
1280ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
1281CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
1282endif
1283
577072b1
JM
1284ifdef CONFIG_FIPS
1285CFLAGS += -DCONFIG_FIPS
577072b1
JM
1286endif
1287
657f0381 1288OBJS += $(SHA1OBJS) $(DESOBJS)
928a50a3 1289
be473f3f 1290OBJS_p += $(SHA1OBJS)
48f24f93 1291OBJS_p += $(SHA256OBJS)
6fc6879b 1292
60b94c98
JM
1293ifdef CONFIG_BGSCAN_SIMPLE
1294CFLAGS += -DCONFIG_BGSCAN_SIMPLE
1295OBJS += bgscan_simple.o
1296NEED_BGSCAN=y
1297endif
1298
c4d71c25
JM
1299ifdef CONFIG_BGSCAN_LEARN
1300CFLAGS += -DCONFIG_BGSCAN_LEARN
1301OBJS += bgscan_learn.o
1302NEED_BGSCAN=y
1303endif
1304
60b94c98
JM
1305ifdef NEED_BGSCAN
1306CFLAGS += -DCONFIG_BGSCAN
1307OBJS += bgscan.o
1308endif
1309
0c840c33
JM
1310ifdef NEED_GAS
1311OBJS += ../src/common/gas.o
04ea7b79
JM
1312OBJS += gas_query.o
1313CFLAGS += -DCONFIG_GAS
24f6497c
JM
1314NEED_OFFCHANNEL=y
1315endif
1316
1317ifdef NEED_OFFCHANNEL
1318OBJS += offchannel.o
1319CFLAGS += -DCONFIG_OFFCHANNEL
0c840c33
JM
1320endif
1321
aea855d7
JM
1322OBJS += ../src/drivers/driver_common.o
1323
17fbb751 1324OBJS_wpa_rm := ctrl_iface.o ctrl_iface_unix.o
6fc6879b
JM
1325OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.o
1326ifdef CONFIG_AUTHENTICATOR
1327OBJS_wpa += tests/link_test.o
1328endif
1329OBJS_wpa += $(OBJS_l2)
1330OBJS += wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o
74784010
JM
1331OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o
1332OBJS_t += ../src/radius/radius_client.o
a7baefda 1333OBJS_t += ../src/radius/radius.o
74784010 1334ifndef CONFIG_AP
6fc6879b 1335OBJS_t += ../src/utils/ip_addr.o
74784010 1336endif
6fc6879b
JM
1337OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o
1338OBJS += $(CONFIG_MAIN).o
1339
1340ifdef CONFIG_PRIVSEP
d1f9c410 1341OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o
6fc6879b
JM
1342OBJS_priv += $(OBJS_l2)
1343OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
1344OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
1345OBJS_priv += ../src/utils/common.o
1346OBJS_priv += ../src/utils/wpa_debug.o
716d543d 1347OBJS_priv += ../src/utils/wpabuf.o
6fc6879b 1348OBJS_priv += wpa_priv.o
8d263912
JM
1349ifdef CONFIG_DRIVER_NL80211
1350OBJS_priv += ../src/common/ieee802_11_common.o
1351endif
6fc6879b 1352ifdef CONFIG_DRIVER_TEST
928a50a3 1353OBJS_priv += $(SHA1OBJS)
ad01a531 1354OBJS_priv += $(MD5OBJS)
6fc6879b
JM
1355ifeq ($(CONFIG_TLS), openssl)
1356OBJS_priv += ../src/crypto/crypto_openssl.o
1357endif
1358ifeq ($(CONFIG_TLS), gnutls)
1359OBJS_priv += ../src/crypto/crypto_gnutls.o
1360endif
289ffc2b
JM
1361ifeq ($(CONFIG_TLS), nss)
1362OBJS_priv += ../src/crypto/crypto_nss.o
1363endif
6fc6879b
JM
1364ifeq ($(CONFIG_TLS), internal)
1365ifeq ($(CONFIG_CRYPTO), libtomcrypt)
1366OBJS_priv += ../src/crypto/crypto_libtomcrypt.o
1367else
1368OBJS_priv += ../src/crypto/crypto_internal.o
1369endif
1370endif
1371endif # CONFIG_DRIVER_TEST
1372OBJS += ../src/l2_packet/l2_packet_privsep.o
1373OBJS += ../src/drivers/driver_privsep.o
1374EXTRA_progs += wpa_priv
1375else
1376OBJS += $(OBJS_d) ../src/drivers/drivers.o
1377OBJS += $(OBJS_l2)
1378endif
1379
1380ifdef CONFIG_NDIS_EVENTS_INTEGRATED
1381CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
1382OBJS += ../src/drivers/ndis_events.o
1383EXTRALIBS += -loleaut32 -lole32 -luuid
1384ifdef PLATFORMSDKLIB
1385EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
1386else
1387EXTRALIBS += WbemUuid.Lib
1388endif
1389endif
1390
1391ifndef LDO
1392LDO=$(CC)
1393endif
1394
586bad51
JM
1395Q=@
1396E=echo
1397ifeq ($(V), 1)
1398Q=
1399E=true
1400endif
1401
6fc6879b
JM
1402dynamic_eap_methods: $(EAPDYN)
1403
ba30964b 1404../src/drivers/build.wpa_supplicant:
5008cb5e 1405 @if [ -f ../src/drivers/build.hostapd ]; then \
ba30964b
JM
1406 $(MAKE) -C ../src/drivers clean; \
1407 fi
1408 @touch ../src/drivers/build.wpa_supplicant
1409
1410BCHECK=../src/drivers/build.wpa_supplicant
1411
1412wpa_priv: $(BCHECK) $(OBJS_priv)
586bad51
JM
1413 $(Q)$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
1414 @$(E) " LD " $@
6fc6879b 1415
8205c82a
AD
1416$(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
1417
1418wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
586bad51
JM
1419 $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
1420 @$(E) " LD " $@
6fc6879b 1421
8205c82a 1422eapol_test: $(OBJS_t)
586bad51
JM
1423 $(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
1424 @$(E) " LD " $@
6fc6879b 1425
8205c82a 1426preauth_test: $(OBJS_t2)
586bad51
JM
1427 $(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
1428 @$(E) " LD " $@
6fc6879b
JM
1429
1430wpa_passphrase: $(OBJS_p)
586bad51
JM
1431 $(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p)
1432 @$(E) " LD " $@
6fc6879b
JM
1433
1434wpa_cli: $(OBJS_c)
586bad51
JM
1435 $(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
1436 @$(E) " LD " $@
6fc6879b
JM
1437
1438link_test: $(OBJS) $(OBJS_h) tests/link_test.o
586bad51
JM
1439 $(Q)$(LDO) $(LDFLAGS) -o link_test $(OBJS) $(OBJS_h) tests/link_test.o $(LIBS)
1440 @$(E) " LD " $@
6fc6879b
JM
1441
1442test_wpa: $(OBJS_wpa) $(OBJS_h)
586bad51
JM
1443 $(Q)$(LDO) $(LDFLAGS) -o test_wpa $(OBJS_wpa) $(LIBS)
1444 @$(E) " LD " $@
6fc6879b 1445
6fc6879b 1446win_if_list: win_if_list.c
586bad51
JM
1447 $(Q)$(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
1448 @$(E) " LD " $@
6fc6879b
JM
1449
1450eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c
466940c5 1451 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
6fc6879b
JM
1452 -Deap_peer_psk_register=eap_peer_method_dynamic_init
1453
1454eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c
466940c5 1455 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
6fc6879b
JM
1456 -Deap_peer_pax_register=eap_peer_method_dynamic_init
1457
1458eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c
466940c5 1459 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
6fc6879b
JM
1460 -Deap_peer_sake_register=eap_peer_method_dynamic_init
1461
ad08c363 1462eap_wsc.so: ../src/eap_peer/eap_wsc.c ../src/eap_common/eap_wsc_common.c ../src/wps/wps.c
466940c5 1463 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
ad08c363
JM
1464 -Deap_peer_wsc_register=eap_peer_method_dynamic_init
1465
6fc6879b 1466eap_ikev2.so: ../src/eap_peer/eap_ikev2.c ../src/eap_peer/ikev2.c ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.c
466940c5 1467 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
6fc6879b
JM
1468 -Deap_peer_ikev2_register=eap_peer_method_dynamic_init
1469
1470%.so: %.c
466940c5 1471 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
4c2660c2 1472 -D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
6fc6879b 1473
b2840aaf
JB
1474%.o: %.c
1475 $(Q)$(CC) -c -o $@ $(CFLAGS) $<
1476 @$(E) " CC " $<
6fc6879b 1477
f0573c79
HG
1478%.service: %.service.in
1479 sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
1480
6897ce14
JM
1481%@.service: %.service.arg.in
1482 sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
1483
6fc6879b
JM
1484wpa_supplicant.exe: wpa_supplicant
1485 mv -f $< $@
1486wpa_cli.exe: wpa_cli
1487 mv -f $< $@
1488wpa_passphrase.exe: wpa_passphrase
1489 mv -f $< $@
1490win_if_list.exe: win_if_list
1491 mv -f $< $@
1492eapol_test.exe: eapol_test
1493 mv -f $< $@
1494
1495WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe
1496
1497windows-bin: $(WINALL)
1498 $(STRIP) $(WINALL)
1499
67a52064
JM
1500wpa_gui:
1501 @echo "wpa_gui has been removed - see wpa_gui-qt4 for replacement"
6fc6879b
JM
1502
1503wpa_gui-qt4/Makefile:
1504 qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro
1505
0b86f67a
JM
1506wpa_gui-qt4/lang/wpa_gui_de.qm: wpa_gui-qt4/lang/wpa_gui_de.ts
1507 lrelease wpa_gui-qt4/wpa_gui.pro
1508
1509wpa_gui-qt4: wpa_gui-qt4/Makefile wpa_gui-qt4/lang/wpa_gui_de.qm
6fc6879b
JM
1510 $(MAKE) -C wpa_gui-qt4
1511
ad01a531 1512TEST_EAP_SIM_COMMON_OBJS = $(SHA1OBJS) $(MD5OBJS) \
246157cb
JB
1513 ../src/utils/common.o ../src/utils/os_unix.o \
1514 ../src/utils/wpa_debug.o $(AESOBJS) \
6fc6879b
JM
1515 tests/test_eap_sim_common.o
1516test-eap_sim_common: $(TEST_EAP_SIM_COMMON_OBJS)
03da66bd 1517 $(LDO) $(LDFLAGS) -o $@ $(TEST_EAP_SIM_COMMON_OBJS) $(LIBS)
6fc6879b
JM
1518 ./test-eap_sim_common
1519 rm test-eap_sim_common
1520
f8cf3ce6 1521tests: test-eap_sim_common
6fc6879b
JM
1522
1523clean:
1524 $(MAKE) -C ../src clean
eb3b34ce 1525 $(MAKE) -C dbus clean
8055fb78 1526 rm -f core *~ *.o *.d eap_*.so $(ALL) $(WINALL) eapol_test preauth_test
385f16c6 1527 rm -f wpa_priv
6fc6879b 1528
6fc6879b 1529-include $(OBJS:%.o=%.d)