Makefile 16 KB

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