Ticket #9020: Makefile

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