xref: /freebsd/usr.sbin/wpa/wpa_supplicant/Makefile (revision 0aad5de37cf518ab1d6cc7bc5d813c41e64ce9b8)
1# $FreeBSD$
2
3.include <src.opts.mk>
4
5.include "../Makefile.inc"
6
7.PATH.c:${WPA_SUPPLICANT_DISTDIR} \
8	${WPA_DISTDIR}/src/eap_peer \
9	${WPA_DISTDIR}/src/utils \
10	${WPA_DISTDIR}/src/drivers
11
12PACKAGE=	wpa
13PROG=	wpa_supplicant
14
15SRCS=	base64.c bitfield.c bss.c bssid_ignore.c cli.c common.c \
16	config.c config_file.c \
17	ctrl_iface.c ctrl_iface_common.c ctrl_iface_unix.c \
18	driver_bsd.c driver_common.c \
19	driver_wired.c driver_wired_common.c drivers.c \
20	eap_register.c eloop.c \
21	events.c gas.c gas_query.c \
22	http_client.c http_server.c \
23	httpread.c hw_features_common.c \
24	ieee802_11_common.c l2_packet_freebsd.c main.c \
25	notify.c offchannel.c op_classes.c os_unix.c \
26	pmksa_cache.c preauth.c \
27	robust_av.c \
28	rrm.c scan.c twt.c upnp_xml.c \
29	wmm_ac.c wpa.c wpa_common.c wpa_ctrl.c \
30	wpa_debug.c wpa_ft.c wpa_ie.c wpa_supplicant.c wpabuf.c wpas_glue.c
31
32MAN=	wpa_supplicant.8 wpa_supplicant.conf.5
33
34.if ${MK_EXAMPLES} != "no"
35FILESDIR= ${SHAREDIR}/examples/etc
36.PATH:	${WPA_SUPPLICANT_DISTDIR}
37FILES=	wpa_supplicant.conf
38.endif
39
40CFLAGS+=-DCONFIG_BACKEND_FILE \
41	-DCONFIG_DEBUG_SYSLOG \
42	-DCONFIG_DRIVER_BSD \
43	-DCONFIG_DRIVER_WIRED \
44	-DCONFIG_GAS \
45	-DCONFIG_IEEE80211R \
46	-DCONFIG_IEEE80211N \
47	-DCONFIG_IEEE80211W \
48	-DCONFIG_IEEE80211AC \
49	-DCONFIG_IEEE80211AX \
50	-DCONFIG_PEERKEY \
51	-DCONFIG_PRIVSEP \
52	-DCONFIG_SMARTCARD \
53	-DCONFIG_TERMINATE_ONLASTIF \
54	-DCONFIG_TLS=openssl \
55	-DCONFIG_WPS2 \
56	-DCONFIG_WPS_UPNP \
57	-DPKCS12_FUNCS \
58	-DCONFIG_MATCH_IFACE
59#CFLAGS+= -g
60LIBADD=	pcap util
61
62# User customizations to the wpa_supplicant build environment
63CFLAGS+=${WPA_SUPPLICANT_CFLAGS}
64#DPADD+=${WPA_SUPPLICANT_DPADD}
65LDADD+=${WPA_SUPPLICANT_LDADD}
66#LDFLAGS+=${WPA_SUPPLICANT_LDFLAGS}
67
68.if ${MK_WPA_SUPPLICANT_EAPOL} != "no"
69CFLAGS+=-DCONFIG_WPS \
70	-DCONFIG_HS20 \
71	-DCONFIG_INTERWORKING \
72	-DEAP_GTC \
73	-DEAP_LEAP \
74	-DEAP_MD5 \
75	-DEAP_MSCHAPv2 \
76	-DEAP_OTP \
77	-DEAP_PEAP \
78	-DEAP_PSK \
79	-DEAP_TLS \
80	-DEAP_TTLS \
81	-DEAP_WSC \
82	-DIEEE8021X_EAPOL
83SRCS+=	chap.c \
84	eap.c \
85	eap_common.c \
86	eap_gtc.c \
87	eap_leap.c \
88	eap_md5.c \
89	eap_methods.c \
90	eap_mschapv2.c \
91	eap_otp.c \
92	eap_peap.c \
93	eap_peap_common.c \
94	eap_psk.c \
95	eap_psk_common.c \
96	eap_tls.c \
97	eap_tls_common.c \
98	eap_ttls.c \
99	eap_wsc.c \
100	eapol_supp_sm.c \
101	eap_wsc_common.c \
102	hs20_supplicant.c \
103	interworking.c \
104	ms_funcs.c \
105	mschapv2.c \
106	uuid.c \
107	wps.c wps_attr_build.c wps_attr_parse.c wps_attr_process.c \
108	wps_common.c wps_dev_attr.c wps_enrollee.c wps_registrar.c \
109	wps_supplicant.c wps_upnp.c wps_upnp_ap.c wps_upnp_event.c \
110	wps_upnp_ssdp.c wps_upnp_web.c
111NEED_AES_EAX=y
112NEED_AES_ENCBLOCK=y
113NEED_AES_OMAC1=y
114.endif
115TLS_FUNCS=y
116
117.if !empty(CFLAGS:M*-DEAP_AKA)
118SRCS+=	eap_aka.c
119NEED_SIM_COMMON=y
120NEED_AES_CBC=y
121.endif
122
123.if !empty(CFLAGS:M*-DEAP_SIM)
124SRCS+=	eap_sim.c
125NEED_SIM_COMMON=y
126NEED_AES_CBC=y
127.endif
128
129.if defined(NEED_SIM_COMMON)
130SRCS+=	eap_sim_common.c
131NEED_FIPS186_2_PRF=y
132.endif
133
134# PC/SC interface for smartcards (USIM, GSM SIM)
135# GSM/UMTS authentication algorithm (for EAP-SIM/EAP-AKA)
136# NB: requires devel/pcsc-lite
137#
138# WPA_SUPPLICANT_CFLAGS=-DEAP_AKA -DPCSC_FUNCS -I/usr/local/include/PCSC
139# WPA_SUPPLICANT_LDADD=-L/usr/local/lib
140#
141.if !empty(CFLAGS:M*-DPCSC_FUNCS)
142SRCS+=	pcsc_funcs.c
143LIBADD+=	pcslite pthread
144.endif
145
146.if !empty(CFLAGS:M*-DEAP_GPSK)
147CFLAGS+=-DEAP_GPSK_SHA256
148SRCS+=	eap_gpsk.c \
149	eap_gpsk_common.c
150NEED_AES_OMAC1=y
151.endif
152
153.if !empty(CFLAGS:M*-DEAP_PAX)
154SRCS+=	eap_pax.c \
155	eap_pax_common.c
156.endif
157
158.if !empty(CFLAGS:M*-DEAP_SAKE)
159SRCS+=	eap_sake.c \
160	eap_sake_common.c
161.endif
162
163OBJS+=	utils_config.o
164utils_config.o:	${WPA_DISTDIR}/src/utils/config.c
165	${CC} -c ${CFLAGS} -o ${.OBJDIR}/utils_config.o ${WPA_DISTDIR}/src/utils/config.c
166
167.include "../Makefile.crypto"
168
169.include <bsd.prog.mk>
170