Makefile 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. ifndef CC
  2. CC=gcc
  3. endif
  4. ifndef CFLAGS
  5. CFLAGS = -MMD -O2 -Wall -g
  6. endif
  7. # define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to
  8. # a file (undefine it, if you want to save in binary size)
  9. CFLAGS += -DHOSTAPD_DUMP_STATE
  10. CFLAGS += -I../src
  11. CFLAGS += -I../src/crypto
  12. CFLAGS += -I../src/utils
  13. CFLAGS += -I../src/common
  14. # Uncomment following line and set the path to your kernel tree include
  15. # directory if your C library does not include all header files.
  16. # CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
  17. -include .config
  18. ifndef CONFIG_OS
  19. ifdef CONFIG_NATIVE_WINDOWS
  20. CONFIG_OS=win32
  21. else
  22. CONFIG_OS=unix
  23. endif
  24. endif
  25. ifeq ($(CONFIG_OS), internal)
  26. CFLAGS += -DOS_NO_C_LIB_DEFINES
  27. endif
  28. ifdef CONFIG_NATIVE_WINDOWS
  29. CFLAGS += -DCONFIG_NATIVE_WINDOWS
  30. LIBS += -lws2_32
  31. endif
  32. SHA1OBJS = ../src/crypto/sha1.o ../src/crypto/sha1-pbkdf2.o
  33. OBJS = hostapd.o main.o ieee802_1x.o eapol_sm.o \
  34. config.o ieee802_11_auth.o \
  35. sta_info.o wpa.o \
  36. preauth.o pmksa_cache.o \
  37. drv_callbacks.o \
  38. tkip_countermeasures.o \
  39. mlme.o wpa_auth_ie.o $(AESOBJS)
  40. OBJS += ../src/drivers/drivers.o
  41. OBJS += ../src/drivers/scan_helpers.o
  42. CFLAGS += -DHOSTAPD
  43. OBJS += ../src/utils/eloop.o
  44. OBJS += ../src/utils/common.o
  45. OBJS += ../src/utils/wpa_debug.o
  46. OBJS += ../src/utils/wpabuf.o
  47. OBJS += ../src/utils/os_$(CONFIG_OS).o
  48. OBJS += ../src/utils/ip_addr.o
  49. OBJS += ../src/common/ieee802_11_common.o
  50. OBJS += ../src/common/wpa_common.o
  51. ifdef CONFIG_NO_RADIUS
  52. CFLAGS += -DCONFIG_NO_RADIUS
  53. CONFIG_NO_ACCOUNTING=y
  54. else
  55. OBJS += ../src/radius/radius.o
  56. OBJS += ../src/radius/radius_client.o
  57. endif
  58. ifdef CONFIG_NO_ACCOUNTING
  59. CFLAGS += -DCONFIG_NO_ACCOUNTING
  60. else
  61. OBJS += accounting.o
  62. endif
  63. ifdef CONFIG_NO_VLAN
  64. CFLAGS += -DCONFIG_NO_VLAN
  65. else
  66. OBJS += vlan_init.o
  67. endif
  68. ifdef CONFIG_NO_CTRL_IFACE
  69. CFLAGS += -DCONFIG_NO_CTRL_IFACE
  70. else
  71. OBJS += ctrl_iface.o
  72. OBJS += ctrl_iface_ap.o
  73. endif
  74. OBJS += ../src/crypto/md5.o
  75. AESOBJS = # none so far
  76. CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX
  77. ifdef CONFIG_IAPP
  78. CFLAGS += -DCONFIG_IAPP
  79. OBJS += iapp.o
  80. endif
  81. ifdef CONFIG_RSN_PREAUTH
  82. CFLAGS += -DCONFIG_RSN_PREAUTH
  83. CONFIG_L2_PACKET=y
  84. endif
  85. ifdef CONFIG_PEERKEY
  86. CFLAGS += -DCONFIG_PEERKEY
  87. OBJS += peerkey.o
  88. endif
  89. ifdef CONFIG_IEEE80211W
  90. CFLAGS += -DCONFIG_IEEE80211W
  91. NEED_SHA256=y
  92. endif
  93. ifdef CONFIG_IEEE80211R
  94. CFLAGS += -DCONFIG_IEEE80211R
  95. OBJS += wpa_ft.o
  96. NEED_SHA256=y
  97. endif
  98. ifdef CONFIG_IEEE80211N
  99. CFLAGS += -DCONFIG_IEEE80211N
  100. endif
  101. include ../src/drivers/drivers.mak
  102. OBJS += $(DRV_AP_OBJS)
  103. CFLAGS += $(DRV_AP_CFLAGS)
  104. LDFLAGS += $(DRV_AP_LDFLAGS)
  105. LIBS += $(DRV_AP_LIBS)
  106. ifdef CONFIG_L2_PACKET
  107. ifdef CONFIG_DNET_PCAP
  108. ifdef CONFIG_L2_FREEBSD
  109. LIBS += -lpcap
  110. OBJS += ../src/l2_packet/l2_packet_freebsd.o
  111. else
  112. LIBS += -ldnet -lpcap
  113. OBJS += ../src/l2_packet/l2_packet_pcap.o
  114. endif
  115. else
  116. OBJS += ../src/l2_packet/l2_packet_linux.o
  117. endif
  118. else
  119. OBJS += ../src/l2_packet/l2_packet_none.o
  120. endif
  121. ifdef CONFIG_EAP_MD5
  122. CFLAGS += -DEAP_SERVER_MD5
  123. OBJS += ../src/eap_server/eap_md5.o
  124. CHAP=y
  125. endif
  126. ifdef CONFIG_EAP_TLS
  127. CFLAGS += -DEAP_SERVER_TLS
  128. OBJS += ../src/eap_server/eap_tls.o
  129. TLS_FUNCS=y
  130. endif
  131. ifdef CONFIG_EAP_PEAP
  132. CFLAGS += -DEAP_SERVER_PEAP
  133. OBJS += ../src/eap_server/eap_peap.o
  134. OBJS += ../src/eap_common/eap_peap_common.o
  135. TLS_FUNCS=y
  136. CONFIG_EAP_MSCHAPV2=y
  137. endif
  138. ifdef CONFIG_EAP_TTLS
  139. CFLAGS += -DEAP_SERVER_TTLS
  140. OBJS += ../src/eap_server/eap_ttls.o
  141. TLS_FUNCS=y
  142. CHAP=y
  143. endif
  144. ifdef CONFIG_EAP_MSCHAPV2
  145. CFLAGS += -DEAP_SERVER_MSCHAPV2
  146. OBJS += ../src/eap_server/eap_mschapv2.o
  147. MS_FUNCS=y
  148. endif
  149. ifdef CONFIG_EAP_GTC
  150. CFLAGS += -DEAP_SERVER_GTC
  151. OBJS += ../src/eap_server/eap_gtc.o
  152. endif
  153. ifdef CONFIG_EAP_SIM
  154. CFLAGS += -DEAP_SERVER_SIM
  155. OBJS += ../src/eap_server/eap_sim.o
  156. CONFIG_EAP_SIM_COMMON=y
  157. endif
  158. ifdef CONFIG_EAP_AKA
  159. CFLAGS += -DEAP_SERVER_AKA
  160. OBJS += ../src/eap_server/eap_aka.o
  161. CONFIG_EAP_SIM_COMMON=y
  162. NEED_SHA256=y
  163. endif
  164. ifdef CONFIG_EAP_AKA_PRIME
  165. CFLAGS += -DEAP_SERVER_AKA_PRIME
  166. endif
  167. ifdef CONFIG_EAP_SIM_COMMON
  168. OBJS += ../src/eap_common/eap_sim_common.o
  169. # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
  170. # replaced with another file implementating the interface specified in
  171. # eap_sim_db.h.
  172. OBJS += ../src/eap_server/eap_sim_db.o
  173. NEED_FIPS186_2_PRF=y
  174. endif
  175. ifdef CONFIG_EAP_PAX
  176. CFLAGS += -DEAP_SERVER_PAX
  177. OBJS += ../src/eap_server/eap_pax.o ../src/eap_common/eap_pax_common.o
  178. endif
  179. ifdef CONFIG_EAP_PSK
  180. CFLAGS += -DEAP_SERVER_PSK
  181. OBJS += ../src/eap_server/eap_psk.o ../src/eap_common/eap_psk_common.o
  182. endif
  183. ifdef CONFIG_EAP_SAKE
  184. CFLAGS += -DEAP_SERVER_SAKE
  185. OBJS += ../src/eap_server/eap_sake.o ../src/eap_common/eap_sake_common.o
  186. endif
  187. ifdef CONFIG_EAP_GPSK
  188. CFLAGS += -DEAP_SERVER_GPSK
  189. OBJS += ../src/eap_server/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o
  190. ifdef CONFIG_EAP_GPSK_SHA256
  191. CFLAGS += -DEAP_SERVER_GPSK_SHA256
  192. endif
  193. NEED_SHA256=y
  194. endif
  195. ifdef CONFIG_EAP_VENDOR_TEST
  196. CFLAGS += -DEAP_SERVER_VENDOR_TEST
  197. OBJS += ../src/eap_server/eap_vendor_test.o
  198. endif
  199. ifdef CONFIG_EAP_FAST
  200. CFLAGS += -DEAP_SERVER_FAST
  201. OBJS += ../src/eap_server/eap_fast.o
  202. OBJS += ../src/eap_common/eap_fast_common.o
  203. TLS_FUNCS=y
  204. NEED_T_PRF=y
  205. endif
  206. ifdef CONFIG_WPS
  207. CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
  208. OBJS += ../src/utils/uuid.o
  209. OBJS += wps_hostapd.o
  210. OBJS += ../src/eap_server/eap_wsc.o ../src/eap_common/eap_wsc_common.o
  211. OBJS += ../src/wps/wps.o
  212. OBJS += ../src/wps/wps_common.o
  213. OBJS += ../src/wps/wps_attr_parse.o
  214. OBJS += ../src/wps/wps_attr_build.o
  215. OBJS += ../src/wps/wps_attr_process.o
  216. OBJS += ../src/wps/wps_dev_attr.o
  217. OBJS += ../src/wps/wps_enrollee.o
  218. OBJS += ../src/wps/wps_registrar.o
  219. NEED_DH_GROUPS=y
  220. NEED_SHA256=y
  221. NEED_CRYPTO=y
  222. NEED_BASE64=y
  223. ifdef CONFIG_WPS_UFD
  224. CFLAGS += -DCONFIG_WPS_UFD
  225. OBJS += ../src/wps/wps_ufd.o
  226. NEED_WPS_OOB=y
  227. endif
  228. ifdef CONFIG_WPS_NFC
  229. CFLAGS += -DCONFIG_WPS_NFC
  230. OBJS += ../src/wps/ndef.o
  231. OBJS += ../src/wps/wps_nfc.o
  232. NEED_WPS_OOB=y
  233. ifdef CONFIG_WPS_NFC_PN531
  234. PN531_PATH ?= /usr/local/src/nfc
  235. CFLAGS += -DCONFIG_WPS_NFC_PN531
  236. CFLAGS += -I${PN531_PATH}/inc
  237. OBJS += ../src/wps/wps_nfc_pn531.o
  238. LIBS += ${PN531_PATH}/lib/wpsnfc.dll
  239. LIBS += ${PN531_PATH}/lib/libnfc_mapping_pn53x.dll
  240. endif
  241. endif
  242. ifdef NEED_WPS_OOB
  243. CFLAGS += -DCONFIG_WPS_OOB
  244. endif
  245. ifdef CONFIG_WPS_UPNP
  246. CFLAGS += -DCONFIG_WPS_UPNP
  247. OBJS += ../src/wps/wps_upnp.o
  248. OBJS += ../src/wps/wps_upnp_ssdp.o
  249. OBJS += ../src/wps/wps_upnp_web.o
  250. OBJS += ../src/wps/wps_upnp_event.o
  251. OBJS += ../src/wps/httpread.o
  252. endif
  253. endif
  254. ifdef CONFIG_EAP_IKEV2
  255. CFLAGS += -DEAP_SERVER_IKEV2
  256. OBJS += ../src/eap_server/eap_ikev2.o ../src/eap_server/ikev2.o
  257. OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  258. NEED_DH_GROUPS=y
  259. NEED_DH_GROUPS_ALL=y
  260. endif
  261. ifdef CONFIG_EAP_TNC
  262. CFLAGS += -DEAP_SERVER_TNC
  263. OBJS += ../src/eap_server/eap_tnc.o
  264. OBJS += ../src/eap_server/tncs.o
  265. NEED_BASE64=y
  266. ifndef CONFIG_DRIVER_BSD
  267. LIBS += -ldl
  268. endif
  269. endif
  270. # Basic EAP functionality is needed for EAPOL
  271. OBJS += ../src/eap_server/eap.o
  272. OBJS += ../src/eap_common/eap_common.o
  273. OBJS += ../src/eap_server/eap_methods.o
  274. OBJS += ../src/eap_server/eap_identity.o
  275. ifdef CONFIG_EAP
  276. CFLAGS += -DEAP_SERVER
  277. endif
  278. ifndef CONFIG_TLS
  279. CONFIG_TLS=openssl
  280. endif
  281. ifeq ($(CONFIG_TLS), internal)
  282. ifndef CONFIG_CRYPTO
  283. CONFIG_CRYPTO=internal
  284. endif
  285. endif
  286. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  287. CFLAGS += -DCONFIG_INTERNAL_X509
  288. endif
  289. ifeq ($(CONFIG_CRYPTO), internal)
  290. CFLAGS += -DCONFIG_INTERNAL_X509
  291. endif
  292. ifdef TLS_FUNCS
  293. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
  294. CFLAGS += -DEAP_TLS_FUNCS
  295. OBJS += ../src/eap_server/eap_tls_common.o
  296. NEED_TLS_PRF=y
  297. endif
  298. ifdef TLS_FUNCS
  299. ifeq ($(CONFIG_TLS), openssl)
  300. OBJS += ../src/crypto/tls_openssl.o
  301. LIBS += -lssl -lcrypto
  302. LIBS_h += -lcrypto
  303. endif
  304. ifeq ($(CONFIG_TLS), gnutls)
  305. OBJS += ../src/crypto/tls_gnutls.o
  306. LIBS += -lgnutls -lgcrypt -lgpg-error
  307. LIBS_h += -lgcrypt
  308. ifdef CONFIG_GNUTLS_EXTRA
  309. CFLAGS += -DCONFIG_GNUTLS_EXTRA
  310. LIBS += -lgnutls-extra
  311. endif
  312. endif
  313. ifeq ($(CONFIG_TLS), schannel)
  314. OBJS += ../src/crypto/tls_schannel.o
  315. endif
  316. ifeq ($(CONFIG_TLS), nss)
  317. OBJS += ../src/crypto/tls_nss.o
  318. LIBS += -lnss3 -lssl3
  319. LIBS_h += -lnss3
  320. endif
  321. ifeq ($(CONFIG_TLS), internal)
  322. OBJS += ../src/crypto/tls_internal.o
  323. OBJS += ../src/tls/tlsv1_common.o ../src/tls/tlsv1_record.o
  324. OBJS += ../src/tls/tlsv1_cred.o ../src/tls/tlsv1_server.o
  325. OBJS += ../src/tls/tlsv1_server_write.o ../src/tls/tlsv1_server_read.o
  326. OBJS += ../src/tls/asn1.o ../src/tls/x509v3.o
  327. NEED_BASE64=y
  328. CFLAGS += -DCONFIG_TLS_INTERNAL
  329. CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
  330. ifeq ($(CONFIG_CRYPTO), internal)
  331. endif
  332. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  333. LIBS += -ltomcrypt -ltfm
  334. LIBS_h += -ltomcrypt -ltfm
  335. endif
  336. endif
  337. NEED_CRYPTO=y
  338. else
  339. OBJS += ../src/crypto/tls_none.o
  340. endif
  341. ifdef CONFIG_PKCS12
  342. CFLAGS += -DPKCS12_FUNCS
  343. endif
  344. ifdef MS_FUNCS
  345. OBJS += ../src/crypto/ms_funcs.o
  346. NEED_CRYPTO=y
  347. endif
  348. ifdef CHAP
  349. OBJS += ../src/eap_common/chap.o
  350. endif
  351. ifdef NEED_CRYPTO
  352. ifndef TLS_FUNCS
  353. ifeq ($(CONFIG_TLS), openssl)
  354. LIBS += -lcrypto
  355. LIBS_h += -lcrypto
  356. endif
  357. ifeq ($(CONFIG_TLS), gnutls)
  358. LIBS += -lgcrypt
  359. LIBS_h += -lgcrypt
  360. endif
  361. ifeq ($(CONFIG_TLS), schannel)
  362. endif
  363. ifeq ($(CONFIG_TLS), nss)
  364. LIBS += -lnss3
  365. LIBS_h += -lnss3
  366. endif
  367. ifeq ($(CONFIG_TLS), internal)
  368. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  369. LIBS += -ltomcrypt -ltfm
  370. LIBS_h += -ltomcrypt -ltfm
  371. endif
  372. endif
  373. endif
  374. ifeq ($(CONFIG_TLS), openssl)
  375. OBJS += ../src/crypto/crypto_openssl.o
  376. HOBJS += ../src/crypto/crypto_openssl.o
  377. ifdef NEED_FIPS186_2_PRF
  378. OBJS += ../src/crypto/fips_prf_openssl.o
  379. endif
  380. endif
  381. ifeq ($(CONFIG_TLS), gnutls)
  382. OBJS += ../src/crypto/crypto_gnutls.o
  383. HOBJS += ../src/crypto/crypto_gnutls.o
  384. ifdef NEED_FIPS186_2_PRF
  385. OBJS += ../src/crypto/fips_prf_gnutls.o
  386. endif
  387. CONFIG_INTERNAL_SHA256=y
  388. CONFIG_INTERNAL_RC4=y
  389. CONFIG_INTERNAL_DH_GROUP5=y
  390. endif
  391. ifeq ($(CONFIG_TLS), internal)
  392. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  393. OBJS += ../src/crypto/crypto_libtomcrypt.o
  394. CONFIG_INTERNAL_SHA256=y
  395. CONFIG_INTERNAL_RC4=y
  396. CONFIG_INTERNAL_DH_GROUP5=y
  397. endif
  398. ifeq ($(CONFIG_CRYPTO), internal)
  399. OBJS += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o
  400. CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  401. ifdef CONFIG_INTERNAL_LIBTOMMATH
  402. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  403. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  404. CFLAGS += -DLTM_FAST
  405. endif
  406. else
  407. LIBS += -ltommath
  408. LIBS_h += -ltommath
  409. endif
  410. CONFIG_INTERNAL_AES=y
  411. CONFIG_INTERNAL_DES=y
  412. CONFIG_INTERNAL_SHA1=y
  413. CONFIG_INTERNAL_MD4=y
  414. CONFIG_INTERNAL_MD5=y
  415. CONFIG_INTERNAL_SHA256=y
  416. CONFIG_INTERNAL_RC4=y
  417. CONFIG_INTERNAL_DH_GROUP5=y
  418. endif
  419. endif
  420. else
  421. CONFIG_INTERNAL_AES=y
  422. CONFIG_INTERNAL_SHA1=y
  423. CONFIG_INTERNAL_MD5=y
  424. CONFIG_INTERNAL_SHA256=y
  425. CONFIG_INTERNAL_RC4=y
  426. endif
  427. ifdef CONFIG_INTERNAL_AES
  428. AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-enc.o
  429. endif
  430. ifdef CONFIG_INTERNAL_SHA1
  431. SHA1OBJS += ../src/crypto/sha1-internal.o
  432. ifdef NEED_FIPS186_2_PRF
  433. SHA1OBJS += ../src/crypto/fips_prf_internal.o
  434. endif
  435. endif
  436. ifdef CONFIG_INTERNAL_MD5
  437. OBJS += ../src/crypto/md5-internal.o
  438. endif
  439. ifdef CONFIG_INTERNAL_MD4
  440. OBJS += ../src/crypto/md4-internal.o
  441. endif
  442. ifdef CONFIG_INTERNAL_DES
  443. OBJS += ../src/crypto/des-internal.o
  444. endif
  445. ifdef CONFIG_INTERNAL_RC4
  446. OBJS += ../src/crypto/rc4.o
  447. endif
  448. ifdef NEED_SHA256
  449. OBJS += ../src/crypto/sha256.o
  450. ifdef CONFIG_INTERNAL_SHA256
  451. OBJS += ../src/crypto/sha256-internal.o
  452. endif
  453. endif
  454. ifdef CONFIG_INTERNAL_DH_GROUP5
  455. ifdef NEED_DH_GROUPS
  456. OBJS += ../src/crypto/dh_groups.o
  457. OBJS += ../src/crypto/dh_group5.o
  458. ifdef NEED_DH_GROUPS_ALL
  459. CFLAGS += -DALL_DH_GROUPS
  460. endif
  461. endif
  462. else
  463. ifdef NEED_DH_GROUPS_ALL
  464. OBJS += ../src/crypto/dh_groups.o
  465. CFLAGS += -DALL_DH_GROUPS
  466. endif
  467. endif
  468. ifdef NEED_T_PRF
  469. SHA1OBJS += ../src/crypto/sha1-tprf.o
  470. endif
  471. ifdef NEED_TLS_PRF
  472. SHA1OBJS += ../src/crypto/sha1-tlsprf.o
  473. endif
  474. ifdef CONFIG_RADIUS_SERVER
  475. CFLAGS += -DRADIUS_SERVER
  476. OBJS += ../src/radius/radius_server.o
  477. endif
  478. ifdef CONFIG_IPV6
  479. CFLAGS += -DCONFIG_IPV6
  480. endif
  481. ifdef CONFIG_DRIVER_RADIUS_ACL
  482. CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
  483. endif
  484. ifdef CONFIG_FULL_DYNAMIC_VLAN
  485. # define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
  486. # and vlan interfaces for the vlan feature.
  487. CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
  488. endif
  489. ifdef NEED_BASE64
  490. OBJS += ../src/utils/base64.o
  491. endif
  492. ifdef NEED_AP_MLME
  493. OBJS += beacon.o wme.o ap_list.o ieee802_11.o
  494. OBJS += hw_features.o
  495. CFLAGS += -DNEED_AP_MLME
  496. endif
  497. ifdef CONFIG_NO_STDOUT_DEBUG
  498. CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  499. endif
  500. AESOBJS += ../src/crypto/aes-wrap.o
  501. ifndef CONFIG_NO_AES_EXTRAS
  502. ifdef CONFIG_INTERNAL_AES
  503. AESOBJS += ../src/crypto/aes-internal-dec.o
  504. endif
  505. AESOBJS += ../src/crypto/aes-cbc.o
  506. AESOBJS += ../src/crypto/aes-ctr.o
  507. AESOBJS += ../src/crypto/aes-eax.o
  508. AESOBJS += ../src/crypto/aes-encblock.o
  509. AESOBJS += ../src/crypto/aes-omac1.o
  510. AESOBJS += ../src/crypto/aes-unwrap.o
  511. endif
  512. OBJS += $(SHA1OBJS)
  513. ALL=hostapd hostapd_cli
  514. all: verify_config $(ALL)
  515. Q=@
  516. E=echo
  517. ifeq ($(V), 1)
  518. Q=
  519. E=true
  520. endif
  521. %.o: %.c
  522. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  523. @$(E) " CC " $<
  524. verify_config:
  525. @if [ ! -r .config ]; then \
  526. echo 'Building hostapd requires a configuration file'; \
  527. echo '(.config). See README for more instructions. You can'; \
  528. echo 'run "cp defconfig .config" to create an example'; \
  529. echo 'configuration.'; \
  530. exit 1; \
  531. fi
  532. install: all
  533. for i in $(ALL); do cp $$i /usr/local/bin/$$i; done
  534. ../src/drivers/build.hostapd:
  535. @if [ -e ../src/drivers/build.wpa_supplicant ]; then \
  536. $(MAKE) -C ../src/drivers clean; \
  537. fi
  538. @touch ../src/drivers/build.hostapd
  539. BCHECK=../src/drivers/build.hostapd
  540. hostapd: $(BCHECK) $(OBJS)
  541. $(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
  542. OBJS_c = hostapd_cli.o ../src/common/wpa_ctrl.o ../src/utils/os_$(CONFIG_OS).o
  543. hostapd_cli: $(OBJS_c)
  544. $(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c)
  545. NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) ../src/crypto/rc4.o ../src/crypto/md5.o
  546. ifdef CONFIG_INTERNAL_MD5
  547. NOBJS += ../src/crypto/md5-internal.o
  548. endif
  549. NOBJS += ../src/crypto/crypto_openssl.o ../src/utils/os_$(CONFIG_OS).o
  550. ifdef TLS_FUNCS
  551. LIBS_n += -lcrypto
  552. endif
  553. 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
  554. HOBJS += ../src/crypto/aes-encblock.o
  555. ifdef CONFIG_INTERNAL_AES
  556. HOBJS += ../src/crypto/aes-internal.o
  557. HOBJS += ../src/crypto/aes-internal-enc.o
  558. endif
  559. nt_password_hash: $(NOBJS)
  560. $(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
  561. hlr_auc_gw: $(HOBJS)
  562. $(CC) $(LDFLAGS) -o hlr_auc_gw $(HOBJS) $(LIBS_h)
  563. clean:
  564. $(MAKE) -C ../src clean
  565. rm -f core *~ *.o hostapd hostapd_cli nt_password_hash hlr_auc_gw
  566. rm -f *.d
  567. %.eps: %.fig
  568. fig2dev -L eps $*.fig $*.eps
  569. %.png: %.fig
  570. fig2dev -L png -m 3 $*.fig | pngtopnm | pnmscale 0.4 | pnmtopng \
  571. > $*.png
  572. docs-pics: doc/hostapd.png doc/hostapd.eps
  573. docs: docs-pics
  574. (cd ..; doxygen hostapd/doc/doxygen.full; cd hostapd)
  575. $(MAKE) -C doc/latex
  576. cp doc/latex/refman.pdf hostapd-devel.pdf
  577. docs-fast: docs-pics
  578. (cd ..; doxygen hostapd/doc/doxygen.fast; cd hostapd)
  579. clean-docs:
  580. rm -rf doc/latex doc/html
  581. rm -f doc/hostapd.{eps,png} hostapd-devel.pdf
  582. TEST_SRC_MILENAGE = ../src/hlr_auc_gw/milenage.c ../src/crypto/aes-internal.c ../src/crypto/aes-internal-dec.c \
  583. ../src/crypto/aes-cbc.c \
  584. ../src/crypto/aes-ctr.c \
  585. ../src/crypto/aes-eax.c \
  586. ../src/crypto/aes-encblock.c \
  587. ../src/crypto/aes-internal-enc.c \
  588. ../src/crypto/aes-omac1.c \
  589. ../src/crypto/aes-unwrap.c \
  590. ../src/crypto/aes-wrap.c \
  591. ../src/utils/common.c ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).c
  592. test-milenage: $(TEST_SRC_MILENAGE)
  593. $(CC) $(LDFLAGS) -o test-milenage -Wall -Werror $(TEST_SRC_MILENAGE) \
  594. -DTEST_MAIN_MILENAGE -I. \
  595. -I../src/crypto -I../src/utils
  596. ./test-milenage
  597. rm test-milenage
  598. -include $(OBJS:%.o=%.d)