6 CFLAGS = -MMD -O2 -Wall -g
9 # define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to
10 # a file (undefine it, if you want to save in binary size)
11 CFLAGS += -DHOSTAPD_DUMP_STATE
13 # Include directories for CVS version
14 CFLAGS += -I. -I$(DIR_HOSTAP) -I../utils -I$(DIR_WPA_SUPPLICANT)
16 # Uncomment following line and set the path to your kernel tree include
17 # directory if your C library does not include all header files.
18 # CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
20 OBJS = hostapd.o eloop.o ieee802_1x.o eapol_sm.o radius.o md5.o rc4.o \
21 common.o ieee802_11.o config.o ieee802_11_auth.o accounting.o \
22 sta_info.o radius_client.o sha1.o wpa.o aes_wrap.o ctrl_iface.o \
28 CFLAGS += -DCONFIG_IAPP
32 ifdef CONFIG_RSN_PREAUTH
33 CFLAGS += -DCONFIG_RSN_PREAUTH
37 ifdef CONFIG_DRIVER_HOSTAP
38 CFLAGS += -DCONFIG_DRIVER_HOSTAP
42 ifdef CONFIG_DRIVER_WIRED
43 CFLAGS += -DCONFIG_DRIVER_WIRED
44 OBJS += driver_wired.o
47 ifdef CONFIG_DRIVER_MADWIFI
48 CFLAGS += -DCONFIG_DRIVER_MADWIFI
49 OBJS += driver_madwifi.o
53 ifdef CONFIG_DRIVER_PRISM54
54 CFLAGS += -DCONFIG_DRIVER_PRISM54
55 OBJS += driver_prism54.o
58 ifdef CONFIG_DRIVER_BSD
59 CFLAGS += -DCONFIG_DRIVER_BSD
66 ifdef CONFIG_DRIVER_TEST
67 CFLAGS += -DCONFIG_DRIVER_TEST
71 ifdef CONFIG_L2_PACKET
72 ifdef CONFIG_DNET_PCAP
73 CFLAGS += -DUSE_DNET_PCAP
74 ifdef CONFIG_L2_FREEBSD
76 OBJS += $(DIR_WPA_SUPPLICANT)/l2_packet_freebsd.o
79 OBJS += $(DIR_WPA_SUPPLICANT)/l2_packet_pcap.o
82 OBJS += $(DIR_WPA_SUPPLICANT)/l2_packet_linux.o
103 CONFIG_EAP_MSCHAPV2=y
106 ifdef CONFIG_EAP_TTLS
112 ifdef CONFIG_EAP_MSCHAPV2
113 CFLAGS += -DEAP_MSCHAPv2
114 OBJS += eap_mschapv2.o
125 OBJS += eap_sim.o $(DIR_WPA_SUPPLICANT)/eap_sim_common.o
126 # Example EAP-SIM interface for GSM authentication. This can be replaced with
127 # another file implementating the interface specified in eap_sim_db.h.
133 OBJS += eap_pax.o $(DIR_WPA_SUPPLICANT)/eap_pax_common.o
138 OBJS += eap_psk.o $(DIR_WPA_SUPPLICANT)/eap_psk_common.o
147 CFLAGS += -DEAP_SERVER
148 OBJS += eap.o eap_identity.o
152 # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
153 CFLAGS += -DEAP_TLS_FUNCS
154 OBJS += eap_tls_common.o $(DIR_WPA_SUPPLICANT)/tls_openssl.o
155 LIBS += -lssl -lcrypto
158 OBJS += $(DIR_WPA_SUPPLICANT)/tls_none.o
162 CFLAGS += -DPKCS12_FUNCS
169 OBJS += $(DIR_WPA_SUPPLICANT)/ms_funcs.o $(DIR_WPA_SUPPLICANT)/crypto.o
172 ifdef CONFIG_RADIUS_SERVER
173 CFLAGS += -DRADIUS_SERVER
174 OBJS += radius_server.o
178 CFLAGS += -DCONFIG_IPV6
181 ALL=hostapd hostapd_cli
183 all: verify_config $(ALL)
186 @if [ ! -r .config ]; then \
187 echo 'Building hostapd requires a configuration file'; \
188 echo '(.config). See README for more instructions. You can'; \
189 echo 'run "cp defconfig .config" to create an example'; \
190 echo 'configuration.'; \
195 for i in $(ALL); do cp $$i /usr/local/bin/$$i; done
198 $(CC) -o hostapd $(OBJS) $(LIBS)
200 driver_conf.c: Makefile .config
202 echo '/* THIS FILE AUTOMATICALLY GENERATED, DO NOT EDIT! */' \
204 echo '#include <stdlib.h>' >> driver_conf.c
205 echo '#include <stdio.h>' >> driver_conf.c
206 echo '#include <sys/types.h>' >> driver_conf.c
207 echo '#include <netinet/in.h>' >> driver_conf.c
208 echo '#include "hostapd.h"' >> driver_conf.c
209 echo '#include "driver.h"' >> driver_conf.c
210 ifdef CONFIG_DRIVER_HOSTAP
211 echo "void hostap_driver_register(void);" >> driver_conf.c
213 ifdef CONFIG_DRIVER_WIRED
214 echo "void wired_driver_register(void);" >> driver_conf.c
216 ifdef CONFIG_DRIVER_MADWIFI
217 echo "void madwifi_driver_register(void);" >> driver_conf.c
219 ifdef CONFIG_DRIVER_PRISM54
220 echo "void prism54_driver_register(void);" >> driver_conf.c
222 ifdef CONFIG_DRIVER_BSD
223 echo "void bsd_driver_register(void);" >> driver_conf.c
225 ifdef CONFIG_DRIVER_TEST
226 echo "void test_driver_register(void);" >> driver_conf.c
228 echo 'void register_drivers(void) {' >> driver_conf.c
229 ifdef CONFIG_DRIVER_HOSTAP
230 echo "hostap_driver_register();" >> driver_conf.c
232 ifdef CONFIG_DRIVER_WIRED
233 echo "wired_driver_register();" >> driver_conf.c
235 ifdef CONFIG_DRIVER_MADWIFI
236 echo "madwifi_driver_register();" >> driver_conf.c
238 ifdef CONFIG_DRIVER_PRISM54
239 echo "prism54_driver_register();" >> driver_conf.c
241 ifdef CONFIG_DRIVER_BSD
242 echo "bsd_driver_register();" >> driver_conf.c
244 ifdef CONFIG_DRIVER_TEST
245 echo "test_driver_register();" >> driver_conf.c
247 echo '}' >> driver_conf.c
249 hostapd_cli: hostapd_cli.o $(DIR_WPA_SUPPLICANT)/wpa_ctrl.o
250 $(CC) -o hostapd_cli hostapd_cli.o $(DIR_WPA_SUPPLICANT)/wpa_ctrl.o
253 rm -f core *~ *.o hostapd hostapd_cli *.d driver_conf.c
255 -include $(OBJS:%.o=%.d)