Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

Makefile 18KB

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