Makefile 16 KB

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