xref: /freebsd/contrib/wpa/hostapd/Makefile (revision 87b759f0fa1f7554d50ce640c40138512bbded44)
1ALL=hostapd hostapd_cli
2CONFIG_FILE = .config
3
4include ../src/build.rules
5
6ifdef LIBS
7# If LIBS is set with some global build system defaults, clone those for
8# LIBS_c, LIBS_h, and LIBS_n to cover hostapd_cli, hlr_auc_gw, and
9# nt_password_hash as well.
10ifndef LIBS_c
11LIBS_c := $(LIBS)
12endif
13ifndef LIBS_h
14LIBS_h := $(LIBS)
15endif
16ifndef LIBS_n
17LIBS_n := $(LIBS)
18endif
19ifndef LIBS_s
20LIBS_s := $(LIBS)
21endif
22endif
23
24CFLAGS += $(EXTRA_CFLAGS)
25CFLAGS += -I$(abspath ../src)
26CFLAGS += -I$(abspath ../src/utils)
27
28export BINDIR ?= /usr/local/bin/
29
30ifndef CONFIG_NO_GITVER
31# Add VERSION_STR postfix for builds from a git repository
32ifeq ($(wildcard ../.git),../.git)
33GITVER := $(shell git describe --dirty=+)
34ifneq ($(GITVER),)
35CFLAGS += -DGIT_VERSION_STR_POSTFIX=\"-$(GITVER)\"
36endif
37endif
38endif
39
40ifdef CONFIG_TESTING_OPTIONS
41CFLAGS += -DCONFIG_TESTING_OPTIONS
42CONFIG_WPS_TESTING=y
43endif
44
45ifndef CONFIG_OS
46ifdef CONFIG_NATIVE_WINDOWS
47CONFIG_OS=win32
48else
49CONFIG_OS=unix
50endif
51endif
52
53ifeq ($(CONFIG_OS), internal)
54CFLAGS += -DOS_NO_C_LIB_DEFINES
55endif
56
57ifdef CONFIG_NATIVE_WINDOWS
58CFLAGS += -DCONFIG_NATIVE_WINDOWS
59LIBS += -lws2_32
60endif
61
62OBJS += main.o
63OBJS += config_file.o
64
65OBJS += ../src/ap/hostapd.o
66OBJS += ../src/ap/wpa_auth_glue.o
67OBJS += ../src/ap/drv_callbacks.o
68OBJS += ../src/ap/ap_drv_ops.o
69OBJS += ../src/ap/utils.o
70OBJS += ../src/ap/authsrv.o
71OBJS += ../src/ap/ieee802_1x.o
72OBJS += ../src/ap/ap_config.o
73OBJS += ../src/ap/eap_user_db.o
74OBJS += ../src/ap/ieee802_11_auth.o
75OBJS += ../src/ap/sta_info.o
76OBJS += ../src/ap/wpa_auth.o
77OBJS += ../src/ap/tkip_countermeasures.o
78OBJS += ../src/ap/ap_mlme.o
79OBJS += ../src/ap/wpa_auth_ie.o
80OBJS += ../src/ap/preauth_auth.o
81OBJS += ../src/ap/pmksa_cache_auth.o
82OBJS += ../src/ap/ieee802_11_shared.o
83OBJS += ../src/ap/beacon.o
84OBJS += ../src/ap/bss_load.o
85OBJS += ../src/ap/neighbor_db.o
86OBJS += ../src/ap/rrm.o
87OBJS += ../src/common/ptksa_cache.o
88
89OBJS_c = hostapd_cli.o
90OBJS_c += ../src/common/wpa_ctrl.o
91OBJS_c += ../src/utils/os_$(CONFIG_OS).o
92OBJS_c += ../src/common/cli.o
93
94NEED_RC4=y
95NEED_AES=y
96NEED_MD5=y
97NEED_SHA1=y
98
99OBJS += ../src/drivers/drivers.o
100CFLAGS += -DHOSTAPD
101
102ifdef CONFIG_TAXONOMY
103CFLAGS += -DCONFIG_TAXONOMY
104OBJS += ../src/ap/taxonomy.o
105endif
106
107ifdef CONFIG_MODULE_TESTS
108CFLAGS += -DCONFIG_MODULE_TESTS
109OBJS += hapd_module_tests.o
110endif
111
112ifdef CONFIG_WPA_TRACE
113CFLAGS += -DWPA_TRACE
114OBJS += ../src/utils/trace.o
115HOBJS += ../src/utils/trace.o
116LDFLAGS += -rdynamic
117CFLAGS += -funwind-tables
118ifdef CONFIG_WPA_TRACE_BFD
119CFLAGS += -DPACKAGE="hostapd" -DWPA_TRACE_BFD
120LIBS += -lbfd -ldl -liberty -lz
121LIBS_c += -lbfd -ldl -liberty -lz
122LIBS_h += -lbfd -ldl -liberty -lz
123LIBS_n += -lbfd -ldl -liberty -lz
124LIBS_s += -lbfd -ldl -liberty -lz
125endif
126endif
127
128ifndef CONFIG_ELOOP
129CONFIG_ELOOP=eloop
130endif
131OBJS += ../src/utils/$(CONFIG_ELOOP).o
132OBJS_c += ../src/utils/$(CONFIG_ELOOP).o
133
134ifeq ($(CONFIG_ELOOP), eloop)
135# Using glibc < 2.17 requires -lrt for clock_gettime()
136LIBS += -lrt
137LIBS_c += -lrt
138LIBS_h += -lrt
139LIBS_n += -lrt
140endif
141
142ifdef CONFIG_ELOOP_POLL
143CFLAGS += -DCONFIG_ELOOP_POLL
144endif
145
146ifdef CONFIG_ELOOP_EPOLL
147CFLAGS += -DCONFIG_ELOOP_EPOLL
148endif
149
150ifdef CONFIG_ELOOP_KQUEUE
151CFLAGS += -DCONFIG_ELOOP_KQUEUE
152endif
153
154OBJS += ../src/utils/common.o
155OBJS_c += ../src/utils/common.o
156OBJS += ../src/utils/wpa_debug.o
157OBJS_c += ../src/utils/wpa_debug.o
158OBJS += ../src/utils/wpabuf.o
159OBJS += ../src/utils/os_$(CONFIG_OS).o
160OBJS += ../src/utils/ip_addr.o
161OBJS += ../src/utils/crc32.o
162
163OBJS += ../src/common/ieee802_11_common.o
164OBJS += ../src/common/wpa_common.o
165OBJS += ../src/common/hw_features_common.o
166
167OBJS += ../src/eapol_auth/eapol_auth_sm.o
168
169
170ifdef CONFIG_CODE_COVERAGE
171CFLAGS += -O0 -fprofile-arcs -ftest-coverage -U_FORTIFY_SOURCE
172LIBS += -lgcov
173LIBS_c += -lgcov
174LIBS_h += -lgcov
175LIBS_n += -lgcov
176endif
177
178ifndef CONFIG_NO_DUMP_STATE
179# define HOSTAPD_DUMP_STATE to include support for dumping internal state
180# through control interface commands (undefine it, if you want to save in
181# binary size)
182CFLAGS += -DHOSTAPD_DUMP_STATE
183OBJS += ../src/eapol_auth/eapol_auth_dump.o
184endif
185
186ifdef CONFIG_NO_RADIUS
187CFLAGS += -DCONFIG_NO_RADIUS
188CONFIG_NO_ACCOUNTING=y
189else
190OBJS += ../src/radius/radius.o
191OBJS += ../src/radius/radius_client.o
192OBJS += ../src/radius/radius_das.o
193endif
194
195ifdef CONFIG_NO_ACCOUNTING
196CFLAGS += -DCONFIG_NO_ACCOUNTING
197else
198OBJS += ../src/ap/accounting.o
199endif
200
201ifdef CONFIG_NO_VLAN
202CFLAGS += -DCONFIG_NO_VLAN
203else
204OBJS += ../src/ap/vlan_init.o
205OBJS += ../src/ap/vlan_ifconfig.o
206OBJS += ../src/ap/vlan.o
207ifdef CONFIG_FULL_DYNAMIC_VLAN
208# Define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
209# and VLAN interfaces for the VLAN feature.
210CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
211OBJS += ../src/ap/vlan_full.o
212ifdef CONFIG_VLAN_NETLINK
213OBJS += ../src/ap/vlan_util.o
214else
215OBJS += ../src/ap/vlan_ioctl.o
216endif
217endif
218endif
219
220ifdef CONFIG_NO_CTRL_IFACE
221CFLAGS += -DCONFIG_NO_CTRL_IFACE
222else
223ifeq ($(CONFIG_CTRL_IFACE), udp)
224CFLAGS += -DCONFIG_CTRL_IFACE_UDP
225else
226ifeq ($(CONFIG_CTRL_IFACE), udp6)
227CFLAGS += -DCONFIG_CTRL_IFACE_UDP
228CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
229else
230ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
231CFLAGS += -DCONFIG_CTRL_IFACE_UDP
232CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
233else
234ifeq ($(CONFIG_CTRL_IFACE), udp6-remote)
235CFLAGS += -DCONFIG_CTRL_IFACE_UDP
236CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
237CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
238else
239CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
240endif
241endif
242endif
243endif
244OBJS += ../src/common/ctrl_iface_common.o
245OBJS += ctrl_iface.o
246OBJS += ../src/ap/ctrl_iface_ap.o
247endif
248
249ifndef CONFIG_NO_CTRL_IFACE
250CFLAGS += -DCONFIG_CTRL_IFACE
251endif
252
253ifdef CONFIG_RSN_PREAUTH
254CFLAGS += -DCONFIG_RSN_PREAUTH
255CONFIG_L2_PACKET=y
256endif
257
258ifdef CONFIG_HS20
259CONFIG_PROXYARP=y
260endif
261
262ifdef CONFIG_PROXYARP
263CONFIG_L2_PACKET=y
264endif
265
266ifdef CONFIG_SUITEB
267CFLAGS += -DCONFIG_SUITEB
268endif
269
270ifdef CONFIG_SUITEB192
271CFLAGS += -DCONFIG_SUITEB192
272NEED_SHA384=y
273endif
274
275ifdef CONFIG_OCV
276CFLAGS += -DCONFIG_OCV
277OBJS += ../src/common/ocv.o
278endif
279
280NEED_AES_UNWRAP=y
281
282ifdef CONFIG_IEEE80211R
283CFLAGS += -DCONFIG_IEEE80211R -DCONFIG_IEEE80211R_AP
284OBJS += ../src/ap/wpa_auth_ft.o
285NEED_AES_UNWRAP=y
286NEED_AES_SIV=y
287NEED_ETH_P_OUI=y
288NEED_HMAC_SHA256_KDF=y
289endif
290
291ifdef NEED_ETH_P_OUI
292CFLAGS += -DCONFIG_ETH_P_OUI
293OBJS += ../src/ap/eth_p_oui.o
294endif
295
296ifdef CONFIG_SAE
297CFLAGS += -DCONFIG_SAE
298OBJS += ../src/common/sae.o
299ifdef CONFIG_SAE_PK
300CFLAGS += -DCONFIG_SAE_PK
301NEED_AES_SIV=y
302OBJS += ../src/common/sae_pk.o
303endif
304NEED_ECC=y
305NEED_DH_GROUPS=y
306NEED_HMAC_SHA256_KDF=y
307NEED_AP_MLME=y
308NEED_DRAGONFLY=y
309endif
310
311ifdef CONFIG_OWE
312CFLAGS += -DCONFIG_OWE
313NEED_ECC=y
314NEED_HMAC_SHA256_KDF=y
315NEED_HMAC_SHA384_KDF=y
316NEED_HMAC_SHA512_KDF=y
317NEED_SHA384=y
318NEED_SHA512=y
319endif
320
321ifdef CONFIG_AIRTIME_POLICY
322CFLAGS += -DCONFIG_AIRTIME_POLICY
323OBJS += ../src/ap/airtime_policy.o
324endif
325
326ifdef CONFIG_FILS
327CFLAGS += -DCONFIG_FILS
328OBJS += ../src/ap/fils_hlp.o
329NEED_SHA384=y
330NEED_AES_SIV=y
331ifdef CONFIG_FILS_SK_PFS
332CFLAGS += -DCONFIG_FILS_SK_PFS
333NEED_ECC=y
334endif
335endif
336
337ifdef CONFIG_WNM
338CFLAGS += -DCONFIG_WNM -DCONFIG_WNM_AP
339OBJS += ../src/ap/wnm_ap.o
340endif
341
342ifdef CONFIG_IEEE80211AC
343CFLAGS += -DCONFIG_IEEE80211AC
344endif
345
346ifdef CONFIG_IEEE80211BE
347CONFIG_IEEE80211AX=y
348CFLAGS += -DCONFIG_IEEE80211BE
349OBJS += ../src/ap/ieee802_11_eht.o
350endif
351
352ifdef CONFIG_IEEE80211AX
353CFLAGS += -DCONFIG_IEEE80211AX
354OBJS += ../src/ap/ieee802_11_he.o
355endif
356
357ifdef CONFIG_MBO
358CFLAGS += -DCONFIG_MBO
359OBJS += ../src/ap/mbo_ap.o
360endif
361
362include ../src/drivers/drivers.mak
363OBJS += $(DRV_AP_OBJS)
364CFLAGS += $(DRV_AP_CFLAGS)
365LDFLAGS += $(DRV_AP_LDFLAGS)
366LIBS += $(DRV_AP_LIBS)
367
368ifdef CONFIG_L2_PACKET
369ifdef CONFIG_DNET_PCAP
370ifdef CONFIG_L2_FREEBSD
371LIBS += -lpcap
372OBJS += ../src/l2_packet/l2_packet_freebsd.o
373else
374LIBS += -ldnet -lpcap
375OBJS += ../src/l2_packet/l2_packet_pcap.o
376endif
377else
378OBJS += ../src/l2_packet/l2_packet_linux.o
379endif
380else
381OBJS += ../src/l2_packet/l2_packet_none.o
382endif
383
384
385ifdef CONFIG_ERP
386CFLAGS += -DCONFIG_ERP
387NEED_HMAC_SHA256_KDF=y
388endif
389
390ifdef CONFIG_EAP_MD5
391CFLAGS += -DEAP_SERVER_MD5
392OBJS += ../src/eap_server/eap_server_md5.o
393CHAP=y
394endif
395
396ifdef CONFIG_EAP_TLS
397CFLAGS += -DEAP_SERVER_TLS
398OBJS += ../src/eap_server/eap_server_tls.o
399TLS_FUNCS=y
400endif
401
402ifdef CONFIG_EAP_UNAUTH_TLS
403CFLAGS += -DEAP_SERVER_UNAUTH_TLS
404ifndef CONFIG_EAP_TLS
405OBJS += ../src/eap_server/eap_server_tls.o
406TLS_FUNCS=y
407endif
408endif
409
410ifdef CONFIG_EAP_PEAP
411CFLAGS += -DEAP_SERVER_PEAP
412OBJS += ../src/eap_server/eap_server_peap.o
413OBJS += ../src/eap_common/eap_peap_common.o
414TLS_FUNCS=y
415CONFIG_EAP_MSCHAPV2=y
416endif
417
418ifdef CONFIG_EAP_TTLS
419CFLAGS += -DEAP_SERVER_TTLS
420OBJS += ../src/eap_server/eap_server_ttls.o
421TLS_FUNCS=y
422CHAP=y
423endif
424
425ifdef CONFIG_EAP_MSCHAPV2
426CFLAGS += -DEAP_SERVER_MSCHAPV2
427OBJS += ../src/eap_server/eap_server_mschapv2.o
428MS_FUNCS=y
429endif
430
431ifdef CONFIG_EAP_GTC
432CFLAGS += -DEAP_SERVER_GTC
433OBJS += ../src/eap_server/eap_server_gtc.o
434endif
435
436ifdef CONFIG_EAP_SIM
437CFLAGS += -DEAP_SERVER_SIM
438OBJS += ../src/eap_server/eap_server_sim.o
439CONFIG_EAP_SIM_COMMON=y
440NEED_AES_CBC=y
441endif
442
443ifdef CONFIG_EAP_AKA
444CFLAGS += -DEAP_SERVER_AKA
445OBJS += ../src/eap_server/eap_server_aka.o
446CONFIG_EAP_SIM_COMMON=y
447NEED_AES_CBC=y
448endif
449
450ifdef CONFIG_EAP_AKA_PRIME
451CFLAGS += -DEAP_SERVER_AKA_PRIME
452endif
453
454ifdef CONFIG_EAP_SIM_COMMON
455OBJS += ../src/eap_common/eap_sim_common.o
456# Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
457# replaced with another file implementing the interface specified in
458# eap_sim_db.h.
459OBJS += ../src/eap_server/eap_sim_db.o
460NEED_FIPS186_2_PRF=y
461endif
462
463ifdef CONFIG_EAP_PAX
464CFLAGS += -DEAP_SERVER_PAX
465OBJS += ../src/eap_server/eap_server_pax.o ../src/eap_common/eap_pax_common.o
466endif
467
468ifdef CONFIG_EAP_PSK
469CFLAGS += -DEAP_SERVER_PSK
470OBJS += ../src/eap_server/eap_server_psk.o ../src/eap_common/eap_psk_common.o
471NEED_AES_ENCBLOCK=y
472NEED_AES_EAX=y
473endif
474
475ifdef CONFIG_EAP_SAKE
476CFLAGS += -DEAP_SERVER_SAKE
477OBJS += ../src/eap_server/eap_server_sake.o ../src/eap_common/eap_sake_common.o
478endif
479
480ifdef CONFIG_EAP_GPSK
481CFLAGS += -DEAP_SERVER_GPSK
482OBJS += ../src/eap_server/eap_server_gpsk.o ../src/eap_common/eap_gpsk_common.o
483ifdef CONFIG_EAP_GPSK_SHA256
484CFLAGS += -DEAP_GPSK_SHA256
485endif
486endif
487
488ifdef CONFIG_EAP_PWD
489CFLAGS += -DEAP_SERVER_PWD
490OBJS += ../src/eap_server/eap_server_pwd.o ../src/eap_common/eap_pwd_common.o
491NEED_ECC=y
492NEED_DRAGONFLY=y
493endif
494
495ifdef CONFIG_EAP_EKE
496CFLAGS += -DEAP_SERVER_EKE
497OBJS += ../src/eap_server/eap_server_eke.o ../src/eap_common/eap_eke_common.o
498NEED_DH_GROUPS=y
499NEED_DH_GROUPS_ALL=y
500endif
501
502ifdef CONFIG_EAP_VENDOR_TEST
503CFLAGS += -DEAP_SERVER_VENDOR_TEST
504OBJS += ../src/eap_server/eap_server_vendor_test.o
505endif
506
507ifdef CONFIG_EAP_FAST
508CFLAGS += -DEAP_SERVER_FAST
509OBJS += ../src/eap_server/eap_server_fast.o
510OBJS += ../src/eap_common/eap_fast_common.o
511TLS_FUNCS=y
512NEED_T_PRF=y
513NEED_AES_UNWRAP=y
514endif
515
516ifdef CONFIG_EAP_TEAP
517CFLAGS += -DEAP_SERVER_TEAP
518OBJS += ../src/eap_server/eap_server_teap.o
519OBJS += ../src/eap_common/eap_teap_common.o
520TLS_FUNCS=y
521NEED_T_PRF=y
522NEED_SHA384=y
523NEED_TLS_PRF_SHA256=y
524NEED_TLS_PRF_SHA384=y
525NEED_AES_UNWRAP=y
526endif
527
528ifdef CONFIG_WPS
529CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
530OBJS += ../src/utils/uuid.o
531OBJS += ../src/ap/wps_hostapd.o
532OBJS += ../src/eap_server/eap_server_wsc.o ../src/eap_common/eap_wsc_common.o
533OBJS += ../src/wps/wps.o
534OBJS += ../src/wps/wps_common.o
535OBJS += ../src/wps/wps_attr_parse.o
536OBJS += ../src/wps/wps_attr_build.o
537OBJS += ../src/wps/wps_attr_process.o
538OBJS += ../src/wps/wps_dev_attr.o
539OBJS += ../src/wps/wps_enrollee.o
540OBJS += ../src/wps/wps_registrar.o
541NEED_DH_GROUPS=y
542NEED_BASE64=y
543NEED_AES_CBC=y
544NEED_MODEXP=y
545CONFIG_EAP=y
546
547ifdef CONFIG_WPS_NFC
548CFLAGS += -DCONFIG_WPS_NFC
549OBJS += ../src/wps/ndef.o
550NEED_WPS_OOB=y
551endif
552
553ifdef NEED_WPS_OOB
554CFLAGS += -DCONFIG_WPS_OOB
555endif
556
557ifdef CONFIG_WPS_UPNP
558CFLAGS += -DCONFIG_WPS_UPNP
559OBJS += ../src/wps/wps_upnp.o
560OBJS += ../src/wps/wps_upnp_ssdp.o
561OBJS += ../src/wps/wps_upnp_web.o
562OBJS += ../src/wps/wps_upnp_event.o
563OBJS += ../src/wps/wps_upnp_ap.o
564OBJS += ../src/wps/upnp_xml.o
565OBJS += ../src/wps/httpread.o
566OBJS += ../src/wps/http_client.o
567OBJS += ../src/wps/http_server.o
568endif
569
570ifdef CONFIG_WPS_STRICT
571CFLAGS += -DCONFIG_WPS_STRICT
572OBJS += ../src/wps/wps_validate.o
573endif
574
575ifdef CONFIG_WPS_TESTING
576CFLAGS += -DCONFIG_WPS_TESTING
577endif
578
579endif
580
581ifdef CONFIG_DPP
582CFLAGS += -DCONFIG_DPP
583OBJS += ../src/common/dpp.o
584OBJS += ../src/common/dpp_auth.o
585OBJS += ../src/common/dpp_backup.o
586OBJS += ../src/common/dpp_crypto.o
587OBJS += ../src/common/dpp_pkex.o
588OBJS += ../src/common/dpp_reconfig.o
589OBJS += ../src/common/dpp_tcp.o
590OBJS += ../src/ap/dpp_hostapd.o
591OBJS += ../src/ap/gas_query_ap.o
592NEED_AES_SIV=y
593NEED_HMAC_SHA256_KDF=y
594NEED_HMAC_SHA384_KDF=y
595NEED_HMAC_SHA512_KDF=y
596NEED_SHA384=y
597NEED_SHA512=y
598NEED_ECC=y
599NEED_JSON=y
600NEED_GAS=y
601NEED_BASE64=y
602NEED_ASN1=y
603ifdef CONFIG_DPP2
604CFLAGS += -DCONFIG_DPP2
605endif
606ifdef CONFIG_DPP3
607CFLAGS += -DCONFIG_DPP3
608endif
609endif
610
611ifdef CONFIG_NAN_USD
612OBJS += ../src/common/nan_de.o
613OBJS += ../src/ap/nan_usd_ap.o
614CFLAGS += -DCONFIG_NAN_USD
615endif
616
617ifdef CONFIG_PASN
618CFLAGS += -DCONFIG_PASN
619CFLAGS += -DCONFIG_PTKSA_CACHE
620NEED_HMAC_SHA256_KDF=y
621NEED_HMAC_SHA384_KDF=y
622NEED_SHA256=y
623NEED_SHA384=y
624endif
625
626ifdef CONFIG_EAP_IKEV2
627CFLAGS += -DEAP_SERVER_IKEV2
628OBJS += ../src/eap_server/eap_server_ikev2.o ../src/eap_server/ikev2.o
629OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
630NEED_DH_GROUPS=y
631NEED_DH_GROUPS_ALL=y
632NEED_MODEXP=y
633NEED_CIPHER=y
634endif
635
636ifdef CONFIG_EAP_TNC
637CFLAGS += -DEAP_SERVER_TNC
638OBJS += ../src/eap_server/eap_server_tnc.o
639OBJS += ../src/eap_server/tncs.o
640NEED_BASE64=y
641ifndef CONFIG_DRIVER_BSD
642LIBS += -ldl
643endif
644endif
645
646ifdef CONFIG_MACSEC
647CFLAGS += -DCONFIG_MACSEC
648OBJS += ../src/ap/wpa_auth_kay.o
649OBJS += ../src/pae/ieee802_1x_cp.o
650OBJS += ../src/pae/ieee802_1x_kay.o
651OBJS += ../src/pae/ieee802_1x_key.o
652OBJS += ../src/pae/ieee802_1x_secy_ops.o
653endif
654
655# Basic EAP functionality is needed for EAPOL
656OBJS += eap_register.o
657OBJS += ../src/eap_server/eap_server.o
658OBJS += ../src/eap_common/eap_common.o
659OBJS += ../src/eap_server/eap_server_methods.o
660OBJS += ../src/eap_server/eap_server_identity.o
661CFLAGS += -DEAP_SERVER_IDENTITY
662
663ifdef CONFIG_EAP
664CFLAGS += -DEAP_SERVER
665endif
666
667ifdef CONFIG_PKCS12
668CFLAGS += -DPKCS12_FUNCS
669endif
670
671ifdef NEED_DRAGONFLY
672OBJS += ../src/common/dragonfly.o
673endif
674
675ifdef MS_FUNCS
676OBJS += ../src/crypto/ms_funcs.o
677NEED_DES=y
678NEED_MD4=y
679endif
680
681ifdef CHAP
682OBJS += ../src/eap_common/chap.o
683endif
684
685ifdef CONFIG_RADIUS_TLS
686TLS_FUNCS=y
687CFLAGS += -DCONFIG_RADIUS_TLS
688endif
689
690ifdef TLS_FUNCS
691NEED_DES=y
692# Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
693CFLAGS += -DEAP_TLS_FUNCS
694OBJS += ../src/eap_server/eap_server_tls_common.o
695NEED_TLS_PRF=y
696endif
697
698ifndef CONFIG_TLS
699CONFIG_TLS=openssl
700endif
701
702ifdef CONFIG_TLSV11
703CFLAGS += -DCONFIG_TLSV11
704endif
705
706ifdef CONFIG_TLSV12
707CFLAGS += -DCONFIG_TLSV12
708endif
709
710ifeq ($(CONFIG_TLS), wolfssl)
711CONFIG_CRYPTO=wolfssl
712ifdef TLS_FUNCS
713OBJS += ../src/crypto/tls_wolfssl.o
714LIBS += -lwolfssl -lm
715endif
716OBJS += ../src/crypto/crypto_wolfssl.o
717HOBJS += ../src/crypto/crypto_wolfssl.o
718ifdef NEED_FIPS186_2_PRF
719OBJS += ../src/crypto/fips_prf_wolfssl.o
720endif
721NEED_TLS_PRF_SHA256=y
722LIBS += -lwolfssl -lm
723LIBS_h += -lwolfssl -lm
724ifdef CONFIG_TLS_ADD_DL
725LIBS += -ldl
726LIBS_h += -ldl
727endif
728endif
729
730ifeq ($(CONFIG_TLS), openssl)
731CFLAGS += -DCRYPTO_RSA_OAEP_SHA256
732CONFIG_CRYPTO=openssl
733ifdef TLS_FUNCS
734OBJS += ../src/crypto/tls_openssl.o
735OBJS += ../src/crypto/tls_openssl_ocsp.o
736LIBS += -lssl
737endif
738OBJS += ../src/crypto/crypto_openssl.o
739HOBJS += ../src/crypto/crypto_openssl.o
740SOBJS += ../src/crypto/crypto_openssl.o
741ifdef NEED_FIPS186_2_PRF
742OBJS += ../src/crypto/fips_prf_openssl.o
743endif
744NEED_TLS_PRF_SHA256=y
745LIBS += -lcrypto
746LIBS_h += -lcrypto
747LIBS_n += -lcrypto
748LIBS_s += -lcrypto
749ifdef CONFIG_TLS_ADD_DL
750LIBS += -ldl
751LIBS_h += -ldl
752LIBS_s += -ldl
753endif
754ifndef CONFIG_TLS_DEFAULT_CIPHERS
755CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW"
756endif
757CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\"
758endif
759
760ifeq ($(CONFIG_TLS), gnutls)
761ifndef CONFIG_CRYPTO
762# default to libgcrypt
763CONFIG_CRYPTO=gnutls
764endif
765ifdef TLS_FUNCS
766OBJS += ../src/crypto/tls_gnutls.o
767LIBS += -lgnutls -lgpg-error
768endif
769OBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
770HOBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
771ifdef NEED_FIPS186_2_PRF
772OBJS += ../src/crypto/fips_prf_internal.o
773SHA1OBJS += ../src/crypto/sha1-internal.o
774endif
775ifeq ($(CONFIG_CRYPTO), gnutls)
776LIBS += -lgcrypt
777LIBS_h += -lgcrypt
778LIBS_n += -lgcrypt
779CONFIG_INTERNAL_RC4=y
780CONFIG_INTERNAL_DH_GROUP5=y
781endif
782ifeq ($(CONFIG_CRYPTO), nettle)
783LIBS += -lnettle -lgmp
784LIBS_p += -lnettle -lgmp
785CONFIG_INTERNAL_RC4=y
786CONFIG_INTERNAL_DH_GROUP5=y
787endif
788endif
789
790ifeq ($(CONFIG_TLS), internal)
791ifndef CONFIG_CRYPTO
792CONFIG_CRYPTO=internal
793endif
794ifdef TLS_FUNCS
795OBJS += ../src/crypto/crypto_internal-rsa.o
796OBJS += ../src/crypto/tls_internal.o
797OBJS += ../src/tls/tlsv1_common.o
798OBJS += ../src/tls/tlsv1_record.o
799OBJS += ../src/tls/tlsv1_cred.o
800OBJS += ../src/tls/tlsv1_server.o
801OBJS += ../src/tls/tlsv1_server_write.o
802OBJS += ../src/tls/tlsv1_server_read.o
803OBJS += ../src/tls/rsa.o
804OBJS += ../src/tls/x509v3.o
805OBJS += ../src/tls/pkcs1.o
806OBJS += ../src/tls/pkcs5.o
807OBJS += ../src/tls/pkcs8.o
808NEED_ASN1=y
809NEED_BASE64=y
810NEED_TLS_PRF=y
811ifdef CONFIG_TLSV12
812NEED_TLS_PRF_SHA256=y
813endif
814NEED_MODEXP=y
815NEED_CIPHER=y
816CFLAGS += -DCONFIG_TLS_INTERNAL
817CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
818endif
819ifdef NEED_CIPHER
820NEED_DES=y
821OBJS += ../src/crypto/crypto_internal-cipher.o
822endif
823ifdef NEED_MODEXP
824OBJS += ../src/crypto/crypto_internal-modexp.o
825OBJS += ../src/tls/bignum.o
826endif
827ifeq ($(CONFIG_CRYPTO), libtomcrypt)
828OBJS += ../src/crypto/crypto_libtomcrypt.o
829LIBS += -ltomcrypt -ltfm
830LIBS_h += -ltomcrypt -ltfm
831CONFIG_INTERNAL_SHA256=y
832CONFIG_INTERNAL_RC4=y
833CONFIG_INTERNAL_DH_GROUP5=y
834endif
835ifeq ($(CONFIG_CRYPTO), internal)
836OBJS += ../src/crypto/crypto_internal.o
837NEED_AES_DEC=y
838CFLAGS += -DCONFIG_CRYPTO_INTERNAL
839ifdef CONFIG_INTERNAL_LIBTOMMATH
840CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
841ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
842CFLAGS += -DLTM_FAST
843endif
844else
845LIBS += -ltommath
846LIBS_h += -ltommath
847endif
848CONFIG_INTERNAL_AES=y
849CONFIG_INTERNAL_DES=y
850CONFIG_INTERNAL_SHA1=y
851CONFIG_INTERNAL_MD4=y
852CONFIG_INTERNAL_MD5=y
853CONFIG_INTERNAL_SHA256=y
854CONFIG_INTERNAL_SHA384=y
855CONFIG_INTERNAL_SHA512=y
856CONFIG_INTERNAL_RC4=y
857CONFIG_INTERNAL_DH_GROUP5=y
858endif
859ifeq ($(CONFIG_CRYPTO), cryptoapi)
860OBJS += ../src/crypto/crypto_cryptoapi.o
861OBJS_p += ../src/crypto/crypto_cryptoapi.o
862CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
863CONFIG_INTERNAL_SHA256=y
864CONFIG_INTERNAL_RC4=y
865endif
866endif
867
868ifeq ($(CONFIG_TLS), linux)
869OBJS += ../src/crypto/crypto_linux.o
870ifdef TLS_FUNCS
871OBJS += ../src/crypto/crypto_internal-rsa.o
872OBJS += ../src/crypto/tls_internal.o
873OBJS += ../src/tls/tlsv1_common.o
874OBJS += ../src/tls/tlsv1_record.o
875OBJS += ../src/tls/tlsv1_cred.o
876OBJS += ../src/tls/tlsv1_server.o
877OBJS += ../src/tls/tlsv1_server_write.o
878OBJS += ../src/tls/tlsv1_server_read.o
879OBJS += ../src/tls/rsa.o
880OBJS += ../src/tls/x509v3.o
881OBJS += ../src/tls/pkcs1.o
882OBJS += ../src/tls/pkcs5.o
883OBJS += ../src/tls/pkcs8.o
884NEED_ASN1=y
885NEED_BASE64=y
886NEED_TLS_PRF=y
887ifdef CONFIG_TLSV12
888NEED_TLS_PRF_SHA256=y
889endif
890NEED_MODEXP=y
891NEED_CIPHER=y
892CFLAGS += -DCONFIG_TLS_INTERNAL
893CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
894endif
895ifdef NEED_MODEXP
896OBJS += ../src/crypto/crypto_internal-modexp.o
897OBJS += ../src/tls/bignum.o
898CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
899CFLAGS += -DLTM_FAST
900endif
901CONFIG_INTERNAL_DH_GROUP5=y
902ifdef NEED_FIPS186_2_PRF
903OBJS += ../src/crypto/fips_prf_internal.o
904OBJS += ../src/crypto/sha1-internal.o
905endif
906endif
907
908ifeq ($(CONFIG_TLS), none)
909ifdef TLS_FUNCS
910OBJS += ../src/crypto/tls_none.o
911CFLAGS += -DEAP_TLS_NONE
912CONFIG_INTERNAL_AES=y
913CONFIG_INTERNAL_SHA1=y
914CONFIG_INTERNAL_MD5=y
915endif
916OBJS += ../src/crypto/crypto_none.o
917OBJS_p += ../src/crypto/crypto_none.o
918CONFIG_INTERNAL_SHA256=y
919CONFIG_INTERNAL_RC4=y
920endif
921
922ifndef TLS_FUNCS
923OBJS += ../src/crypto/tls_none.o
924ifeq ($(CONFIG_TLS), internal)
925CONFIG_INTERNAL_AES=y
926CONFIG_INTERNAL_SHA1=y
927CONFIG_INTERNAL_MD5=y
928CONFIG_INTERNAL_RC4=y
929endif
930endif
931
932AESOBJS = # none so far
933ifdef CONFIG_INTERNAL_AES
934AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-enc.o
935endif
936
937ifneq ($(CONFIG_TLS), openssl)
938ifneq ($(CONFIG_TLS), wolfssl)
939AESOBJS += ../src/crypto/aes-wrap.o
940endif
941endif
942ifdef NEED_AES_EAX
943AESOBJS += ../src/crypto/aes-eax.o
944NEED_AES_CTR=y
945endif
946ifdef NEED_AES_SIV
947AESOBJS += ../src/crypto/aes-siv.o
948NEED_AES_CTR=y
949endif
950ifdef NEED_AES_CTR
951AESOBJS += ../src/crypto/aes-ctr.o
952endif
953ifdef NEED_AES_ENCBLOCK
954AESOBJS += ../src/crypto/aes-encblock.o
955endif
956ifneq ($(CONFIG_TLS), openssl)
957ifneq ($(CONFIG_TLS), linux)
958ifneq ($(CONFIG_TLS), wolfssl)
959AESOBJS += ../src/crypto/aes-omac1.o
960endif
961endif
962endif
963ifdef NEED_AES_UNWRAP
964ifneq ($(CONFIG_TLS), openssl)
965ifneq ($(CONFIG_TLS), linux)
966ifneq ($(CONFIG_TLS), wolfssl)
967NEED_AES_DEC=y
968AESOBJS += ../src/crypto/aes-unwrap.o
969endif
970endif
971endif
972endif
973ifdef NEED_AES_CBC
974NEED_AES_DEC=y
975ifneq ($(CONFIG_TLS), openssl)
976ifneq ($(CONFIG_TLS), linux)
977ifneq ($(CONFIG_TLS), wolfssl)
978AESOBJS += ../src/crypto/aes-cbc.o
979endif
980endif
981endif
982endif
983ifdef NEED_AES_DEC
984ifdef CONFIG_INTERNAL_AES
985AESOBJS += ../src/crypto/aes-internal-dec.o
986endif
987endif
988ifdef NEED_AES
989OBJS += $(AESOBJS)
990endif
991
992ifdef NEED_SHA1
993ifneq ($(CONFIG_TLS), openssl)
994ifneq ($(CONFIG_TLS), linux)
995ifneq ($(CONFIG_TLS), gnutls)
996ifneq ($(CONFIG_TLS), wolfssl)
997SHA1OBJS += ../src/crypto/sha1.o
998endif
999endif
1000endif
1001endif
1002SHA1OBJS += ../src/crypto/sha1-prf.o
1003ifdef CONFIG_INTERNAL_SHA1
1004SHA1OBJS += ../src/crypto/sha1-internal.o
1005ifdef NEED_FIPS186_2_PRF
1006SHA1OBJS += ../src/crypto/fips_prf_internal.o
1007endif
1008endif
1009ifneq ($(CONFIG_TLS), openssl)
1010ifneq ($(CONFIG_TLS), wolfssl)
1011SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
1012endif
1013endif
1014ifdef NEED_T_PRF
1015SHA1OBJS += ../src/crypto/sha1-tprf.o
1016endif
1017ifdef NEED_TLS_PRF
1018SHA1OBJS += ../src/crypto/sha1-tlsprf.o
1019endif
1020endif
1021
1022ifdef NEED_SHA1
1023OBJS += $(SHA1OBJS)
1024endif
1025
1026ifneq ($(CONFIG_TLS), openssl)
1027ifneq ($(CONFIG_TLS), linux)
1028ifneq ($(CONFIG_TLS), gnutls)
1029ifneq ($(CONFIG_TLS), wolfssl)
1030OBJS += ../src/crypto/md5.o
1031endif
1032endif
1033endif
1034endif
1035
1036ifdef NEED_MD5
1037ifdef CONFIG_INTERNAL_MD5
1038OBJS += ../src/crypto/md5-internal.o
1039HOBJS += ../src/crypto/md5-internal.o
1040endif
1041endif
1042
1043ifdef NEED_MD4
1044ifdef CONFIG_INTERNAL_MD4
1045OBJS += ../src/crypto/md4-internal.o
1046endif
1047endif
1048
1049ifdef NEED_DES
1050CFLAGS += -DCONFIG_DES
1051ifdef CONFIG_INTERNAL_DES
1052OBJS += ../src/crypto/des-internal.o
1053endif
1054endif
1055
1056ifdef CONFIG_NO_RC4
1057CFLAGS += -DCONFIG_NO_RC4
1058endif
1059
1060ifdef NEED_RC4
1061ifdef CONFIG_INTERNAL_RC4
1062ifndef CONFIG_NO_RC4
1063OBJS += ../src/crypto/rc4.o
1064endif
1065endif
1066endif
1067
1068CFLAGS += -DCONFIG_SHA256
1069ifneq ($(CONFIG_TLS), openssl)
1070ifneq ($(CONFIG_TLS), linux)
1071ifneq ($(CONFIG_TLS), gnutls)
1072ifneq ($(CONFIG_TLS), wolfssl)
1073OBJS += ../src/crypto/sha256.o
1074endif
1075endif
1076endif
1077endif
1078OBJS += ../src/crypto/sha256-prf.o
1079ifdef CONFIG_INTERNAL_SHA256
1080OBJS += ../src/crypto/sha256-internal.o
1081endif
1082ifdef NEED_TLS_PRF_SHA256
1083OBJS += ../src/crypto/sha256-tlsprf.o
1084endif
1085ifdef NEED_TLS_PRF_SHA384
1086OBJS += ../src/crypto/sha384-tlsprf.o
1087endif
1088ifdef NEED_HMAC_SHA256_KDF
1089OBJS += ../src/crypto/sha256-kdf.o
1090endif
1091ifdef NEED_HMAC_SHA384_KDF
1092OBJS += ../src/crypto/sha384-kdf.o
1093endif
1094ifdef NEED_HMAC_SHA512_KDF
1095OBJS += ../src/crypto/sha512-kdf.o
1096endif
1097ifdef NEED_SHA384
1098CFLAGS += -DCONFIG_SHA384
1099ifneq ($(CONFIG_TLS), openssl)
1100ifneq ($(CONFIG_TLS), linux)
1101ifneq ($(CONFIG_TLS), gnutls)
1102ifneq ($(CONFIG_TLS), wolfssl)
1103OBJS += ../src/crypto/sha384.o
1104endif
1105endif
1106endif
1107endif
1108OBJS += ../src/crypto/sha384-prf.o
1109endif
1110ifdef NEED_SHA512
1111CFLAGS += -DCONFIG_SHA512
1112ifneq ($(CONFIG_TLS), openssl)
1113ifneq ($(CONFIG_TLS), linux)
1114ifneq ($(CONFIG_TLS), gnutls)
1115ifneq ($(CONFIG_TLS), wolfssl)
1116OBJS += ../src/crypto/sha512.o
1117endif
1118endif
1119endif
1120endif
1121OBJS += ../src/crypto/sha512-prf.o
1122endif
1123
1124ifdef CONFIG_INTERNAL_SHA384
1125CFLAGS += -DCONFIG_INTERNAL_SHA384
1126OBJS += ../src/crypto/sha384-internal.o
1127endif
1128
1129ifdef CONFIG_INTERNAL_SHA512
1130CFLAGS += -DCONFIG_INTERNAL_SHA512
1131OBJS += ../src/crypto/sha512-internal.o
1132endif
1133
1134ifdef NEED_ASN1
1135OBJS += ../src/tls/asn1.o
1136endif
1137
1138ifdef NEED_DH_GROUPS
1139OBJS += ../src/crypto/dh_groups.o
1140endif
1141ifdef NEED_DH_GROUPS_ALL
1142CFLAGS += -DALL_DH_GROUPS
1143endif
1144ifdef CONFIG_INTERNAL_DH_GROUP5
1145ifdef NEED_DH_GROUPS
1146OBJS += ../src/crypto/dh_group5.o
1147endif
1148endif
1149
1150ifdef NEED_ECC
1151CFLAGS += -DCONFIG_ECC
1152endif
1153
1154ifdef CONFIG_NO_RANDOM_POOL
1155CFLAGS += -DCONFIG_NO_RANDOM_POOL
1156else
1157ifdef CONFIG_GETRANDOM
1158CFLAGS += -DCONFIG_GETRANDOM
1159endif
1160OBJS += ../src/crypto/random.o
1161HOBJS += ../src/crypto/random.o
1162HOBJS += ../src/utils/eloop.o
1163HOBJS += $(SHA1OBJS)
1164ifneq ($(CONFIG_TLS), openssl)
1165ifneq ($(CONFIG_TLS), linux)
1166ifneq ($(CONFIG_TLS), wolfssl)
1167HOBJS += ../src/crypto/md5.o
1168endif
1169endif
1170endif
1171endif
1172
1173ifdef CONFIG_RADIUS_SERVER
1174CFLAGS += -DRADIUS_SERVER
1175OBJS += ../src/radius/radius_server.o
1176endif
1177
1178ifdef CONFIG_IPV6
1179CFLAGS += -DCONFIG_IPV6
1180endif
1181
1182ifdef CONFIG_DRIVER_RADIUS_ACL
1183CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
1184endif
1185
1186ifdef NEED_BASE64
1187OBJS += ../src/utils/base64.o
1188endif
1189
1190ifdef NEED_JSON
1191OBJS += ../src/utils/json.o
1192CFLAGS += -DCONFIG_JSON
1193endif
1194
1195ifdef NEED_AP_MLME
1196OBJS += ../src/ap/wmm.o
1197OBJS += ../src/ap/ap_list.o
1198OBJS += ../src/ap/comeback_token.o
1199OBJS += ../src/pasn/pasn_responder.o
1200OBJS += ../src/pasn/pasn_common.o
1201OBJS += ../src/ap/ieee802_11.o
1202OBJS += ../src/ap/hw_features.o
1203OBJS += ../src/ap/dfs.o
1204CFLAGS += -DNEED_AP_MLME
1205endif
1206OBJS += ../src/ap/ieee802_11_ht.o
1207
1208ifdef CONFIG_IEEE80211AC
1209OBJS += ../src/ap/ieee802_11_vht.o
1210endif
1211
1212ifdef CONFIG_P2P_MANAGER
1213CFLAGS += -DCONFIG_P2P_MANAGER
1214OBJS += ../src/ap/p2p_hostapd.o
1215endif
1216
1217ifdef CONFIG_HS20
1218CFLAGS += -DCONFIG_HS20
1219OBJS += ../src/ap/hs20.o
1220CONFIG_INTERWORKING=y
1221endif
1222
1223ifdef CONFIG_INTERWORKING
1224CFLAGS += -DCONFIG_INTERWORKING
1225NEED_GAS=y
1226endif
1227
1228ifdef NEED_GAS
1229OBJS += ../src/common/gas.o
1230OBJS += ../src/ap/gas_serv.o
1231endif
1232
1233ifdef CONFIG_PROXYARP
1234CFLAGS += -DCONFIG_PROXYARP
1235OBJS += ../src/ap/x_snoop.o
1236OBJS += ../src/ap/dhcp_snoop.o
1237ifdef CONFIG_IPV6
1238OBJS += ../src/ap/ndisc_snoop.o
1239endif
1240endif
1241
1242OBJS += ../src/drivers/driver_common.o
1243
1244ifdef CONFIG_WPA_CLI_EDIT
1245OBJS_c += ../src/utils/edit.o
1246else
1247OBJS_c += ../src/utils/edit_simple.o
1248endif
1249
1250ifdef CONFIG_ACS
1251CFLAGS += -DCONFIG_ACS
1252OBJS += ../src/ap/acs.o
1253LIBS += -lm
1254endif
1255
1256ifdef CONFIG_NO_STDOUT_DEBUG
1257CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
1258endif
1259
1260ifdef CONFIG_DEBUG_SYSLOG
1261CFLAGS += -DCONFIG_DEBUG_SYSLOG
1262endif
1263
1264ifdef CONFIG_DEBUG_LINUX_TRACING
1265CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
1266endif
1267
1268ifdef CONFIG_DEBUG_FILE
1269CFLAGS += -DCONFIG_DEBUG_FILE
1270endif
1271
1272ifdef CONFIG_SQLITE
1273CFLAGS += -DCONFIG_SQLITE
1274LIBS += -lsqlite3
1275LIBS_h += -lsqlite3
1276endif
1277
1278ifdef CONFIG_FST
1279CFLAGS += -DCONFIG_FST
1280OBJS += ../src/fst/fst.o
1281OBJS += ../src/fst/fst_group.o
1282OBJS += ../src/fst/fst_iface.o
1283OBJS += ../src/fst/fst_session.o
1284OBJS += ../src/fst/fst_ctrl_aux.o
1285ifdef CONFIG_FST_TEST
1286CFLAGS += -DCONFIG_FST_TEST
1287endif
1288ifndef CONFIG_NO_CTRL_IFACE
1289OBJS += ../src/fst/fst_ctrl_iface.o
1290endif
1291endif
1292
1293ifdef CONFIG_WEP
1294CFLAGS += -DCONFIG_WEP
1295endif
1296
1297ifdef CONFIG_NO_TKIP
1298CFLAGS += -DCONFIG_NO_TKIP
1299endif
1300
1301$(DESTDIR)$(BINDIR)/%: %
1302	install -D $(<) $(@)
1303
1304install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL))
1305
1306_OBJS_VAR := OBJS
1307include ../src/objs.mk
1308
1309hostapd: $(OBJS)
1310	$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
1311	@$(E) "  LD " $@
1312
1313ifdef CONFIG_WPA_TRACE
1314OBJS_c += ../src/utils/trace.o
1315endif
1316
1317_OBJS_VAR := OBJS_c
1318include ../src/objs.mk
1319
1320hostapd_cli: $(OBJS_c)
1321	$(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c)
1322	@$(E) "  LD " $@
1323
1324NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS)
1325NOBJS += ../src/utils/common.o
1326ifdef NEED_RC4
1327ifdef CONFIG_INTERNAL_RC4
1328ifndef CONFIG_NO_RC4
1329NOBJS += ../src/crypto/rc4.o
1330endif
1331endif
1332endif
1333ifdef CONFIG_INTERNAL_MD5
1334NOBJS += ../src/crypto/md5-internal.o
1335endif
1336NOBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
1337NOBJS += ../src/utils/os_$(CONFIG_OS).o
1338NOBJS += ../src/utils/wpa_debug.o
1339NOBJS += ../src/utils/wpabuf.o
1340ifdef CONFIG_WPA_TRACE
1341NOBJS += ../src/utils/trace.o
1342endif
1343
1344HOBJS += hlr_auc_gw.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).o ../src/utils/wpabuf.o ../src/crypto/milenage.o
1345HOBJS += ../src/crypto/aes-encblock.o
1346ifdef CONFIG_INTERNAL_AES
1347HOBJS += ../src/crypto/aes-internal.o
1348HOBJS += ../src/crypto/aes-internal-enc.o
1349endif
1350ifeq ($(CONFIG_TLS), linux)
1351HOBJS += ../src/crypto/crypto_linux.o
1352endif
1353
1354SOBJS += sae_pk_gen.o
1355SOBJS +=  ../src/utils/common.o
1356SOBJS += ../src/utils/os_$(CONFIG_OS).o
1357SOBJS += ../src/utils/base64.o
1358SOBJS += ../src/utils/wpa_debug.o
1359SOBJS += ../src/utils/wpabuf.o
1360ifdef CONFIG_WPA_TRACE
1361SOBJS += ../src/utils/trace.o
1362endif
1363SOBJS += ../src/common/ieee802_11_common.o
1364SOBJS += ../src/common/sae.o
1365SOBJS += ../src/common/sae_pk.o
1366SOBJS += ../src/common/dragonfly.o
1367SOBJS += $(AESOBJS)
1368SOBJS += ../src/crypto/sha256-prf.o
1369SOBJS += ../src/crypto/sha384-prf.o
1370SOBJS += ../src/crypto/sha512-prf.o
1371SOBJS += ../src/crypto/dh_groups.o
1372SOBJS += ../src/crypto/sha256-kdf.o
1373SOBJS += ../src/crypto/sha384-kdf.o
1374SOBJS += ../src/crypto/sha512-kdf.o
1375
1376_OBJS_VAR := NOBJS
1377include ../src/objs.mk
1378_OBJS_VAR := HOBJS
1379include ../src/objs.mk
1380_OBJS_VAR := SOBJS
1381include ../src/objs.mk
1382
1383nt_password_hash: $(NOBJS)
1384	$(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
1385	@$(E) "  LD " $@
1386
1387hlr_auc_gw: $(HOBJS)
1388	$(Q)$(CC) $(LDFLAGS) -o hlr_auc_gw $(HOBJS) $(LIBS_h)
1389	@$(E) "  LD " $@
1390
1391sae_pk_gen: $(SOBJS)
1392	$(Q)$(CC) $(LDFLAGS) -o sae_pk_gen $(SOBJS) $(LIBS_s)
1393	@$(E) "  LD " $@
1394
1395.PHONY: lcov-html
1396lcov-html:
1397	lcov -c -d $(BUILDDIR) > lcov.info
1398	genhtml lcov.info --output-directory lcov-html
1399
1400clean: common-clean
1401	rm -f core *~ nt_password_hash hlr_auc_gw
1402	rm -f sae_pk_gen
1403	rm -f lcov.info
1404	rm -rf lcov-html
1405