Makefile 16 KB

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