Makefile 17 KB

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