5 CFLAGS = -MMD -O2 -Wall -g
8 # define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to
9 # a file (undefine it, if you want to save in binary size)
10 CFLAGS += -DHOSTAPD_DUMP_STATE
12 # Include directories for CVS version
13 CFLAGS += -I. -I../utils -I$(DIR_WPA_SUPPLICANT)
15 # Uncomment following line and set the path to your kernel tree include
16 # directory if your C library does not include all header files.
17 # CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
22 ifdef CONFIG_NATIVE_WINDOWS
29 ifeq ($(CONFIG_OS), internal)
30 CFLAGS += -DOS_NO_C_LIB_DEFINES
33 ifdef CONFIG_NATIVE_WINDOWS
34 CFLAGS += -DCONFIG_NATIVE_WINDOWS
38 OBJS = hostapd.o eloop.o ieee802_1x.o eapol_sm.o radius.o md5.o rc4.o md4.o \
39 common.o ieee802_11.o config.o ieee802_11_auth.o accounting.o \
40 sta_info.o radius_client.o sha1.o wpa.o aes_wrap.o ctrl_iface.o \
41 driver_conf.o os_$(CONFIG_OS).o preauth.o pmksa_cache.o beacon.o \
42 hw_features.o wme.o ap_list.o reconfig.o \
43 mlme.o vlan_init.o ieee802_11h.o
45 HOBJS=hlr_auc_gw.o common.o os_$(CONFIG_OS).o milenage.o aes_wrap.o
47 CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX
50 CFLAGS += -DCONFIG_IAPP
54 ifdef CONFIG_RSN_PREAUTH
55 CFLAGS += -DCONFIG_RSN_PREAUTH
60 CFLAGS += -DCONFIG_PEERKEY
63 ifdef CONFIG_IEEE80211W
64 CFLAGS += -DCONFIG_IEEE80211W
68 ifdef CONFIG_DRIVER_HOSTAP
69 CFLAGS += -DCONFIG_DRIVER_HOSTAP
73 ifdef CONFIG_DRIVER_WIRED
74 CFLAGS += -DCONFIG_DRIVER_WIRED
75 OBJS += driver_wired.o
78 ifdef CONFIG_DRIVER_MADWIFI
79 CFLAGS += -DCONFIG_DRIVER_MADWIFI
80 OBJS += driver_madwifi.o
84 ifdef CONFIG_DRIVER_PRISM54
85 CFLAGS += -DCONFIG_DRIVER_PRISM54
86 OBJS += driver_prism54.o
89 ifdef CONFIG_DRIVER_DEVICESCAPE
90 CFLAGS += -DCONFIG_DRIVER_DEVICESCAPE
91 OBJS += driver_devicescape.o
94 ifdef CONFIG_DRIVER_BSD
95 CFLAGS += -DCONFIG_DRIVER_BSD
102 ifdef CONFIG_DRIVER_TEST
103 CFLAGS += -DCONFIG_DRIVER_TEST
104 OBJS += driver_test.o
107 ifdef CONFIG_L2_PACKET
108 ifdef CONFIG_DNET_PCAP
109 ifdef CONFIG_L2_FREEBSD
111 OBJS += $(DIR_WPA_SUPPLICANT)/l2_packet_freebsd.o
113 LIBS += -ldnet -lpcap
114 OBJS += $(DIR_WPA_SUPPLICANT)/l2_packet_pcap.o
117 OBJS += $(DIR_WPA_SUPPLICANT)/l2_packet_linux.o
133 ifdef CONFIG_EAP_PEAP
138 CONFIG_EAP_MSCHAPV2=y
141 ifdef CONFIG_EAP_TTLS
147 ifdef CONFIG_EAP_MSCHAPV2
148 CFLAGS += -DEAP_MSCHAPv2
149 OBJS += eap_mschapv2.o
161 CONFIG_EAP_SIM_COMMON=y
167 CONFIG_EAP_SIM_COMMON=y
170 ifdef CONFIG_EAP_SIM_COMMON
171 OBJS += $(DIR_WPA_SUPPLICANT)/eap_sim_common.o
172 # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
173 # replaced with another file implementating the interface specified in
180 OBJS += eap_pax.o $(DIR_WPA_SUPPLICANT)/eap_pax_common.o
185 OBJS += eap_psk.o $(DIR_WPA_SUPPLICANT)/eap_psk_common.o
188 ifdef CONFIG_EAP_SAKE
190 OBJS += eap_sake.o $(DIR_WPA_SUPPLICANT)/eap_sake_common.o
193 ifdef CONFIG_EAP_GPSK
195 OBJS += eap_gpsk.o $(DIR_WPA_SUPPLICANT)/eap_gpsk_common.o
196 ifdef CONFIG_EAP_GPSK_SHA256
197 CFLAGS += -DEAP_GPSK_SHA256
202 ifdef CONFIG_EAP_VENDOR_TEST
203 CFLAGS += -DEAP_VENDOR_TEST
204 OBJS += eap_vendor_test.o
213 CFLAGS += -DEAP_SERVER
214 OBJS += eap.o eap_methods.o eap_identity.o
222 # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
223 CFLAGS += -DEAP_TLS_FUNCS
224 OBJS += eap_tls_common.o
225 ifeq ($(CONFIG_TLS), openssl)
226 OBJS += $(DIR_WPA_SUPPLICANT)/tls_openssl.o
227 LIBS += -lssl -lcrypto
231 ifeq ($(CONFIG_TLS), gnutls)
232 OBJS += $(DIR_WPA_SUPPLICANT)/tls_gnutls.o
233 LIBS += -lgnutls -lgcrypt -lgpg-error
237 ifdef CONFIG_GNUTLS_EXTRA
238 CFLAGS += -DCONFIG_GNUTLS_EXTRA
239 LIBS += -lgnutls-extra
243 OBJS += $(DIR_WPA_SUPPLICANT)/tls_none.o
247 CFLAGS += -DPKCS12_FUNCS
251 OBJS += $(DIR_WPA_SUPPLICANT)/ms_funcs.o
257 ifeq ($(CONFIG_TLS), openssl)
262 ifeq ($(CONFIG_TLS), gnutls)
268 ifeq ($(CONFIG_TLS), openssl)
269 OBJS += $(DIR_WPA_SUPPLICANT)/crypto.o
270 OBJS_p += $(DIR_WPA_SUPPLICANT)/crypto.o
271 HOBJS += $(DIR_WPA_SUPPLICANT)/crypto.o
272 CONFIG_INTERNAL_SHA256=y
274 ifeq ($(CONFIG_TLS), gnutls)
275 OBJS += $(DIR_WPA_SUPPLICANT)/crypto_gnutls.o
276 OBJS_p += $(DIR_WPA_SUPPLICANT)/crypto_gnutls.o
277 HOBJS += $(DIR_WPA_SUPPLICANT)/crypto_gnutls.o
278 CONFIG_INTERNAL_SHA256=y
281 CONFIG_INTERNAL_AES=y
282 CONFIG_INTERNAL_SHA1=y
283 CONFIG_INTERNAL_MD5=y
284 CONFIG_INTERNAL_SHA256=y
287 ifdef CONFIG_INTERNAL_AES
288 CFLAGS += -DINTERNAL_AES
290 ifdef CONFIG_INTERNAL_SHA1
291 CFLAGS += -DINTERNAL_SHA1
293 ifdef CONFIG_INTERNAL_SHA256
294 CFLAGS += -DINTERNAL_SHA256
296 ifdef CONFIG_INTERNAL_MD5
297 CFLAGS += -DINTERNAL_MD5
299 ifdef CONFIG_INTERNAL_MD4
300 CFLAGS += -DINTERNAL_MD4
307 ifdef CONFIG_RADIUS_SERVER
308 CFLAGS += -DRADIUS_SERVER
309 OBJS += radius_server.o
313 CFLAGS += -DCONFIG_IPV6
316 ifdef CONFIG_DRIVER_RADIUS_ACL
317 CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
320 ifdef CONFIG_FULL_DYNAMIC_VLAN
321 # define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
322 # and vlan interfaces for the vlan feature.
323 CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
326 ALL=hostapd hostapd_cli
328 all: verify_config $(ALL)
331 @if [ ! -r .config ]; then \
332 echo 'Building hostapd requires a configuration file'; \
333 echo '(.config). See README for more instructions. You can'; \
334 echo 'run "cp defconfig .config" to create an example'; \
335 echo 'configuration.'; \
340 for i in $(ALL); do cp $$i /usr/local/bin/$$i; done
343 $(CC) -o hostapd $(OBJS) $(LIBS)
345 driver_conf.c: Makefile .config
347 echo '/* THIS FILE AUTOMATICALLY GENERATED, DO NOT EDIT! */' \
349 echo '#include "includes.h"' >> driver_conf.c
350 echo '#include "hostapd.h"' >> driver_conf.c
351 echo '#include "driver.h"' >> driver_conf.c
352 ifdef CONFIG_DRIVER_HOSTAP
353 echo "void hostap_driver_register(void);" >> driver_conf.c
355 ifdef CONFIG_DRIVER_WIRED
356 echo "void wired_driver_register(void);" >> driver_conf.c
358 ifdef CONFIG_DRIVER_MADWIFI
359 echo "void madwifi_driver_register(void);" >> driver_conf.c
361 ifdef CONFIG_DRIVER_PRISM54
362 echo "void prism54_driver_register(void);" >> driver_conf.c
364 ifdef CONFIG_DRIVER_DEVICESCAPE
365 echo "void devicescape_driver_register(void);" >> driver_conf.c
367 ifdef CONFIG_DRIVER_BSD
368 echo "void bsd_driver_register(void);" >> driver_conf.c
370 ifdef CONFIG_DRIVER_TEST
371 echo "void test_driver_register(void);" >> driver_conf.c
373 echo 'void register_drivers(void) {' >> driver_conf.c
374 ifdef CONFIG_DRIVER_HOSTAP
375 echo "hostap_driver_register();" >> driver_conf.c
377 ifdef CONFIG_DRIVER_WIRED
378 echo "wired_driver_register();" >> driver_conf.c
380 ifdef CONFIG_DRIVER_MADWIFI
381 echo "madwifi_driver_register();" >> driver_conf.c
383 ifdef CONFIG_DRIVER_PRISM54
384 echo "prism54_driver_register();" >> driver_conf.c
386 ifdef CONFIG_DRIVER_DEVICESCAPE
387 echo "devicescape_driver_register();" >> driver_conf.c
389 ifdef CONFIG_DRIVER_BSD
390 echo "bsd_driver_register();" >> driver_conf.c
392 ifdef CONFIG_DRIVER_TEST
393 echo "test_driver_register();" >> driver_conf.c
395 echo '}' >> driver_conf.c
397 hostapd_cli: hostapd_cli.o $(DIR_WPA_SUPPLICANT)/wpa_ctrl.o
398 $(CC) -o hostapd_cli hostapd_cli.o $(DIR_WPA_SUPPLICANT)/wpa_ctrl.o
400 NOBJS = nt_password_hash.o $(DIR_WPA_SUPPLICANT)/ms_funcs.o sha1.o rc4.o md5.o
401 NOBJS += $(DIR_WPA_SUPPLICANT)/crypto.o os_$(CONFIG_OS).o
406 nt_password_hash: $(NOBJS)
407 $(CC) -o nt_password_hash $(NOBJS) $(LIBS_n)
410 $(CC) -o hlr_auc_gw $(HOBJS) $(LIBS_h)
413 rm -f core *~ *.o hostapd hostapd_cli nt_password_hash hlr_auc_gw
414 rm -f *.d driver_conf.c
417 fig2dev -L eps $*.fig $*.eps
420 fig2dev -L png -m 3 $*.fig | pngtopnm | pnmscale 0.4 | pnmtopng \
423 docs-pics: doc/hostapd.png doc/hostapd.eps
426 doxygen doc/doxygen.full
428 cp doc/latex/refman.pdf hostapd-devel.pdf
431 doxygen doc/doxygen.fast
434 rm -rf doc/latex doc/html
435 rm -f doc/hosta.d{eps,png} hostapd-devel.pdf
437 TEST_SRC_MILENAGE = milenage.c aes_wrap.c common.c os_$(CONFIG_OS).c
438 test-milenage: $(TEST_SRC_MILENAGE)
439 $(CC) -o test-milenage -Wall -Werror $(TEST_SRC_MILENAGE) \
440 -DTEST_MAIN_MILENAGE -I. -I../wpa_supplicant -DINTERNAL_AES
444 -include $(OBJS:%.o=%.d)