Makefile 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796
  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. CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
  244. OBJS += ../src/utils/uuid.o
  245. OBJS += ../src/ap/wps_hostapd.o
  246. OBJS += ../src/eap_server/eap_server_wsc.o ../src/eap_common/eap_wsc_common.o
  247. OBJS += ../src/wps/wps.o
  248. OBJS += ../src/wps/wps_common.o
  249. OBJS += ../src/wps/wps_attr_parse.o
  250. OBJS += ../src/wps/wps_attr_build.o
  251. OBJS += ../src/wps/wps_attr_process.o
  252. OBJS += ../src/wps/wps_dev_attr.o
  253. OBJS += ../src/wps/wps_enrollee.o
  254. OBJS += ../src/wps/wps_registrar.o
  255. NEED_DH_GROUPS=y
  256. NEED_SHA256=y
  257. NEED_BASE64=y
  258. NEED_AES_CBC=y
  259. NEED_MODEXP=y
  260. CONFIG_EAP=y
  261. ifdef CONFIG_WPS_UFD
  262. CFLAGS += -DCONFIG_WPS_UFD
  263. OBJS += ../src/wps/wps_ufd.o
  264. NEED_WPS_OOB=y
  265. endif
  266. ifdef CONFIG_WPS_NFC
  267. CFLAGS += -DCONFIG_WPS_NFC
  268. OBJS += ../src/wps/ndef.o
  269. OBJS += ../src/wps/wps_nfc.o
  270. NEED_WPS_OOB=y
  271. ifdef CONFIG_WPS_NFC_PN531
  272. PN531_PATH ?= /usr/local/src/nfc
  273. CFLAGS += -DCONFIG_WPS_NFC_PN531
  274. CFLAGS += -I${PN531_PATH}/inc
  275. OBJS += ../src/wps/wps_nfc_pn531.o
  276. LIBS += ${PN531_PATH}/lib/wpsnfc.dll
  277. LIBS += ${PN531_PATH}/lib/libnfc_mapping_pn53x.dll
  278. endif
  279. ifdef CONFIG_WPS_STRICT
  280. CFLAGS += -DCONFIG_WPS_STRICT
  281. OBJS += ../src/wps/wps_validate.o
  282. endif
  283. endif
  284. ifdef NEED_WPS_OOB
  285. CFLAGS += -DCONFIG_WPS_OOB
  286. endif
  287. ifdef CONFIG_WPS_UPNP
  288. CFLAGS += -DCONFIG_WPS_UPNP
  289. OBJS += ../src/wps/wps_upnp.o
  290. OBJS += ../src/wps/wps_upnp_ssdp.o
  291. OBJS += ../src/wps/wps_upnp_web.o
  292. OBJS += ../src/wps/wps_upnp_event.o
  293. OBJS += ../src/wps/wps_upnp_ap.o
  294. OBJS += ../src/wps/upnp_xml.o
  295. OBJS += ../src/wps/httpread.o
  296. OBJS += ../src/wps/http_client.o
  297. OBJS += ../src/wps/http_server.o
  298. endif
  299. endif
  300. ifdef CONFIG_EAP_IKEV2
  301. CFLAGS += -DEAP_SERVER_IKEV2
  302. OBJS += ../src/eap_server/eap_server_ikev2.o ../src/eap_server/ikev2.o
  303. OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  304. NEED_DH_GROUPS=y
  305. NEED_DH_GROUPS_ALL=y
  306. NEED_MODEXP=y
  307. NEED_CIPHER=y
  308. endif
  309. ifdef CONFIG_EAP_TNC
  310. CFLAGS += -DEAP_SERVER_TNC
  311. OBJS += ../src/eap_server/eap_server_tnc.o
  312. OBJS += ../src/eap_server/tncs.o
  313. NEED_BASE64=y
  314. ifndef CONFIG_DRIVER_BSD
  315. LIBS += -ldl
  316. endif
  317. endif
  318. # Basic EAP functionality is needed for EAPOL
  319. OBJS += eap_register.o
  320. OBJS += ../src/eap_server/eap_server.o
  321. OBJS += ../src/eap_common/eap_common.o
  322. OBJS += ../src/eap_server/eap_server_methods.o
  323. OBJS += ../src/eap_server/eap_server_identity.o
  324. CFLAGS += -DEAP_SERVER_IDENTITY
  325. ifdef CONFIG_EAP
  326. CFLAGS += -DEAP_SERVER
  327. endif
  328. ifdef CONFIG_PKCS12
  329. CFLAGS += -DPKCS12_FUNCS
  330. endif
  331. ifdef MS_FUNCS
  332. OBJS += ../src/crypto/ms_funcs.o
  333. NEED_DES=y
  334. NEED_MD4=y
  335. endif
  336. ifdef CHAP
  337. OBJS += ../src/eap_common/chap.o
  338. endif
  339. ifdef TLS_FUNCS
  340. NEED_DES=y
  341. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
  342. CFLAGS += -DEAP_TLS_FUNCS
  343. OBJS += ../src/eap_server/eap_server_tls_common.o
  344. NEED_TLS_PRF=y
  345. endif
  346. ifndef CONFIG_TLS
  347. CONFIG_TLS=openssl
  348. endif
  349. ifeq ($(CONFIG_TLS), openssl)
  350. ifdef TLS_FUNCS
  351. OBJS += ../src/crypto/tls_openssl.o
  352. LIBS += -lssl
  353. endif
  354. OBJS += ../src/crypto/crypto_openssl.o
  355. HOBJS += ../src/crypto/crypto_openssl.o
  356. ifdef NEED_FIPS186_2_PRF
  357. OBJS += ../src/crypto/fips_prf_openssl.o
  358. endif
  359. LIBS += -lcrypto
  360. LIBS_h += -lcrypto
  361. endif
  362. ifeq ($(CONFIG_TLS), gnutls)
  363. ifdef TLS_FUNCS
  364. OBJS += ../src/crypto/tls_gnutls.o
  365. LIBS += -lgnutls -lgpg-error
  366. ifdef CONFIG_GNUTLS_EXTRA
  367. CFLAGS += -DCONFIG_GNUTLS_EXTRA
  368. LIBS += -lgnutls-extra
  369. endif
  370. endif
  371. OBJS += ../src/crypto/crypto_gnutls.o
  372. HOBJS += ../src/crypto/crypto_gnutls.o
  373. ifdef NEED_FIPS186_2_PRF
  374. OBJS += ../src/crypto/fips_prf_gnutls.o
  375. endif
  376. LIBS += -lgcrypt
  377. LIBS_h += -lgcrypt
  378. CONFIG_INTERNAL_SHA256=y
  379. CONFIG_INTERNAL_RC4=y
  380. CONFIG_INTERNAL_DH_GROUP5=y
  381. endif
  382. ifeq ($(CONFIG_TLS), schannel)
  383. ifdef TLS_FUNCS
  384. OBJS += ../src/crypto/tls_schannel.o
  385. endif
  386. OBJS += ../src/crypto/crypto_cryptoapi.o
  387. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  388. CONFIG_INTERNAL_SHA256=y
  389. CONFIG_INTERNAL_RC4=y
  390. CONFIG_INTERNAL_DH_GROUP5=y
  391. endif
  392. ifeq ($(CONFIG_TLS), nss)
  393. ifdef TLS_FUNCS
  394. OBJS += ../src/crypto/tls_nss.o
  395. LIBS += -lssl3
  396. endif
  397. OBJS += ../src/crypto/crypto_nss.o
  398. ifdef NEED_FIPS186_2_PRF
  399. OBJS += ../src/crypto/fips_prf_nss.o
  400. endif
  401. LIBS += -lnss3
  402. LIBS_h += -lnss3
  403. CONFIG_INTERNAL_MD4=y
  404. CONFIG_INTERNAL_DH_GROUP5=y
  405. endif
  406. ifeq ($(CONFIG_TLS), internal)
  407. ifndef CONFIG_CRYPTO
  408. CONFIG_CRYPTO=internal
  409. endif
  410. ifdef TLS_FUNCS
  411. OBJS += ../src/crypto/crypto_internal-rsa.o
  412. OBJS += ../src/crypto/tls_internal.o
  413. OBJS += ../src/tls/tlsv1_common.o
  414. OBJS += ../src/tls/tlsv1_record.o
  415. OBJS += ../src/tls/tlsv1_cred.o
  416. OBJS += ../src/tls/tlsv1_server.o
  417. OBJS += ../src/tls/tlsv1_server_write.o
  418. OBJS += ../src/tls/tlsv1_server_read.o
  419. OBJS += ../src/tls/asn1.o
  420. OBJS += ../src/tls/rsa.o
  421. OBJS += ../src/tls/x509v3.o
  422. OBJS += ../src/tls/pkcs1.o
  423. OBJS += ../src/tls/pkcs5.o
  424. OBJS += ../src/tls/pkcs8.o
  425. NEED_SHA256=y
  426. NEED_BASE64=y
  427. NEED_TLS_PRF=y
  428. NEED_MODEXP=y
  429. NEED_CIPHER=y
  430. CFLAGS += -DCONFIG_TLS_INTERNAL
  431. CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
  432. endif
  433. ifdef NEED_CIPHER
  434. NEED_DES=y
  435. OBJS += ../src/crypto/crypto_internal-cipher.o
  436. endif
  437. ifdef NEED_MODEXP
  438. OBJS += ../src/crypto/crypto_internal-modexp.o
  439. OBJS += ../src/tls/bignum.o
  440. endif
  441. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  442. OBJS += ../src/crypto/crypto_libtomcrypt.o
  443. LIBS += -ltomcrypt -ltfm
  444. LIBS_h += -ltomcrypt -ltfm
  445. CONFIG_INTERNAL_SHA256=y
  446. CONFIG_INTERNAL_RC4=y
  447. CONFIG_INTERNAL_DH_GROUP5=y
  448. endif
  449. ifeq ($(CONFIG_CRYPTO), internal)
  450. OBJS += ../src/crypto/crypto_internal.o
  451. NEED_AES_DEC=y
  452. CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  453. ifdef CONFIG_INTERNAL_LIBTOMMATH
  454. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  455. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  456. CFLAGS += -DLTM_FAST
  457. endif
  458. else
  459. LIBS += -ltommath
  460. LIBS_h += -ltommath
  461. endif
  462. CONFIG_INTERNAL_AES=y
  463. CONFIG_INTERNAL_DES=y
  464. CONFIG_INTERNAL_SHA1=y
  465. CONFIG_INTERNAL_MD4=y
  466. CONFIG_INTERNAL_MD5=y
  467. CONFIG_INTERNAL_SHA256=y
  468. CONFIG_INTERNAL_RC4=y
  469. CONFIG_INTERNAL_DH_GROUP5=y
  470. endif
  471. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  472. OBJS += ../src/crypto/crypto_cryptoapi.o
  473. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  474. CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  475. CONFIG_INTERNAL_SHA256=y
  476. CONFIG_INTERNAL_RC4=y
  477. endif
  478. endif
  479. ifeq ($(CONFIG_TLS), none)
  480. ifdef TLS_FUNCS
  481. OBJS += ../src/crypto/tls_none.o
  482. CFLAGS += -DEAP_TLS_NONE
  483. CONFIG_INTERNAL_AES=y
  484. CONFIG_INTERNAL_SHA1=y
  485. CONFIG_INTERNAL_MD5=y
  486. endif
  487. OBJS += ../src/crypto/crypto_none.o
  488. OBJS_p += ../src/crypto/crypto_none.o
  489. CONFIG_INTERNAL_SHA256=y
  490. CONFIG_INTERNAL_RC4=y
  491. endif
  492. ifndef TLS_FUNCS
  493. OBJS += ../src/crypto/tls_none.o
  494. ifeq ($(CONFIG_TLS), internal)
  495. CONFIG_INTERNAL_AES=y
  496. CONFIG_INTERNAL_SHA1=y
  497. CONFIG_INTERNAL_MD5=y
  498. CONFIG_INTERNAL_RC4=y
  499. endif
  500. endif
  501. AESOBJS = # none so far
  502. ifdef CONFIG_INTERNAL_AES
  503. AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-enc.o
  504. endif
  505. AESOBJS += ../src/crypto/aes-wrap.o
  506. ifdef NEED_AES_EAX
  507. AESOBJS += ../src/crypto/aes-eax.o
  508. NEED_AES_CTR=y
  509. endif
  510. ifdef NEED_AES_CTR
  511. AESOBJS += ../src/crypto/aes-ctr.o
  512. endif
  513. ifdef NEED_AES_ENCBLOCK
  514. AESOBJS += ../src/crypto/aes-encblock.o
  515. endif
  516. ifdef NEED_AES_OMAC1
  517. AESOBJS += ../src/crypto/aes-omac1.o
  518. endif
  519. ifdef NEED_AES_UNWRAP
  520. NEED_AES_DEC=y
  521. AESOBJS += ../src/crypto/aes-unwrap.o
  522. endif
  523. ifdef NEED_AES_CBC
  524. NEED_AES_DEC=y
  525. AESOBJS += ../src/crypto/aes-cbc.o
  526. endif
  527. ifdef NEED_AES_DEC
  528. ifdef CONFIG_INTERNAL_AES
  529. AESOBJS += ../src/crypto/aes-internal-dec.o
  530. endif
  531. endif
  532. ifdef NEED_AES
  533. OBJS += $(AESOBJS)
  534. endif
  535. ifdef NEED_SHA1
  536. SHA1OBJS += ../src/crypto/sha1.o
  537. ifdef CONFIG_INTERNAL_SHA1
  538. SHA1OBJS += ../src/crypto/sha1-internal.o
  539. ifdef NEED_FIPS186_2_PRF
  540. SHA1OBJS += ../src/crypto/fips_prf_internal.o
  541. endif
  542. endif
  543. SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
  544. ifdef NEED_T_PRF
  545. SHA1OBJS += ../src/crypto/sha1-tprf.o
  546. endif
  547. ifdef NEED_TLS_PRF
  548. SHA1OBJS += ../src/crypto/sha1-tlsprf.o
  549. endif
  550. endif
  551. ifdef NEED_SHA1
  552. OBJS += $(SHA1OBJS)
  553. endif
  554. ifdef NEED_MD5
  555. ifdef CONFIG_INTERNAL_MD5
  556. OBJS += ../src/crypto/md5-internal.o
  557. endif
  558. endif
  559. ifdef NEED_MD4
  560. ifdef CONFIG_INTERNAL_MD4
  561. OBJS += ../src/crypto/md4-internal.o
  562. endif
  563. endif
  564. ifdef NEED_DES
  565. ifdef CONFIG_INTERNAL_DES
  566. OBJS += ../src/crypto/des-internal.o
  567. endif
  568. endif
  569. ifdef NEED_RC4
  570. ifdef CONFIG_INTERNAL_RC4
  571. OBJS += ../src/crypto/rc4.o
  572. endif
  573. endif
  574. ifdef NEED_SHA256
  575. OBJS += ../src/crypto/sha256.o
  576. ifdef CONFIG_INTERNAL_SHA256
  577. OBJS += ../src/crypto/sha256-internal.o
  578. endif
  579. endif
  580. ifdef NEED_DH_GROUPS
  581. OBJS += ../src/crypto/dh_groups.o
  582. endif
  583. ifdef NEED_DH_GROUPS_ALL
  584. CFLAGS += -DALL_DH_GROUPS
  585. endif
  586. ifdef CONFIG_INTERNAL_DH_GROUP5
  587. ifdef NEED_DH_GROUPS
  588. OBJS += ../src/crypto/dh_group5.o
  589. endif
  590. endif
  591. ifdef CONFIG_RADIUS_SERVER
  592. CFLAGS += -DRADIUS_SERVER
  593. OBJS += ../src/radius/radius_server.o
  594. endif
  595. ifdef CONFIG_IPV6
  596. CFLAGS += -DCONFIG_IPV6
  597. endif
  598. ifdef CONFIG_DRIVER_RADIUS_ACL
  599. CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
  600. endif
  601. ifdef CONFIG_FULL_DYNAMIC_VLAN
  602. # define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
  603. # and vlan interfaces for the vlan feature.
  604. CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
  605. endif
  606. ifdef NEED_BASE64
  607. OBJS += ../src/utils/base64.o
  608. endif
  609. ifdef NEED_AP_MLME
  610. OBJS += ../src/ap/beacon.o
  611. OBJS += ../src/ap/wmm.o
  612. OBJS += ../src/ap/ap_list.o
  613. OBJS += ../src/ap/ieee802_11.o
  614. OBJS += ../src/ap/hw_features.o
  615. CFLAGS += -DNEED_AP_MLME
  616. endif
  617. ifdef CONFIG_IEEE80211N
  618. OBJS += ../src/ap/ieee802_11_ht.o
  619. endif
  620. ifdef CONFIG_NO_STDOUT_DEBUG
  621. CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  622. endif
  623. ALL=hostapd hostapd_cli
  624. all: verify_config $(ALL)
  625. Q=@
  626. E=echo
  627. ifeq ($(V), 1)
  628. Q=
  629. E=true
  630. endif
  631. %.o: %.c
  632. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  633. @$(E) " CC " $<
  634. verify_config:
  635. @if [ ! -r .config ]; then \
  636. echo 'Building hostapd requires a configuration file'; \
  637. echo '(.config). See README for more instructions. You can'; \
  638. echo 'run "cp defconfig .config" to create an example'; \
  639. echo 'configuration.'; \
  640. exit 1; \
  641. fi
  642. install: all
  643. for i in $(ALL); do cp -f $$i /usr/local/bin/$$i; done
  644. ../src/drivers/build.hostapd:
  645. @if [ -f ../src/drivers/build.wpa_supplicant ]; then \
  646. $(MAKE) -C ../src/drivers clean; \
  647. fi
  648. @touch ../src/drivers/build.hostapd
  649. BCHECK=../src/drivers/build.hostapd
  650. hostapd: $(BCHECK) $(OBJS)
  651. $(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
  652. OBJS_c = hostapd_cli.o ../src/common/wpa_ctrl.o ../src/utils/os_$(CONFIG_OS).o
  653. ifdef CONFIG_WPA_TRACE
  654. OBJS_c += ../src/utils/trace.o
  655. OBJS_c += ../src/utils/wpa_debug.o
  656. endif
  657. hostapd_cli: $(OBJS_c)
  658. $(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c)
  659. NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) ../src/crypto/md5.o
  660. ifdef NEED_RC4
  661. ifdef CONFIG_INTERNAL_RC4
  662. NOBJS += ../src/crypto/rc4.o
  663. endif
  664. endif
  665. ifdef CONFIG_INTERNAL_MD5
  666. NOBJS += ../src/crypto/md5-internal.o
  667. endif
  668. NOBJS += ../src/crypto/crypto_openssl.o ../src/utils/os_$(CONFIG_OS).o
  669. NOBJS += ../src/utils/wpa_debug.o
  670. NOBJS += ../src/utils/wpabuf.o
  671. ifdef CONFIG_WPA_TRACE
  672. NOBJS += ../src/utils/trace.o
  673. LIBS_n += -lbfd
  674. endif
  675. ifdef TLS_FUNCS
  676. LIBS_n += -lcrypto
  677. endif
  678. 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
  679. HOBJS += ../src/crypto/aes-encblock.o
  680. ifdef CONFIG_INTERNAL_AES
  681. HOBJS += ../src/crypto/aes-internal.o
  682. HOBJS += ../src/crypto/aes-internal-enc.o
  683. endif
  684. nt_password_hash: $(NOBJS)
  685. $(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
  686. hlr_auc_gw: $(HOBJS)
  687. $(CC) $(LDFLAGS) -o hlr_auc_gw $(HOBJS) $(LIBS_h)
  688. clean:
  689. $(MAKE) -C ../src clean
  690. rm -f core *~ *.o hostapd hostapd_cli nt_password_hash hlr_auc_gw
  691. rm -f *.d
  692. -include $(OBJS:%.o=%.d)