Makefile 17 KB

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