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
14 CFLAGS
+= -I..
/src
/crypto
15 CFLAGS
+= -I..
/src
/utils
16 CFLAGS
+= -I..
/src
/common
18 # Uncomment following line and set the path to your kernel tree include
19 # directory if your C library does not include all header files.
20 # CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
25 ifdef CONFIG_NATIVE_WINDOWS
32 ifeq ($(CONFIG_OS
), internal
)
33 CFLAGS
+= -DOS_NO_C_LIB_DEFINES
36 ifdef CONFIG_NATIVE_WINDOWS
37 CFLAGS
+= -DCONFIG_NATIVE_WINDOWS
41 OBJS
= hostapd.o ieee802_1x.o eapol_sm.o \
42 ieee802_11.o config.o ieee802_11_auth.o accounting.o \
43 sta_info.o wpa.o ctrl_iface.o \
44 drivers.o preauth.o pmksa_cache.o beacon.o \
45 hw_features.o wme.o ap_list.o \
46 mlme.o vlan_init.o wpa_auth_ie.o
48 OBJS
+= ..
/src
/utils
/eloop.o
49 OBJS
+= ..
/src
/utils
/common.o
50 OBJS
+= ..
/src
/utils
/wpa_debug.o
51 OBJS
+= ..
/src
/utils
/wpabuf.o
52 OBJS
+= ..
/src
/utils
/os_
$(CONFIG_OS
).o
53 OBJS
+= ..
/src
/utils
/ip_addr.o
55 OBJS
+= ..
/src
/common
/ieee802_11_common.o
56 OBJS
+= ..
/src
/common
/wpa_common.o
58 OBJS
+= ..
/src
/radius
/radius.o
59 OBJS
+= ..
/src
/radius
/radius_client.o
61 OBJS
+= ..
/src
/crypto
/md5.o
62 OBJS
+= ..
/src
/crypto
/rc4.o
63 OBJS
+= ..
/src
/crypto
/md4.o
64 OBJS
+= ..
/src
/crypto
/sha1.o
65 OBJS
+= ..
/src
/crypto
/des.o
66 OBJS
+= ..
/src
/crypto
/aes_wrap.o
67 OBJS
+= ..
/src
/crypto
/aes.o
69 HOBJS
=..
/src
/hlr_auc_gw
/hlr_auc_gw.o ..
/src
/utils
/common.o ..
/src
/utils
/wpa_debug.o ..
/src
/utils
/os_
$(CONFIG_OS
).o ..
/src
/hlr_auc_gw
/milenage.o ..
/src
/crypto
/aes_wrap.o ..
/src
/crypto
/aes.o
71 CFLAGS
+= -DCONFIG_CTRL_IFACE
-DCONFIG_CTRL_IFACE_UNIX
74 CFLAGS
+= -DCONFIG_IAPP
78 ifdef CONFIG_RSN_PREAUTH
79 CFLAGS
+= -DCONFIG_RSN_PREAUTH
84 CFLAGS
+= -DCONFIG_PEERKEY
88 ifdef CONFIG_IEEE80211W
89 CFLAGS
+= -DCONFIG_IEEE80211W
93 ifdef CONFIG_IEEE80211R
94 CFLAGS
+= -DCONFIG_IEEE80211R
99 ifdef CONFIG_IEEE80211N
100 CFLAGS
+= -DCONFIG_IEEE80211N
103 ifdef CONFIG_DRIVER_HOSTAP
104 CFLAGS
+= -DCONFIG_DRIVER_HOSTAP
105 OBJS
+= driver_hostap.o
108 ifdef CONFIG_DRIVER_WIRED
109 CFLAGS
+= -DCONFIG_DRIVER_WIRED
110 OBJS
+= driver_wired.o
113 ifdef CONFIG_DRIVER_MADWIFI
114 CFLAGS
+= -DCONFIG_DRIVER_MADWIFI
115 OBJS
+= driver_madwifi.o
119 ifdef CONFIG_DRIVER_PRISM54
120 CFLAGS
+= -DCONFIG_DRIVER_PRISM54
121 OBJS
+= driver_prism54.o
124 ifdef CONFIG_DRIVER_NL80211
125 CFLAGS
+= -DCONFIG_DRIVER_NL80211
126 OBJS
+= driver_nl80211.o radiotap.o
130 CFLAGS
+= -DCONFIG_LIBNL20
134 ifdef CONFIG_DRIVER_BSD
135 CFLAGS
+= -DCONFIG_DRIVER_BSD
142 ifdef CONFIG_DRIVER_TEST
143 CFLAGS
+= -DCONFIG_DRIVER_TEST
144 OBJS
+= driver_test.o
147 ifdef CONFIG_DRIVER_NONE
148 CFLAGS
+= -DCONFIG_DRIVER_NONE
149 OBJS
+= driver_none.o
152 ifdef CONFIG_L2_PACKET
153 ifdef CONFIG_DNET_PCAP
154 ifdef CONFIG_L2_FREEBSD
156 OBJS
+= ..
/src
/l2_packet
/l2_packet_freebsd.o
158 LIBS
+= -ldnet
-lpcap
159 OBJS
+= ..
/src
/l2_packet
/l2_packet_pcap.o
162 OBJS
+= ..
/src
/l2_packet
/l2_packet_linux.o
165 OBJS
+= ..
/src
/l2_packet
/l2_packet_none.o
171 OBJS
+= ..
/src
/eap_server
/eap_md5.o
177 OBJS
+= ..
/src
/eap_server
/eap_tls.o
181 ifdef CONFIG_EAP_PEAP
183 OBJS
+= ..
/src
/eap_server
/eap_peap.o
184 OBJS
+= ..
/src
/eap_common
/eap_peap_common.o
186 CONFIG_EAP_MSCHAPV2
=y
189 ifdef CONFIG_EAP_TTLS
191 OBJS
+= ..
/src
/eap_server
/eap_ttls.o
196 ifdef CONFIG_EAP_MSCHAPV2
197 CFLAGS
+= -DEAP_MSCHAPv2
198 OBJS
+= ..
/src
/eap_server
/eap_mschapv2.o
204 OBJS
+= ..
/src
/eap_server
/eap_gtc.o
209 OBJS
+= ..
/src
/eap_server
/eap_sim.o
210 CONFIG_EAP_SIM_COMMON
=y
215 OBJS
+= ..
/src
/eap_server
/eap_aka.o
216 CONFIG_EAP_SIM_COMMON
=y
219 ifdef CONFIG_EAP_AKA_PRIME
220 CFLAGS
+= -DEAP_AKA_PRIME
223 ifdef CONFIG_EAP_SIM_COMMON
224 OBJS
+= ..
/src
/eap_common
/eap_sim_common.o
225 # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
226 # replaced with another file implementating the interface specified in
228 OBJS
+= ..
/src
/eap_server
/eap_sim_db.o
234 OBJS
+= ..
/src
/eap_server
/eap_pax.o ..
/src
/eap_common
/eap_pax_common.o
239 OBJS
+= ..
/src
/eap_server
/eap_psk.o ..
/src
/eap_common
/eap_psk_common.o
242 ifdef CONFIG_EAP_SAKE
244 OBJS
+= ..
/src
/eap_server
/eap_sake.o ..
/src
/eap_common
/eap_sake_common.o
247 ifdef CONFIG_EAP_GPSK
249 OBJS
+= ..
/src
/eap_server
/eap_gpsk.o ..
/src
/eap_common
/eap_gpsk_common.o
250 ifdef CONFIG_EAP_GPSK_SHA256
251 CFLAGS
+= -DEAP_GPSK_SHA256
256 ifdef CONFIG_EAP_VENDOR_TEST
257 CFLAGS
+= -DEAP_VENDOR_TEST
258 OBJS
+= ..
/src
/eap_server
/eap_vendor_test.o
261 ifdef CONFIG_EAP_FAST
263 OBJS
+= ..
/src
/eap_server
/eap_fast.o
264 OBJS
+= ..
/src
/eap_common
/eap_fast_common.o
270 CFLAGS
+= -DCONFIG_WPS
-DEAP_WSC
271 OBJS
+= ..
/src
/utils
/uuid.o
272 OBJS
+= wps_hostapd.o
273 OBJS
+= ..
/src
/eap_server
/eap_wsc.o ..
/src
/eap_common
/eap_wsc_common.o
274 OBJS
+= ..
/src
/wps
/wps.o
275 OBJS
+= ..
/src
/wps
/wps_common.o
276 OBJS
+= ..
/src
/wps
/wps_attr_parse.o
277 OBJS
+= ..
/src
/wps
/wps_attr_build.o
278 OBJS
+= ..
/src
/wps
/wps_attr_process.o
279 OBJS
+= ..
/src
/wps
/wps_dev_attr.o
280 OBJS
+= ..
/src
/wps
/wps_enrollee.o
281 OBJS
+= ..
/src
/wps
/wps_registrar.o
288 ifdef CONFIG_EAP_IKEV2
289 CFLAGS
+= -DEAP_IKEV2
290 OBJS
+= ..
/src
/eap_server
/eap_ikev2.o ..
/src
/eap_server
/ikev2.o
291 OBJS
+= ..
/src
/eap_common
/eap_ikev2_common.o ..
/src
/eap_common
/ikev2_common.o
297 OBJS
+= ..
/src
/eap_server
/eap_tnc.o
298 OBJS
+= ..
/src
/eap_server
/tncs.o
302 # Basic EAP functionality is needed for EAPOL
303 OBJS
+= ..
/src
/eap_server
/eap.o
304 OBJS
+= ..
/src
/eap_common
/eap_common.o
305 OBJS
+= ..
/src
/eap_server
/eap_methods.o
306 OBJS
+= ..
/src
/eap_server
/eap_identity.o
309 CFLAGS
+= -DEAP_SERVER
316 ifeq ($(CONFIG_TLS
), internal
)
318 CONFIG_CRYPTO
=internal
321 ifeq ($(CONFIG_CRYPTO
), libtomcrypt
)
322 CFLAGS
+= -DCONFIG_INTERNAL_X509
324 ifeq ($(CONFIG_CRYPTO
), internal
)
325 CFLAGS
+= -DCONFIG_INTERNAL_X509
330 # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
331 CFLAGS
+= -DEAP_TLS_FUNCS
332 OBJS
+= ..
/src
/eap_server
/eap_tls_common.o
333 ifeq ($(CONFIG_TLS
), openssl
)
334 OBJS
+= ..
/src
/crypto
/tls_openssl.o
335 LIBS
+= -lssl
-lcrypto
339 ifeq ($(CONFIG_TLS
), gnutls
)
340 OBJS
+= ..
/src
/crypto
/tls_gnutls.o
341 LIBS
+= -lgnutls
-lgcrypt
-lgpg-error
345 ifdef CONFIG_GNUTLS_EXTRA
346 CFLAGS
+= -DCONFIG_GNUTLS_EXTRA
347 LIBS
+= -lgnutls-extra
349 ifeq ($(CONFIG_TLS
), internal
)
350 OBJS
+= ..
/src
/crypto
/tls_internal.o
351 OBJS
+= ..
/src
/tls
/tlsv1_common.o ..
/src
/tls
/tlsv1_record.o
352 OBJS
+= ..
/src
/tls
/tlsv1_cred.o ..
/src
/tls
/tlsv1_server.o
353 OBJS
+= ..
/src
/tls
/tlsv1_server_write.o ..
/src
/tls
/tlsv1_server_read.o
354 OBJS
+= ..
/src
/tls
/asn1.o ..
/src
/tls
/x509v3.o
355 OBJS_p
+= ..
/src
/tls
/asn1.o
356 OBJS_p
+= ..
/src
/crypto
/rc4.o ..
/src
/crypto
/aes_wrap.o ..
/src
/crypto
/aes.o
358 CFLAGS
+= -DCONFIG_TLS_INTERNAL
359 CFLAGS
+= -DCONFIG_TLS_INTERNAL_SERVER
360 ifeq ($(CONFIG_CRYPTO
), internal
)
361 ifdef CONFIG_INTERNAL_LIBTOMMATH
362 CFLAGS
+= -DCONFIG_INTERNAL_LIBTOMMATH
368 ifeq ($(CONFIG_CRYPTO
), libtomcrypt
)
369 LIBS
+= -ltomcrypt
-ltfm
370 LIBS_p
+= -ltomcrypt
-ltfm
375 OBJS
+= ..
/src
/crypto
/tls_none.o
379 CFLAGS
+= -DPKCS12_FUNCS
383 OBJS
+= ..
/src
/crypto
/ms_funcs.o
388 OBJS
+= ..
/src
/eap_common
/chap.o
393 ifeq ($(CONFIG_TLS
), openssl
)
398 ifeq ($(CONFIG_TLS
), gnutls
)
403 ifeq ($(CONFIG_TLS
), internal
)
404 ifeq ($(CONFIG_CRYPTO
), libtomcrypt
)
405 LIBS
+= -ltomcrypt
-ltfm
406 LIBS_p
+= -ltomcrypt
-ltfm
410 ifeq ($(CONFIG_TLS
), openssl
)
411 OBJS
+= ..
/src
/crypto
/crypto_openssl.o
412 OBJS_p
+= ..
/src
/crypto
/crypto_openssl.o
413 HOBJS
+= ..
/src
/crypto
/crypto_openssl.o
414 CONFIG_INTERNAL_SHA256
=y
416 ifeq ($(CONFIG_TLS
), gnutls
)
417 OBJS
+= ..
/src
/crypto
/crypto_gnutls.o
418 OBJS_p
+= ..
/src
/crypto
/crypto_gnutls.o
419 HOBJS
+= ..
/src
/crypto
/crypto_gnutls.o
420 CONFIG_INTERNAL_SHA256
=y
422 ifeq ($(CONFIG_TLS
), internal
)
423 ifeq ($(CONFIG_CRYPTO
), libtomcrypt
)
424 OBJS
+= ..
/src
/crypto
/crypto_libtomcrypt.o
425 OBJS_p
+= ..
/src
/crypto
/crypto_libtomcrypt.o
426 CONFIG_INTERNAL_SHA256
=y
428 ifeq ($(CONFIG_CRYPTO
), internal
)
429 OBJS
+= ..
/src
/crypto
/crypto_internal.o ..
/src
/tls
/rsa.o ..
/src
/tls
/bignum.o
430 OBJS_p
+= ..
/src
/crypto
/crypto_internal.o ..
/src
/tls
/rsa.o ..
/src
/tls
/bignum.o
431 CFLAGS
+= -DCONFIG_CRYPTO_INTERNAL
432 CONFIG_INTERNAL_AES
=y
433 CONFIG_INTERNAL_DES
=y
434 CONFIG_INTERNAL_SHA1
=y
435 CONFIG_INTERNAL_MD4
=y
436 CONFIG_INTERNAL_MD5
=y
437 CONFIG_INTERNAL_SHA256
=y
441 CONFIG_INTERNAL_AES
=y
442 CONFIG_INTERNAL_SHA1
=y
443 CONFIG_INTERNAL_MD5
=y
444 CONFIG_INTERNAL_SHA256
=y
447 ifdef CONFIG_INTERNAL_AES
448 CFLAGS
+= -DINTERNAL_AES
450 ifdef CONFIG_INTERNAL_SHA1
451 CFLAGS
+= -DINTERNAL_SHA1
453 ifdef CONFIG_INTERNAL_SHA256
454 CFLAGS
+= -DINTERNAL_SHA256
456 ifdef CONFIG_INTERNAL_MD5
457 CFLAGS
+= -DINTERNAL_MD5
459 ifdef CONFIG_INTERNAL_MD4
460 CFLAGS
+= -DINTERNAL_MD4
462 ifdef CONFIG_INTERNAL_DES
463 CFLAGS
+= -DINTERNAL_DES
467 OBJS
+= ..
/src
/crypto
/sha256.o
471 OBJS
+= ..
/src
/crypto
/dh_groups.o
474 ifndef NEED_FIPS186_2_PRF
475 CFLAGS
+= -DCONFIG_NO_FIPS186_2_PRF
479 CFLAGS
+= -DCONFIG_NO_T_PRF
482 ifdef CONFIG_RADIUS_SERVER
483 CFLAGS
+= -DRADIUS_SERVER
484 OBJS
+= ..
/src
/radius
/radius_server.o
488 CFLAGS
+= -DCONFIG_IPV6
491 ifdef CONFIG_DRIVER_RADIUS_ACL
492 CFLAGS
+= -DCONFIG_DRIVER_RADIUS_ACL
495 ifdef CONFIG_FULL_DYNAMIC_VLAN
496 # define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
497 # and vlan interfaces for the vlan feature.
498 CFLAGS
+= -DCONFIG_FULL_DYNAMIC_VLAN
502 OBJS
+= ..
/src
/utils
/base64.o
505 ifdef CONFIG_NO_STDOUT_DEBUG
506 CFLAGS
+= -DCONFIG_NO_STDOUT_DEBUG
509 ALL
=hostapd hostapd_cli
511 all: verify_config
$(ALL
)
514 @if
[ ! -r .config
]; then \
515 echo
'Building hostapd requires a configuration file'; \
516 echo
'(.config). See README for more instructions. You can'; \
517 echo
'run "cp defconfig .config" to create an example'; \
518 echo
'configuration.'; \
523 for i in
$(ALL
); do cp
$$i /usr
/local
/bin
/$$i; done
526 $(CC
) -o hostapd
$(OBJS
) $(LIBS
)
528 OBJS_c
= hostapd_cli.o ..
/src
/common
/wpa_ctrl.o ..
/src
/utils
/os_
$(CONFIG_OS
).o
529 hostapd_cli
: $(OBJS_c
)
530 $(CC
) -o hostapd_cli
$(OBJS_c
)
532 NOBJS
= nt_password_hash.o ..
/src
/crypto
/ms_funcs.o ..
/src
/crypto
/sha1.o ..
/src
/crypto
/rc4.o ..
/src
/crypto
/md5.o
533 NOBJS
+= ..
/src
/crypto
/crypto_openssl.o ..
/src
/utils
/os_
$(CONFIG_OS
).o
538 nt_password_hash
: $(NOBJS
)
539 $(CC
) -o nt_password_hash
$(NOBJS
) $(LIBS_n
)
542 $(CC
) -o hlr_auc_gw
$(HOBJS
) $(LIBS_h
)
545 $(MAKE
) -C ..
/src
clean
546 rm -f core
*~
*.o hostapd hostapd_cli nt_password_hash hlr_auc_gw
550 fig2dev
-L eps
$*.fig
$*.eps
553 fig2dev
-L png
-m
3 $*.fig | pngtopnm | pnmscale
0.4 | pnmtopng \
556 docs-pics
: doc
/hostapd.png doc
/hostapd.eps
559 (cd ..
; doxygen hostapd
/doc
/doxygen.full
; cd hostapd
)
561 cp doc
/latex
/refman.pdf hostapd-devel.pdf
564 (cd ..
; doxygen hostapd
/doc
/doxygen.fast
; cd hostapd
)
567 rm -rf doc
/latex doc
/html
568 rm -f doc
/hostapd.
{eps
,png
} hostapd-devel.pdf
570 TEST_SRC_MILENAGE
= ..
/src
/hlr_auc_gw
/milenage.c ..
/src
/crypto
/aes_wrap.c ..
/src
/crypto
/aes.c ..
/src
/utils
/common.c ..
/src
/utils
/wpa_debug.o ..
/src
/utils
/os_
$(CONFIG_OS
).c
571 test-milenage
: $(TEST_SRC_MILENAGE
)
572 $(CC
) -o test-milenage
-Wall
-Werror
$(TEST_SRC_MILENAGE
) \
573 -DTEST_MAIN_MILENAGE
-I.
-DINTERNAL_AES \
574 -I..
/src
/crypto
-I..
/src
/utils
578 -include $(OBJS
:%.o
=%.d
)