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 reconfig.o \
46 mlme.o vlan_init.o ieee802_11h.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
/wpa_common.o
57 OBJS
+= ..
/src
/radius
/radius.o
58 OBJS
+= ..
/src
/radius
/radius_client.o
60 OBJS
+= ..
/src
/crypto
/md5.o
61 OBJS
+= ..
/src
/crypto
/rc4.o
62 OBJS
+= ..
/src
/crypto
/md4.o
63 OBJS
+= ..
/src
/crypto
/sha1.o
64 OBJS
+= ..
/src
/crypto
/des.o
65 OBJS
+= ..
/src
/crypto
/aes_wrap.o
66 OBJS
+= ..
/src
/crypto
/aes.o
68 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
70 CFLAGS
+= -DCONFIG_CTRL_IFACE
-DCONFIG_CTRL_IFACE_UNIX
73 CFLAGS
+= -DCONFIG_IAPP
77 ifdef CONFIG_RSN_PREAUTH
78 CFLAGS
+= -DCONFIG_RSN_PREAUTH
83 CFLAGS
+= -DCONFIG_PEERKEY
87 ifdef CONFIG_IEEE80211W
88 CFLAGS
+= -DCONFIG_IEEE80211W
92 ifdef CONFIG_IEEE80211R
93 CFLAGS
+= -DCONFIG_IEEE80211R
98 ifdef CONFIG_DRIVER_HOSTAP
99 CFLAGS
+= -DCONFIG_DRIVER_HOSTAP
100 OBJS
+= driver_hostap.o
103 ifdef CONFIG_DRIVER_WIRED
104 CFLAGS
+= -DCONFIG_DRIVER_WIRED
105 OBJS
+= driver_wired.o
108 ifdef CONFIG_DRIVER_MADWIFI
109 CFLAGS
+= -DCONFIG_DRIVER_MADWIFI
110 OBJS
+= driver_madwifi.o
114 ifdef CONFIG_DRIVER_PRISM54
115 CFLAGS
+= -DCONFIG_DRIVER_PRISM54
116 OBJS
+= driver_prism54.o
119 ifdef CONFIG_DRIVER_NL80211
120 CFLAGS
+= -DCONFIG_DRIVER_NL80211
121 OBJS
+= driver_nl80211.o radiotap.o
125 ifdef CONFIG_DRIVER_BSD
126 CFLAGS
+= -DCONFIG_DRIVER_BSD
133 ifdef CONFIG_DRIVER_TEST
134 CFLAGS
+= -DCONFIG_DRIVER_TEST
135 OBJS
+= driver_test.o
138 ifdef CONFIG_L2_PACKET
139 ifdef CONFIG_DNET_PCAP
140 ifdef CONFIG_L2_FREEBSD
142 OBJS
+= ..
/src
/l2_packet
/l2_packet_freebsd.o
144 LIBS
+= -ldnet
-lpcap
145 OBJS
+= ..
/src
/l2_packet
/l2_packet_pcap.o
148 OBJS
+= ..
/src
/l2_packet
/l2_packet_linux.o
155 OBJS
+= ..
/src
/eap_server
/eap_md5.o
161 OBJS
+= ..
/src
/eap_server
/eap_tls.o
165 ifdef CONFIG_EAP_PEAP
167 OBJS
+= ..
/src
/eap_server
/eap_peap.o
168 OBJS
+= ..
/src
/eap_common
/eap_peap_common.o
170 CONFIG_EAP_MSCHAPV2
=y
173 ifdef CONFIG_EAP_TTLS
175 OBJS
+= ..
/src
/eap_server
/eap_ttls.o
180 ifdef CONFIG_EAP_MSCHAPV2
181 CFLAGS
+= -DEAP_MSCHAPv2
182 OBJS
+= ..
/src
/eap_server
/eap_mschapv2.o
188 OBJS
+= ..
/src
/eap_server
/eap_gtc.o
193 OBJS
+= ..
/src
/eap_server
/eap_sim.o
194 CONFIG_EAP_SIM_COMMON
=y
199 OBJS
+= ..
/src
/eap_server
/eap_aka.o
200 CONFIG_EAP_SIM_COMMON
=y
203 ifdef CONFIG_EAP_SIM_COMMON
204 OBJS
+= ..
/src
/eap_common
/eap_sim_common.o
205 # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
206 # replaced with another file implementating the interface specified in
208 OBJS
+= ..
/src
/eap_server
/eap_sim_db.o
214 OBJS
+= ..
/src
/eap_server
/eap_pax.o ..
/src
/eap_common
/eap_pax_common.o
219 OBJS
+= ..
/src
/eap_server
/eap_psk.o ..
/src
/eap_common
/eap_psk_common.o
222 ifdef CONFIG_EAP_SAKE
224 OBJS
+= ..
/src
/eap_server
/eap_sake.o ..
/src
/eap_common
/eap_sake_common.o
227 ifdef CONFIG_EAP_GPSK
229 OBJS
+= ..
/src
/eap_server
/eap_gpsk.o ..
/src
/eap_common
/eap_gpsk_common.o
230 ifdef CONFIG_EAP_GPSK_SHA256
231 CFLAGS
+= -DEAP_GPSK_SHA256
236 ifdef CONFIG_EAP_VENDOR_TEST
237 CFLAGS
+= -DEAP_VENDOR_TEST
238 OBJS
+= ..
/src
/eap_server
/eap_vendor_test.o
241 ifdef CONFIG_EAP_FAST
243 OBJS
+= ..
/src
/eap_server
/eap_fast.o
244 OBJS
+= ..
/src
/eap_common
/eap_fast_common.o
249 ifdef CONFIG_EAP_IKEV2
250 CFLAGS
+= -DEAP_IKEV2
251 OBJS
+= ..
/src
/eap_server
/eap_ikev2.o ..
/src
/eap_server
/ikev2.o
252 OBJS
+= ..
/src
/eap_common
/eap_ikev2_common.o ..
/src
/eap_common
/ikev2_common.o
258 OBJS
+= ..
/src
/eap_server
/eap_tnc.o
259 OBJS
+= ..
/src
/eap_server
/tncs.o
263 # Basic EAP functionality is needed for EAPOL
264 OBJS
+= ..
/src
/eap_server
/eap.o
265 OBJS
+= ..
/src
/eap_common
/eap_common.o
266 OBJS
+= ..
/src
/eap_server
/eap_methods.o
267 OBJS
+= ..
/src
/eap_server
/eap_identity.o
270 CFLAGS
+= -DEAP_SERVER
277 ifeq ($(CONFIG_TLS
), internal
)
279 CONFIG_CRYPTO
=internal
282 ifeq ($(CONFIG_CRYPTO
), libtomcrypt
)
283 CFLAGS
+= -DCONFIG_INTERNAL_X509
285 ifeq ($(CONFIG_CRYPTO
), internal
)
286 CFLAGS
+= -DCONFIG_INTERNAL_X509
291 # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
292 CFLAGS
+= -DEAP_TLS_FUNCS
293 OBJS
+= ..
/src
/eap_server
/eap_tls_common.o
294 ifeq ($(CONFIG_TLS
), openssl
)
295 OBJS
+= ..
/src
/crypto
/tls_openssl.o
296 LIBS
+= -lssl
-lcrypto
300 ifeq ($(CONFIG_TLS
), gnutls
)
301 OBJS
+= ..
/src
/crypto
/tls_gnutls.o
302 LIBS
+= -lgnutls
-lgcrypt
-lgpg-error
306 ifdef CONFIG_GNUTLS_EXTRA
307 CFLAGS
+= -DCONFIG_GNUTLS_EXTRA
308 LIBS
+= -lgnutls-extra
310 ifeq ($(CONFIG_TLS
), internal
)
311 OBJS
+= ..
/src
/crypto
/tls_internal.o
312 OBJS
+= ..
/src
/tls
/tlsv1_common.o ..
/src
/tls
/tlsv1_record.o
313 OBJS
+= ..
/src
/tls
/tlsv1_cred.o ..
/src
/tls
/tlsv1_server.o
314 OBJS
+= ..
/src
/tls
/tlsv1_server_write.o ..
/src
/tls
/tlsv1_server_read.o
315 OBJS
+= ..
/src
/tls
/asn1.o ..
/src
/tls
/x509v3.o
316 OBJS_p
+= ..
/src
/tls
/asn1.o
317 OBJS_p
+= ..
/src
/crypto
/rc4.o ..
/src
/crypto
/aes_wrap.o ..
/src
/crypto
/aes.o
319 CFLAGS
+= -DCONFIG_TLS_INTERNAL
320 CFLAGS
+= -DCONFIG_TLS_INTERNAL_SERVER
321 ifeq ($(CONFIG_CRYPTO
), internal
)
322 ifdef CONFIG_INTERNAL_LIBTOMMATH
323 CFLAGS
+= -DCONFIG_INTERNAL_LIBTOMMATH
329 ifeq ($(CONFIG_CRYPTO
), libtomcrypt
)
330 LIBS
+= -ltomcrypt
-ltfm
331 LIBS_p
+= -ltomcrypt
-ltfm
336 OBJS
+= ..
/src
/crypto
/tls_none.o
340 CFLAGS
+= -DPKCS12_FUNCS
344 OBJS
+= ..
/src
/crypto
/ms_funcs.o
349 OBJS
+= ..
/src
/eap_common
/chap.o
354 ifeq ($(CONFIG_TLS
), openssl
)
359 ifeq ($(CONFIG_TLS
), gnutls
)
364 ifeq ($(CONFIG_TLS
), internal
)
365 ifeq ($(CONFIG_CRYPTO
), libtomcrypt
)
366 LIBS
+= -ltomcrypt
-ltfm
367 LIBS_p
+= -ltomcrypt
-ltfm
371 ifeq ($(CONFIG_TLS
), openssl
)
372 OBJS
+= ..
/src
/crypto
/crypto_openssl.o
373 OBJS_p
+= ..
/src
/crypto
/crypto_openssl.o
374 HOBJS
+= ..
/src
/crypto
/crypto_openssl.o
375 CONFIG_INTERNAL_SHA256
=y
377 ifeq ($(CONFIG_TLS
), gnutls
)
378 OBJS
+= ..
/src
/crypto
/crypto_gnutls.o
379 OBJS_p
+= ..
/src
/crypto
/crypto_gnutls.o
380 HOBJS
+= ..
/src
/crypto
/crypto_gnutls.o
381 CONFIG_INTERNAL_SHA256
=y
383 ifeq ($(CONFIG_TLS
), internal
)
384 ifeq ($(CONFIG_CRYPTO
), libtomcrypt
)
385 OBJS
+= ..
/src
/crypto
/crypto_libtomcrypt.o
386 OBJS_p
+= ..
/src
/crypto
/crypto_libtomcrypt.o
387 CONFIG_INTERNAL_SHA256
=y
389 ifeq ($(CONFIG_CRYPTO
), internal
)
390 OBJS
+= ..
/src
/crypto
/crypto_internal.o ..
/src
/tls
/rsa.o ..
/src
/tls
/bignum.o
391 OBJS_p
+= ..
/src
/crypto
/crypto_internal.o ..
/src
/tls
/rsa.o ..
/src
/tls
/bignum.o
392 CFLAGS
+= -DCONFIG_CRYPTO_INTERNAL
393 CONFIG_INTERNAL_AES
=y
394 CONFIG_INTERNAL_DES
=y
395 CONFIG_INTERNAL_SHA1
=y
396 CONFIG_INTERNAL_MD4
=y
397 CONFIG_INTERNAL_MD5
=y
398 CONFIG_INTERNAL_SHA256
=y
402 CONFIG_INTERNAL_AES
=y
403 CONFIG_INTERNAL_SHA1
=y
404 CONFIG_INTERNAL_MD5
=y
405 CONFIG_INTERNAL_SHA256
=y
408 ifdef CONFIG_INTERNAL_AES
409 CFLAGS
+= -DINTERNAL_AES
411 ifdef CONFIG_INTERNAL_SHA1
412 CFLAGS
+= -DINTERNAL_SHA1
414 ifdef CONFIG_INTERNAL_SHA256
415 CFLAGS
+= -DINTERNAL_SHA256
417 ifdef CONFIG_INTERNAL_MD5
418 CFLAGS
+= -DINTERNAL_MD5
420 ifdef CONFIG_INTERNAL_MD4
421 CFLAGS
+= -DINTERNAL_MD4
423 ifdef CONFIG_INTERNAL_DES
424 CFLAGS
+= -DINTERNAL_DES
428 OBJS
+= ..
/src
/crypto
/sha256.o
432 OBJS
+= ..
/src
/crypto
/dh_groups.o
435 ifndef NEED_FIPS186_2_PRF
436 CFLAGS
+= -DCONFIG_NO_FIPS186_2_PRF
440 CFLAGS
+= -DCONFIG_NO_T_PRF
443 ifdef CONFIG_RADIUS_SERVER
444 CFLAGS
+= -DRADIUS_SERVER
445 OBJS
+= ..
/src
/radius
/radius_server.o
449 CFLAGS
+= -DCONFIG_IPV6
452 ifdef CONFIG_DRIVER_RADIUS_ACL
453 CFLAGS
+= -DCONFIG_DRIVER_RADIUS_ACL
456 ifdef CONFIG_FULL_DYNAMIC_VLAN
457 # define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
458 # and vlan interfaces for the vlan feature.
459 CFLAGS
+= -DCONFIG_FULL_DYNAMIC_VLAN
463 OBJS
+= ..
/src
/utils
/base64.o
466 ALL
=hostapd hostapd_cli
468 all: verify_config
$(ALL
)
471 @if
[ ! -r .config
]; then \
472 echo
'Building hostapd requires a configuration file'; \
473 echo
'(.config). See README for more instructions. You can'; \
474 echo
'run "cp defconfig .config" to create an example'; \
475 echo
'configuration.'; \
480 for i in
$(ALL
); do cp
$$i /usr
/local
/bin
/$$i; done
483 $(CC
) -o hostapd
$(OBJS
) $(LIBS
)
485 OBJS_c
= hostapd_cli.o ..
/src
/common
/wpa_ctrl.o ..
/src
/utils
/os_
$(CONFIG_OS
).o
486 hostapd_cli
: $(OBJS_c
)
487 $(CC
) -o hostapd_cli
$(OBJS_c
)
489 NOBJS
= nt_password_hash.o ..
/src
/crypto
/ms_funcs.o ..
/src
/crypto
/sha1.o ..
/src
/crypto
/rc4.o ..
/src
/crypto
/md5.o
490 NOBJS
+= ..
/src
/crypto
/crypto_openssl.o ..
/src
/utils
/os_
$(CONFIG_OS
).o
495 nt_password_hash
: $(NOBJS
)
496 $(CC
) -o nt_password_hash
$(NOBJS
) $(LIBS_n
)
499 $(CC
) -o hlr_auc_gw
$(HOBJS
) $(LIBS_h
)
502 $(MAKE
) -C ..
/src
clean
503 rm -f core
*~
*.o hostapd hostapd_cli nt_password_hash hlr_auc_gw
507 fig2dev
-L eps
$*.fig
$*.eps
510 fig2dev
-L png
-m
3 $*.fig | pngtopnm | pnmscale
0.4 | pnmtopng \
513 docs-pics
: doc
/hostapd.png doc
/hostapd.eps
516 doxygen doc
/doxygen.full
518 cp doc
/latex
/refman.pdf hostapd-devel.pdf
521 doxygen doc
/doxygen.fast
524 rm -rf doc
/latex doc
/html
525 rm -f doc
/hosta.d
{eps
,png
} hostapd-devel.pdf
527 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
528 test-milenage
: $(TEST_SRC_MILENAGE
)
529 $(CC
) -o test-milenage
-Wall
-Werror
$(TEST_SRC_MILENAGE
) \
530 -DTEST_MAIN_MILENAGE
-I.
-DINTERNAL_AES \
531 -I..
/src
/crypto
-I..
/src
/utils
535 hostapd-sparse
: $(OBJS
)
536 @echo Sparse run completed
539 CC
="sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -D__INT_MAX__=2147483647 -D__SHRT_MAX__=32767 -D__LONG_MAX__=2147483647 -D__SCHAR_MAX__=127 -Wbitwise" $(MAKE
) hostapd-sparse
541 -include $(OBJS
:%.o
=%.d
)