Makefile 16 KB

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