Makefile 25 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217
  1. ifndef CC
  2. CC=gcc
  3. endif
  4. ifndef CFLAGS
  5. CFLAGS = -MMD -O2 -Wall -g
  6. endif
  7. ifdef LIBS
  8. # If LIBS is set with some global build system defaults, clone those for
  9. # LIBS_c, LIBS_h, and LIBS_n to cover hostapd_cli, hlr_auc_gw, and
  10. # nt_password_hash as well.
  11. ifndef LIBS_c
  12. LIBS_c := $(LIBS)
  13. endif
  14. ifndef LIBS_h
  15. LIBS_h := $(LIBS)
  16. endif
  17. ifndef LIBS_n
  18. LIBS_n := $(LIBS)
  19. endif
  20. endif
  21. CFLAGS += $(EXTRA_CFLAGS)
  22. CFLAGS += -I$(abspath ../src)
  23. CFLAGS += -I$(abspath ../src/utils)
  24. export BINDIR ?= /usr/local/bin/
  25. -include .config
  26. ifndef CONFIG_NO_GITVER
  27. # Add VERSION_STR postfix for builds from a git repository
  28. ifeq ($(wildcard ../.git),../.git)
  29. GITVER := $(shell git describe --dirty=+)
  30. ifneq ($(GITVER),)
  31. CFLAGS += -DGIT_VERSION_STR_POSTFIX=\"-$(GITVER)\"
  32. endif
  33. endif
  34. endif
  35. ifdef CONFIG_TESTING_OPTIONS
  36. CFLAGS += -DCONFIG_TESTING_OPTIONS
  37. CONFIG_WPS_TESTING=y
  38. endif
  39. ifndef CONFIG_OS
  40. ifdef CONFIG_NATIVE_WINDOWS
  41. CONFIG_OS=win32
  42. else
  43. CONFIG_OS=unix
  44. endif
  45. endif
  46. ifeq ($(CONFIG_OS), internal)
  47. CFLAGS += -DOS_NO_C_LIB_DEFINES
  48. endif
  49. ifdef CONFIG_NATIVE_WINDOWS
  50. CFLAGS += -DCONFIG_NATIVE_WINDOWS
  51. LIBS += -lws2_32
  52. endif
  53. OBJS += main.o
  54. OBJS += config_file.o
  55. OBJS += ../src/ap/hostapd.o
  56. OBJS += ../src/ap/wpa_auth_glue.o
  57. OBJS += ../src/ap/drv_callbacks.o
  58. OBJS += ../src/ap/ap_drv_ops.o
  59. OBJS += ../src/ap/utils.o
  60. OBJS += ../src/ap/authsrv.o
  61. OBJS += ../src/ap/ieee802_1x.o
  62. OBJS += ../src/ap/ap_config.o
  63. OBJS += ../src/ap/eap_user_db.o
  64. OBJS += ../src/ap/ieee802_11_auth.o
  65. OBJS += ../src/ap/sta_info.o
  66. OBJS += ../src/ap/wpa_auth.o
  67. OBJS += ../src/ap/tkip_countermeasures.o
  68. OBJS += ../src/ap/ap_mlme.o
  69. OBJS += ../src/ap/wpa_auth_ie.o
  70. OBJS += ../src/ap/preauth_auth.o
  71. OBJS += ../src/ap/pmksa_cache_auth.o
  72. OBJS += ../src/ap/ieee802_11_shared.o
  73. OBJS += ../src/ap/beacon.o
  74. OBJS += ../src/ap/bss_load.o
  75. OBJS += ../src/ap/neighbor_db.o
  76. OBJS += ../src/ap/rrm.o
  77. OBJS_c = hostapd_cli.o
  78. OBJS_c += ../src/common/wpa_ctrl.o
  79. OBJS_c += ../src/utils/os_$(CONFIG_OS).o
  80. OBJS_c += ../src/common/cli.o
  81. NEED_RC4=y
  82. NEED_AES=y
  83. NEED_MD5=y
  84. NEED_SHA1=y
  85. OBJS += ../src/drivers/drivers.o
  86. CFLAGS += -DHOSTAPD
  87. ifdef CONFIG_TAXONOMY
  88. CFLAGS += -DCONFIG_TAXONOMY
  89. OBJS += ../src/ap/taxonomy.o
  90. endif
  91. ifdef CONFIG_MODULE_TESTS
  92. CFLAGS += -DCONFIG_MODULE_TESTS
  93. OBJS += hapd_module_tests.o
  94. endif
  95. ifdef CONFIG_WPA_TRACE
  96. CFLAGS += -DWPA_TRACE
  97. OBJS += ../src/utils/trace.o
  98. HOBJS += ../src/utils/trace.o
  99. LDFLAGS += -rdynamic
  100. CFLAGS += -funwind-tables
  101. ifdef CONFIG_WPA_TRACE_BFD
  102. CFLAGS += -DPACKAGE="hostapd" -DWPA_TRACE_BFD
  103. LIBS += -lbfd -ldl -liberty -lz
  104. LIBS_c += -lbfd -ldl -liberty -lz
  105. LIBS_h += -lbfd -ldl -liberty -lz
  106. endif
  107. endif
  108. ifndef CONFIG_ELOOP
  109. CONFIG_ELOOP=eloop
  110. endif
  111. OBJS += ../src/utils/$(CONFIG_ELOOP).o
  112. OBJS_c += ../src/utils/$(CONFIG_ELOOP).o
  113. ifeq ($(CONFIG_ELOOP), eloop)
  114. # Using glibc < 2.17 requires -lrt for clock_gettime()
  115. LIBS += -lrt
  116. LIBS_c += -lrt
  117. LIBS_h += -lrt
  118. LIBS_n += -lrt
  119. endif
  120. ifdef CONFIG_ELOOP_POLL
  121. CFLAGS += -DCONFIG_ELOOP_POLL
  122. endif
  123. ifdef CONFIG_ELOOP_EPOLL
  124. CFLAGS += -DCONFIG_ELOOP_EPOLL
  125. endif
  126. ifdef CONFIG_ELOOP_KQUEUE
  127. CFLAGS += -DCONFIG_ELOOP_KQUEUE
  128. endif
  129. OBJS += ../src/utils/common.o
  130. OBJS_c += ../src/utils/common.o
  131. OBJS += ../src/utils/wpa_debug.o
  132. OBJS_c += ../src/utils/wpa_debug.o
  133. OBJS += ../src/utils/wpabuf.o
  134. OBJS += ../src/utils/os_$(CONFIG_OS).o
  135. OBJS += ../src/utils/ip_addr.o
  136. OBJS += ../src/common/ieee802_11_common.o
  137. OBJS += ../src/common/wpa_common.o
  138. OBJS += ../src/common/hw_features_common.o
  139. OBJS += ../src/eapol_auth/eapol_auth_sm.o
  140. ifdef CONFIG_CODE_COVERAGE
  141. CFLAGS += -O0 -fprofile-arcs -ftest-coverage
  142. LIBS += -lgcov
  143. LIBS_c += -lgcov
  144. LIBS_h += -lgcov
  145. LIBS_n += -lgcov
  146. endif
  147. ifndef CONFIG_NO_DUMP_STATE
  148. # define HOSTAPD_DUMP_STATE to include support for dumping internal state
  149. # through control interface commands (undefine it, if you want to save in
  150. # binary size)
  151. CFLAGS += -DHOSTAPD_DUMP_STATE
  152. OBJS += ../src/eapol_auth/eapol_auth_dump.o
  153. endif
  154. ifdef CONFIG_NO_RADIUS
  155. CFLAGS += -DCONFIG_NO_RADIUS
  156. CONFIG_NO_ACCOUNTING=y
  157. else
  158. OBJS += ../src/radius/radius.o
  159. OBJS += ../src/radius/radius_client.o
  160. OBJS += ../src/radius/radius_das.o
  161. endif
  162. ifdef CONFIG_NO_ACCOUNTING
  163. CFLAGS += -DCONFIG_NO_ACCOUNTING
  164. else
  165. OBJS += ../src/ap/accounting.o
  166. endif
  167. ifdef CONFIG_NO_VLAN
  168. CFLAGS += -DCONFIG_NO_VLAN
  169. else
  170. OBJS += ../src/ap/vlan_init.o
  171. OBJS += ../src/ap/vlan_ifconfig.o
  172. OBJS += ../src/ap/vlan.o
  173. ifdef CONFIG_FULL_DYNAMIC_VLAN
  174. # Define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
  175. # and VLAN interfaces for the VLAN feature.
  176. CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
  177. OBJS += ../src/ap/vlan_full.o
  178. ifdef CONFIG_VLAN_NETLINK
  179. OBJS += ../src/ap/vlan_util.o
  180. else
  181. OBJS += ../src/ap/vlan_ioctl.o
  182. endif
  183. endif
  184. endif
  185. ifdef CONFIG_NO_CTRL_IFACE
  186. CFLAGS += -DCONFIG_NO_CTRL_IFACE
  187. else
  188. ifeq ($(CONFIG_CTRL_IFACE), udp)
  189. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  190. else
  191. ifeq ($(CONFIG_CTRL_IFACE), udp6)
  192. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  193. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
  194. else
  195. ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
  196. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  197. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  198. else
  199. ifeq ($(CONFIG_CTRL_IFACE), udp6-remote)
  200. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  201. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  202. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
  203. else
  204. CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
  205. endif
  206. endif
  207. endif
  208. endif
  209. OBJS += ../src/common/ctrl_iface_common.o
  210. OBJS += ctrl_iface.o
  211. OBJS += ../src/ap/ctrl_iface_ap.o
  212. endif
  213. ifndef CONFIG_NO_CTRL_IFACE
  214. CFLAGS += -DCONFIG_CTRL_IFACE
  215. endif
  216. ifdef CONFIG_IAPP
  217. CFLAGS += -DCONFIG_IAPP
  218. OBJS += ../src/ap/iapp.o
  219. endif
  220. ifdef CONFIG_RSN_PREAUTH
  221. CFLAGS += -DCONFIG_RSN_PREAUTH
  222. CONFIG_L2_PACKET=y
  223. endif
  224. ifdef CONFIG_PEERKEY
  225. CFLAGS += -DCONFIG_PEERKEY
  226. OBJS += ../src/ap/peerkey_auth.o
  227. endif
  228. ifdef CONFIG_HS20
  229. NEED_AES_OMAC1=y
  230. CONFIG_PROXYARP=y
  231. endif
  232. ifdef CONFIG_PROXYARP
  233. CONFIG_L2_PACKET=y
  234. endif
  235. ifdef CONFIG_SUITEB
  236. CFLAGS += -DCONFIG_SUITEB
  237. NEED_SHA256=y
  238. NEED_AES_OMAC1=y
  239. endif
  240. ifdef CONFIG_SUITEB192
  241. CFLAGS += -DCONFIG_SUITEB192
  242. NEED_SHA384=y
  243. endif
  244. ifdef CONFIG_IEEE80211W
  245. CFLAGS += -DCONFIG_IEEE80211W
  246. NEED_SHA256=y
  247. NEED_AES_OMAC1=y
  248. endif
  249. ifdef CONFIG_IEEE80211R
  250. CFLAGS += -DCONFIG_IEEE80211R -DCONFIG_IEEE80211R_AP
  251. OBJS += ../src/ap/wpa_auth_ft.o
  252. NEED_SHA256=y
  253. NEED_AES_OMAC1=y
  254. NEED_AES_UNWRAP=y
  255. endif
  256. ifdef CONFIG_SAE
  257. CFLAGS += -DCONFIG_SAE
  258. OBJS += ../src/common/sae.o
  259. NEED_ECC=y
  260. NEED_DH_GROUPS=y
  261. NEED_AP_MLME=y
  262. endif
  263. ifdef CONFIG_OWE
  264. CFLAGS += -DCONFIG_OWE
  265. NEED_ECC=y
  266. NEED_HMAC_SHA256_KDF=y
  267. endif
  268. ifdef CONFIG_FILS
  269. CFLAGS += -DCONFIG_FILS
  270. OBJS += ../src/ap/fils_hlp.o
  271. NEED_SHA384=y
  272. NEED_AES_SIV=y
  273. ifdef CONFIG_FILS_SK_PFS
  274. CFLAGS += -DCONFIG_FILS_SK_PFS
  275. NEED_ECC=y
  276. endif
  277. endif
  278. ifdef CONFIG_WNM
  279. CFLAGS += -DCONFIG_WNM
  280. OBJS += ../src/ap/wnm_ap.o
  281. endif
  282. ifdef CONFIG_IEEE80211N
  283. CFLAGS += -DCONFIG_IEEE80211N
  284. endif
  285. ifdef CONFIG_IEEE80211AC
  286. CFLAGS += -DCONFIG_IEEE80211AC
  287. endif
  288. ifdef CONFIG_IEEE80211AX
  289. CFLAGS += -DCONFIG_IEEE80211AX
  290. OBJS += ../src/ap/ieee802_11_he.o
  291. endif
  292. ifdef CONFIG_MBO
  293. CFLAGS += -DCONFIG_MBO
  294. OBJS += ../src/ap/mbo_ap.o
  295. endif
  296. include ../src/drivers/drivers.mak
  297. OBJS += $(DRV_AP_OBJS)
  298. CFLAGS += $(DRV_AP_CFLAGS)
  299. LDFLAGS += $(DRV_AP_LDFLAGS)
  300. LIBS += $(DRV_AP_LIBS)
  301. ifdef CONFIG_L2_PACKET
  302. ifdef CONFIG_DNET_PCAP
  303. ifdef CONFIG_L2_FREEBSD
  304. LIBS += -lpcap
  305. OBJS += ../src/l2_packet/l2_packet_freebsd.o
  306. else
  307. LIBS += -ldnet -lpcap
  308. OBJS += ../src/l2_packet/l2_packet_pcap.o
  309. endif
  310. else
  311. OBJS += ../src/l2_packet/l2_packet_linux.o
  312. endif
  313. else
  314. OBJS += ../src/l2_packet/l2_packet_none.o
  315. endif
  316. ifdef CONFIG_ERP
  317. CFLAGS += -DCONFIG_ERP
  318. NEED_SHA256=y
  319. NEED_HMAC_SHA256_KDF=y
  320. endif
  321. ifdef CONFIG_EAP_MD5
  322. CFLAGS += -DEAP_SERVER_MD5
  323. OBJS += ../src/eap_server/eap_server_md5.o
  324. CHAP=y
  325. endif
  326. ifdef CONFIG_EAP_TLS
  327. CFLAGS += -DEAP_SERVER_TLS
  328. OBJS += ../src/eap_server/eap_server_tls.o
  329. TLS_FUNCS=y
  330. endif
  331. ifdef CONFIG_EAP_UNAUTH_TLS
  332. CFLAGS += -DEAP_SERVER_UNAUTH_TLS
  333. ifndef CONFIG_EAP_TLS
  334. OBJS += ../src/eap_server/eap_server_tls.o
  335. TLS_FUNCS=y
  336. endif
  337. endif
  338. ifdef CONFIG_EAP_PEAP
  339. CFLAGS += -DEAP_SERVER_PEAP
  340. OBJS += ../src/eap_server/eap_server_peap.o
  341. OBJS += ../src/eap_common/eap_peap_common.o
  342. TLS_FUNCS=y
  343. CONFIG_EAP_MSCHAPV2=y
  344. endif
  345. ifdef CONFIG_EAP_TTLS
  346. CFLAGS += -DEAP_SERVER_TTLS
  347. OBJS += ../src/eap_server/eap_server_ttls.o
  348. TLS_FUNCS=y
  349. CHAP=y
  350. endif
  351. ifdef CONFIG_EAP_MSCHAPV2
  352. CFLAGS += -DEAP_SERVER_MSCHAPV2
  353. OBJS += ../src/eap_server/eap_server_mschapv2.o
  354. MS_FUNCS=y
  355. endif
  356. ifdef CONFIG_EAP_GTC
  357. CFLAGS += -DEAP_SERVER_GTC
  358. OBJS += ../src/eap_server/eap_server_gtc.o
  359. endif
  360. ifdef CONFIG_EAP_SIM
  361. CFLAGS += -DEAP_SERVER_SIM
  362. OBJS += ../src/eap_server/eap_server_sim.o
  363. CONFIG_EAP_SIM_COMMON=y
  364. NEED_AES_CBC=y
  365. endif
  366. ifdef CONFIG_EAP_AKA
  367. CFLAGS += -DEAP_SERVER_AKA
  368. OBJS += ../src/eap_server/eap_server_aka.o
  369. CONFIG_EAP_SIM_COMMON=y
  370. NEED_SHA256=y
  371. NEED_AES_CBC=y
  372. endif
  373. ifdef CONFIG_EAP_AKA_PRIME
  374. CFLAGS += -DEAP_SERVER_AKA_PRIME
  375. endif
  376. ifdef CONFIG_EAP_SIM_COMMON
  377. OBJS += ../src/eap_common/eap_sim_common.o
  378. # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
  379. # replaced with another file implementating the interface specified in
  380. # eap_sim_db.h.
  381. OBJS += ../src/eap_server/eap_sim_db.o
  382. NEED_FIPS186_2_PRF=y
  383. endif
  384. ifdef CONFIG_EAP_PAX
  385. CFLAGS += -DEAP_SERVER_PAX
  386. OBJS += ../src/eap_server/eap_server_pax.o ../src/eap_common/eap_pax_common.o
  387. endif
  388. ifdef CONFIG_EAP_PSK
  389. CFLAGS += -DEAP_SERVER_PSK
  390. OBJS += ../src/eap_server/eap_server_psk.o ../src/eap_common/eap_psk_common.o
  391. NEED_AES_OMAC1=y
  392. NEED_AES_ENCBLOCK=y
  393. NEED_AES_EAX=y
  394. endif
  395. ifdef CONFIG_EAP_SAKE
  396. CFLAGS += -DEAP_SERVER_SAKE
  397. OBJS += ../src/eap_server/eap_server_sake.o ../src/eap_common/eap_sake_common.o
  398. endif
  399. ifdef CONFIG_EAP_GPSK
  400. CFLAGS += -DEAP_SERVER_GPSK
  401. OBJS += ../src/eap_server/eap_server_gpsk.o ../src/eap_common/eap_gpsk_common.o
  402. ifdef CONFIG_EAP_GPSK_SHA256
  403. CFLAGS += -DEAP_GPSK_SHA256
  404. endif
  405. NEED_SHA256=y
  406. NEED_AES_OMAC1=y
  407. endif
  408. ifdef CONFIG_EAP_PWD
  409. CFLAGS += -DEAP_SERVER_PWD
  410. OBJS += ../src/eap_server/eap_server_pwd.o ../src/eap_common/eap_pwd_common.o
  411. NEED_SHA256=y
  412. endif
  413. ifdef CONFIG_EAP_EKE
  414. CFLAGS += -DEAP_SERVER_EKE
  415. OBJS += ../src/eap_server/eap_server_eke.o ../src/eap_common/eap_eke_common.o
  416. NEED_DH_GROUPS=y
  417. NEED_DH_GROUPS_ALL=y
  418. endif
  419. ifdef CONFIG_EAP_VENDOR_TEST
  420. CFLAGS += -DEAP_SERVER_VENDOR_TEST
  421. OBJS += ../src/eap_server/eap_server_vendor_test.o
  422. endif
  423. ifdef CONFIG_EAP_FAST
  424. CFLAGS += -DEAP_SERVER_FAST
  425. OBJS += ../src/eap_server/eap_server_fast.o
  426. OBJS += ../src/eap_common/eap_fast_common.o
  427. TLS_FUNCS=y
  428. NEED_T_PRF=y
  429. NEED_AES_UNWRAP=y
  430. endif
  431. ifdef CONFIG_WPS
  432. CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
  433. OBJS += ../src/utils/uuid.o
  434. OBJS += ../src/ap/wps_hostapd.o
  435. OBJS += ../src/eap_server/eap_server_wsc.o ../src/eap_common/eap_wsc_common.o
  436. OBJS += ../src/wps/wps.o
  437. OBJS += ../src/wps/wps_common.o
  438. OBJS += ../src/wps/wps_attr_parse.o
  439. OBJS += ../src/wps/wps_attr_build.o
  440. OBJS += ../src/wps/wps_attr_process.o
  441. OBJS += ../src/wps/wps_dev_attr.o
  442. OBJS += ../src/wps/wps_enrollee.o
  443. OBJS += ../src/wps/wps_registrar.o
  444. NEED_DH_GROUPS=y
  445. NEED_SHA256=y
  446. NEED_BASE64=y
  447. NEED_AES_CBC=y
  448. NEED_MODEXP=y
  449. CONFIG_EAP=y
  450. ifdef CONFIG_WPS_NFC
  451. CFLAGS += -DCONFIG_WPS_NFC
  452. OBJS += ../src/wps/ndef.o
  453. NEED_WPS_OOB=y
  454. endif
  455. ifdef NEED_WPS_OOB
  456. CFLAGS += -DCONFIG_WPS_OOB
  457. endif
  458. ifdef CONFIG_WPS_UPNP
  459. CFLAGS += -DCONFIG_WPS_UPNP
  460. OBJS += ../src/wps/wps_upnp.o
  461. OBJS += ../src/wps/wps_upnp_ssdp.o
  462. OBJS += ../src/wps/wps_upnp_web.o
  463. OBJS += ../src/wps/wps_upnp_event.o
  464. OBJS += ../src/wps/wps_upnp_ap.o
  465. OBJS += ../src/wps/upnp_xml.o
  466. OBJS += ../src/wps/httpread.o
  467. OBJS += ../src/wps/http_client.o
  468. OBJS += ../src/wps/http_server.o
  469. endif
  470. ifdef CONFIG_WPS_STRICT
  471. CFLAGS += -DCONFIG_WPS_STRICT
  472. OBJS += ../src/wps/wps_validate.o
  473. endif
  474. ifdef CONFIG_WPS_TESTING
  475. CFLAGS += -DCONFIG_WPS_TESTING
  476. endif
  477. endif
  478. ifdef CONFIG_EAP_IKEV2
  479. CFLAGS += -DEAP_SERVER_IKEV2
  480. OBJS += ../src/eap_server/eap_server_ikev2.o ../src/eap_server/ikev2.o
  481. OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  482. NEED_DH_GROUPS=y
  483. NEED_DH_GROUPS_ALL=y
  484. NEED_MODEXP=y
  485. NEED_CIPHER=y
  486. endif
  487. ifdef CONFIG_EAP_TNC
  488. CFLAGS += -DEAP_SERVER_TNC
  489. OBJS += ../src/eap_server/eap_server_tnc.o
  490. OBJS += ../src/eap_server/tncs.o
  491. NEED_BASE64=y
  492. ifndef CONFIG_DRIVER_BSD
  493. LIBS += -ldl
  494. endif
  495. endif
  496. # Basic EAP functionality is needed for EAPOL
  497. OBJS += eap_register.o
  498. OBJS += ../src/eap_server/eap_server.o
  499. OBJS += ../src/eap_common/eap_common.o
  500. OBJS += ../src/eap_server/eap_server_methods.o
  501. OBJS += ../src/eap_server/eap_server_identity.o
  502. CFLAGS += -DEAP_SERVER_IDENTITY
  503. ifdef CONFIG_EAP
  504. CFLAGS += -DEAP_SERVER
  505. endif
  506. ifdef CONFIG_PKCS12
  507. CFLAGS += -DPKCS12_FUNCS
  508. endif
  509. ifdef MS_FUNCS
  510. OBJS += ../src/crypto/ms_funcs.o
  511. NEED_DES=y
  512. NEED_MD4=y
  513. endif
  514. ifdef CHAP
  515. OBJS += ../src/eap_common/chap.o
  516. endif
  517. ifdef TLS_FUNCS
  518. NEED_DES=y
  519. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
  520. CFLAGS += -DEAP_TLS_FUNCS
  521. OBJS += ../src/eap_server/eap_server_tls_common.o
  522. NEED_TLS_PRF=y
  523. endif
  524. ifndef CONFIG_TLS
  525. CONFIG_TLS=openssl
  526. endif
  527. ifdef CONFIG_TLSV11
  528. CFLAGS += -DCONFIG_TLSV11
  529. endif
  530. ifdef CONFIG_TLSV12
  531. CFLAGS += -DCONFIG_TLSV12
  532. NEED_SHA256=y
  533. endif
  534. ifeq ($(CONFIG_TLS), openssl)
  535. ifdef TLS_FUNCS
  536. OBJS += ../src/crypto/tls_openssl.o
  537. OBJS += ../src/crypto/tls_openssl_ocsp.o
  538. LIBS += -lssl
  539. endif
  540. OBJS += ../src/crypto/crypto_openssl.o
  541. HOBJS += ../src/crypto/crypto_openssl.o
  542. ifdef NEED_FIPS186_2_PRF
  543. OBJS += ../src/crypto/fips_prf_openssl.o
  544. endif
  545. NEED_SHA256=y
  546. NEED_TLS_PRF_SHA256=y
  547. LIBS += -lcrypto
  548. LIBS_h += -lcrypto
  549. ifdef CONFIG_TLS_ADD_DL
  550. LIBS += -ldl
  551. LIBS_h += -ldl
  552. endif
  553. endif
  554. ifeq ($(CONFIG_TLS), gnutls)
  555. ifdef TLS_FUNCS
  556. OBJS += ../src/crypto/tls_gnutls.o
  557. LIBS += -lgnutls -lgpg-error
  558. endif
  559. OBJS += ../src/crypto/crypto_gnutls.o
  560. HOBJS += ../src/crypto/crypto_gnutls.o
  561. ifdef NEED_FIPS186_2_PRF
  562. OBJS += ../src/crypto/fips_prf_internal.o
  563. SHA1OBJS += ../src/crypto/sha1-internal.o
  564. endif
  565. LIBS += -lgcrypt
  566. LIBS_h += -lgcrypt
  567. CONFIG_INTERNAL_SHA256=y
  568. CONFIG_INTERNAL_RC4=y
  569. CONFIG_INTERNAL_DH_GROUP5=y
  570. endif
  571. ifeq ($(CONFIG_TLS), internal)
  572. ifndef CONFIG_CRYPTO
  573. CONFIG_CRYPTO=internal
  574. endif
  575. ifdef TLS_FUNCS
  576. OBJS += ../src/crypto/crypto_internal-rsa.o
  577. OBJS += ../src/crypto/tls_internal.o
  578. OBJS += ../src/tls/tlsv1_common.o
  579. OBJS += ../src/tls/tlsv1_record.o
  580. OBJS += ../src/tls/tlsv1_cred.o
  581. OBJS += ../src/tls/tlsv1_server.o
  582. OBJS += ../src/tls/tlsv1_server_write.o
  583. OBJS += ../src/tls/tlsv1_server_read.o
  584. OBJS += ../src/tls/asn1.o
  585. OBJS += ../src/tls/rsa.o
  586. OBJS += ../src/tls/x509v3.o
  587. OBJS += ../src/tls/pkcs1.o
  588. OBJS += ../src/tls/pkcs5.o
  589. OBJS += ../src/tls/pkcs8.o
  590. NEED_SHA256=y
  591. NEED_BASE64=y
  592. NEED_TLS_PRF=y
  593. ifdef CONFIG_TLSV12
  594. NEED_TLS_PRF_SHA256=y
  595. endif
  596. NEED_MODEXP=y
  597. NEED_CIPHER=y
  598. CFLAGS += -DCONFIG_TLS_INTERNAL
  599. CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
  600. endif
  601. ifdef NEED_CIPHER
  602. NEED_DES=y
  603. OBJS += ../src/crypto/crypto_internal-cipher.o
  604. endif
  605. ifdef NEED_MODEXP
  606. OBJS += ../src/crypto/crypto_internal-modexp.o
  607. OBJS += ../src/tls/bignum.o
  608. endif
  609. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  610. OBJS += ../src/crypto/crypto_libtomcrypt.o
  611. LIBS += -ltomcrypt -ltfm
  612. LIBS_h += -ltomcrypt -ltfm
  613. CONFIG_INTERNAL_SHA256=y
  614. CONFIG_INTERNAL_RC4=y
  615. CONFIG_INTERNAL_DH_GROUP5=y
  616. endif
  617. ifeq ($(CONFIG_CRYPTO), internal)
  618. OBJS += ../src/crypto/crypto_internal.o
  619. NEED_AES_DEC=y
  620. CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  621. ifdef CONFIG_INTERNAL_LIBTOMMATH
  622. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  623. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  624. CFLAGS += -DLTM_FAST
  625. endif
  626. else
  627. LIBS += -ltommath
  628. LIBS_h += -ltommath
  629. endif
  630. CONFIG_INTERNAL_AES=y
  631. CONFIG_INTERNAL_DES=y
  632. CONFIG_INTERNAL_SHA1=y
  633. CONFIG_INTERNAL_MD4=y
  634. CONFIG_INTERNAL_MD5=y
  635. CONFIG_INTERNAL_SHA256=y
  636. CONFIG_INTERNAL_SHA384=y
  637. CONFIG_INTERNAL_SHA512=y
  638. CONFIG_INTERNAL_RC4=y
  639. CONFIG_INTERNAL_DH_GROUP5=y
  640. endif
  641. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  642. OBJS += ../src/crypto/crypto_cryptoapi.o
  643. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  644. CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  645. CONFIG_INTERNAL_SHA256=y
  646. CONFIG_INTERNAL_RC4=y
  647. endif
  648. endif
  649. ifeq ($(CONFIG_TLS), linux)
  650. OBJS += ../src/crypto/crypto_linux.o
  651. ifdef TLS_FUNCS
  652. OBJS += ../src/crypto/crypto_internal-rsa.o
  653. OBJS += ../src/crypto/tls_internal.o
  654. OBJS += ../src/tls/tlsv1_common.o
  655. OBJS += ../src/tls/tlsv1_record.o
  656. OBJS += ../src/tls/tlsv1_cred.o
  657. OBJS += ../src/tls/tlsv1_server.o
  658. OBJS += ../src/tls/tlsv1_server_write.o
  659. OBJS += ../src/tls/tlsv1_server_read.o
  660. OBJS += ../src/tls/asn1.o
  661. OBJS += ../src/tls/rsa.o
  662. OBJS += ../src/tls/x509v3.o
  663. OBJS += ../src/tls/pkcs1.o
  664. OBJS += ../src/tls/pkcs5.o
  665. OBJS += ../src/tls/pkcs8.o
  666. NEED_SHA256=y
  667. NEED_BASE64=y
  668. NEED_TLS_PRF=y
  669. ifdef CONFIG_TLSV12
  670. NEED_TLS_PRF_SHA256=y
  671. endif
  672. NEED_MODEXP=y
  673. NEED_CIPHER=y
  674. CFLAGS += -DCONFIG_TLS_INTERNAL
  675. CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
  676. endif
  677. ifdef NEED_MODEXP
  678. OBJS += ../src/crypto/crypto_internal-modexp.o
  679. OBJS += ../src/tls/bignum.o
  680. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  681. CFLAGS += -DLTM_FAST
  682. endif
  683. CONFIG_INTERNAL_DH_GROUP5=y
  684. ifdef NEED_FIPS186_2_PRF
  685. OBJS += ../src/crypto/fips_prf_internal.o
  686. OBJS += ../src/crypto/sha1-internal.o
  687. endif
  688. endif
  689. ifeq ($(CONFIG_TLS), none)
  690. ifdef TLS_FUNCS
  691. OBJS += ../src/crypto/tls_none.o
  692. CFLAGS += -DEAP_TLS_NONE
  693. CONFIG_INTERNAL_AES=y
  694. CONFIG_INTERNAL_SHA1=y
  695. CONFIG_INTERNAL_MD5=y
  696. endif
  697. OBJS += ../src/crypto/crypto_none.o
  698. OBJS_p += ../src/crypto/crypto_none.o
  699. CONFIG_INTERNAL_SHA256=y
  700. CONFIG_INTERNAL_RC4=y
  701. endif
  702. ifndef TLS_FUNCS
  703. OBJS += ../src/crypto/tls_none.o
  704. ifeq ($(CONFIG_TLS), internal)
  705. CONFIG_INTERNAL_AES=y
  706. CONFIG_INTERNAL_SHA1=y
  707. CONFIG_INTERNAL_MD5=y
  708. CONFIG_INTERNAL_RC4=y
  709. endif
  710. endif
  711. AESOBJS = # none so far
  712. ifdef CONFIG_INTERNAL_AES
  713. AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-enc.o
  714. endif
  715. ifneq ($(CONFIG_TLS), openssl)
  716. AESOBJS += ../src/crypto/aes-wrap.o
  717. endif
  718. ifdef NEED_AES_EAX
  719. AESOBJS += ../src/crypto/aes-eax.o
  720. NEED_AES_CTR=y
  721. NEED_AES_OMAC1=y
  722. endif
  723. ifdef NEED_AES_SIV
  724. AESOBJS += ../src/crypto/aes-siv.o
  725. NEED_AES_CTR=y
  726. NEED_AES_OMAC1=y
  727. endif
  728. ifdef NEED_AES_CTR
  729. AESOBJS += ../src/crypto/aes-ctr.o
  730. endif
  731. ifdef NEED_AES_ENCBLOCK
  732. AESOBJS += ../src/crypto/aes-encblock.o
  733. endif
  734. ifdef NEED_AES_OMAC1
  735. ifneq ($(CONFIG_TLS), linux)
  736. AESOBJS += ../src/crypto/aes-omac1.o
  737. endif
  738. endif
  739. ifdef NEED_AES_UNWRAP
  740. ifneq ($(CONFIG_TLS), openssl)
  741. ifneq ($(CONFIG_TLS), linux)
  742. NEED_AES_DEC=y
  743. AESOBJS += ../src/crypto/aes-unwrap.o
  744. endif
  745. endif
  746. endif
  747. ifdef NEED_AES_CBC
  748. NEED_AES_DEC=y
  749. ifneq ($(CONFIG_TLS), openssl)
  750. ifneq ($(CONFIG_TLS), linux)
  751. AESOBJS += ../src/crypto/aes-cbc.o
  752. endif
  753. endif
  754. endif
  755. ifdef NEED_AES_DEC
  756. ifdef CONFIG_INTERNAL_AES
  757. AESOBJS += ../src/crypto/aes-internal-dec.o
  758. endif
  759. endif
  760. ifdef NEED_AES
  761. OBJS += $(AESOBJS)
  762. endif
  763. ifdef NEED_SHA1
  764. ifneq ($(CONFIG_TLS), openssl)
  765. ifneq ($(CONFIG_TLS), linux)
  766. SHA1OBJS += ../src/crypto/sha1.o
  767. endif
  768. endif
  769. SHA1OBJS += ../src/crypto/sha1-prf.o
  770. ifdef CONFIG_INTERNAL_SHA1
  771. SHA1OBJS += ../src/crypto/sha1-internal.o
  772. ifdef NEED_FIPS186_2_PRF
  773. SHA1OBJS += ../src/crypto/fips_prf_internal.o
  774. endif
  775. endif
  776. ifneq ($(CONFIG_TLS), openssl)
  777. SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
  778. endif
  779. ifdef NEED_T_PRF
  780. SHA1OBJS += ../src/crypto/sha1-tprf.o
  781. endif
  782. ifdef NEED_TLS_PRF
  783. SHA1OBJS += ../src/crypto/sha1-tlsprf.o
  784. endif
  785. endif
  786. ifdef NEED_SHA1
  787. OBJS += $(SHA1OBJS)
  788. endif
  789. ifneq ($(CONFIG_TLS), openssl)
  790. ifneq ($(CONFIG_TLS), linux)
  791. OBJS += ../src/crypto/md5.o
  792. endif
  793. endif
  794. ifdef NEED_MD5
  795. ifdef CONFIG_INTERNAL_MD5
  796. OBJS += ../src/crypto/md5-internal.o
  797. HOBJS += ../src/crypto/md5-internal.o
  798. endif
  799. endif
  800. ifdef NEED_MD4
  801. ifdef CONFIG_INTERNAL_MD4
  802. OBJS += ../src/crypto/md4-internal.o
  803. endif
  804. endif
  805. ifdef NEED_DES
  806. ifdef CONFIG_INTERNAL_DES
  807. OBJS += ../src/crypto/des-internal.o
  808. endif
  809. endif
  810. ifdef CONFIG_NO_RC4
  811. CFLAGS += -DCONFIG_NO_RC4
  812. endif
  813. ifdef NEED_RC4
  814. ifdef CONFIG_INTERNAL_RC4
  815. ifndef CONFIG_NO_RC4
  816. OBJS += ../src/crypto/rc4.o
  817. endif
  818. endif
  819. endif
  820. ifdef NEED_SHA256
  821. CFLAGS += -DCONFIG_SHA256
  822. ifneq ($(CONFIG_TLS), openssl)
  823. ifneq ($(CONFIG_TLS), linux)
  824. OBJS += ../src/crypto/sha256.o
  825. endif
  826. endif
  827. OBJS += ../src/crypto/sha256-prf.o
  828. ifdef CONFIG_INTERNAL_SHA256
  829. OBJS += ../src/crypto/sha256-internal.o
  830. endif
  831. ifdef NEED_TLS_PRF_SHA256
  832. OBJS += ../src/crypto/sha256-tlsprf.o
  833. endif
  834. ifdef NEED_HMAC_SHA256_KDF
  835. OBJS += ../src/crypto/sha256-kdf.o
  836. endif
  837. endif
  838. ifdef NEED_SHA384
  839. CFLAGS += -DCONFIG_SHA384
  840. ifneq ($(CONFIG_TLS), openssl)
  841. ifneq ($(CONFIG_TLS), linux)
  842. OBJS += ../src/crypto/sha384.o
  843. endif
  844. endif
  845. OBJS += ../src/crypto/sha384-prf.o
  846. endif
  847. ifdef CONFIG_INTERNAL_SHA384
  848. CFLAGS += -DCONFIG_INTERNAL_SHA384
  849. OBJS += ../src/crypto/sha384-internal.o
  850. endif
  851. ifdef CONFIG_INTERNAL_SHA512
  852. CFLAGS += -DCONFIG_INTERNAL_SHA512
  853. OBJS += ../src/crypto/sha512-internal.o
  854. endif
  855. ifdef NEED_DH_GROUPS
  856. OBJS += ../src/crypto/dh_groups.o
  857. endif
  858. ifdef NEED_DH_GROUPS_ALL
  859. CFLAGS += -DALL_DH_GROUPS
  860. endif
  861. ifdef CONFIG_INTERNAL_DH_GROUP5
  862. ifdef NEED_DH_GROUPS
  863. OBJS += ../src/crypto/dh_group5.o
  864. endif
  865. endif
  866. ifdef NEED_ECC
  867. CFLAGS += -DCONFIG_ECC
  868. endif
  869. ifdef CONFIG_NO_RANDOM_POOL
  870. CFLAGS += -DCONFIG_NO_RANDOM_POOL
  871. else
  872. OBJS += ../src/crypto/random.o
  873. HOBJS += ../src/crypto/random.o
  874. HOBJS += ../src/utils/eloop.o
  875. HOBJS += $(SHA1OBJS)
  876. ifneq ($(CONFIG_TLS), openssl)
  877. ifneq ($(CONFIG_TLS), linux)
  878. HOBJS += ../src/crypto/md5.o
  879. endif
  880. endif
  881. endif
  882. ifdef CONFIG_RADIUS_SERVER
  883. CFLAGS += -DRADIUS_SERVER
  884. OBJS += ../src/radius/radius_server.o
  885. endif
  886. ifdef CONFIG_IPV6
  887. CFLAGS += -DCONFIG_IPV6
  888. endif
  889. ifdef CONFIG_DRIVER_RADIUS_ACL
  890. CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
  891. endif
  892. ifdef NEED_BASE64
  893. OBJS += ../src/utils/base64.o
  894. endif
  895. ifdef NEED_AP_MLME
  896. OBJS += ../src/ap/wmm.o
  897. OBJS += ../src/ap/ap_list.o
  898. OBJS += ../src/ap/ieee802_11.o
  899. OBJS += ../src/ap/hw_features.o
  900. OBJS += ../src/ap/dfs.o
  901. CFLAGS += -DNEED_AP_MLME
  902. endif
  903. ifdef CONFIG_IEEE80211N
  904. OBJS += ../src/ap/ieee802_11_ht.o
  905. endif
  906. ifdef CONFIG_IEEE80211AC
  907. OBJS += ../src/ap/ieee802_11_vht.o
  908. endif
  909. ifdef CONFIG_P2P_MANAGER
  910. CFLAGS += -DCONFIG_P2P_MANAGER
  911. OBJS += ../src/ap/p2p_hostapd.o
  912. endif
  913. ifdef CONFIG_HS20
  914. CFLAGS += -DCONFIG_HS20
  915. OBJS += ../src/ap/hs20.o
  916. CONFIG_INTERWORKING=y
  917. endif
  918. ifdef CONFIG_INTERWORKING
  919. CFLAGS += -DCONFIG_INTERWORKING
  920. OBJS += ../src/common/gas.o
  921. OBJS += ../src/ap/gas_serv.o
  922. endif
  923. ifdef CONFIG_PROXYARP
  924. CFLAGS += -DCONFIG_PROXYARP
  925. OBJS += ../src/ap/x_snoop.o
  926. OBJS += ../src/ap/dhcp_snoop.o
  927. ifdef CONFIG_IPV6
  928. OBJS += ../src/ap/ndisc_snoop.o
  929. endif
  930. endif
  931. OBJS += ../src/drivers/driver_common.o
  932. ifdef CONFIG_WPA_CLI_EDIT
  933. OBJS_c += ../src/utils/edit.o
  934. else
  935. OBJS_c += ../src/utils/edit_simple.o
  936. endif
  937. ifdef CONFIG_ACS
  938. CFLAGS += -DCONFIG_ACS
  939. OBJS += ../src/ap/acs.o
  940. LIBS += -lm
  941. endif
  942. ifdef CONFIG_NO_STDOUT_DEBUG
  943. CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  944. endif
  945. ifdef CONFIG_DEBUG_SYSLOG
  946. CFLAGS += -DCONFIG_DEBUG_SYSLOG
  947. endif
  948. ifdef CONFIG_DEBUG_LINUX_TRACING
  949. CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
  950. endif
  951. ifdef CONFIG_DEBUG_FILE
  952. CFLAGS += -DCONFIG_DEBUG_FILE
  953. endif
  954. ifdef CONFIG_SQLITE
  955. CFLAGS += -DCONFIG_SQLITE
  956. LIBS += -lsqlite3
  957. LIBS_h += -lsqlite3
  958. endif
  959. ifdef CONFIG_FST
  960. CFLAGS += -DCONFIG_FST
  961. OBJS += ../src/fst/fst.o
  962. OBJS += ../src/fst/fst_group.o
  963. OBJS += ../src/fst/fst_iface.o
  964. OBJS += ../src/fst/fst_session.o
  965. OBJS += ../src/fst/fst_ctrl_aux.o
  966. ifdef CONFIG_FST_TEST
  967. CFLAGS += -DCONFIG_FST_TEST
  968. endif
  969. ifndef CONFIG_NO_CTRL_IFACE
  970. OBJS += ../src/fst/fst_ctrl_iface.o
  971. endif
  972. endif
  973. ALL=hostapd hostapd_cli
  974. all: verify_config $(ALL)
  975. Q=@
  976. E=echo
  977. ifeq ($(V), 1)
  978. Q=
  979. E=true
  980. endif
  981. ifeq ($(QUIET), 1)
  982. Q=@
  983. E=true
  984. endif
  985. ifdef CONFIG_CODE_COVERAGE
  986. %.o: %.c
  987. @$(E) " CC " $<
  988. $(Q)cd $(dir $@); $(CC) -c -o $(notdir $@) $(CFLAGS) $(notdir $<)
  989. else
  990. %.o: %.c
  991. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  992. @$(E) " CC " $<
  993. endif
  994. verify_config:
  995. @if [ ! -r .config ]; then \
  996. echo 'Building hostapd requires a configuration file'; \
  997. echo '(.config). See README for more instructions. You can'; \
  998. echo 'run "cp defconfig .config" to create an example'; \
  999. echo 'configuration.'; \
  1000. exit 1; \
  1001. fi
  1002. $(DESTDIR)$(BINDIR)/%: %
  1003. install -D $(<) $(@)
  1004. install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL))
  1005. ../src/drivers/build.hostapd:
  1006. @if [ -f ../src/drivers/build.wpa_supplicant ]; then \
  1007. $(MAKE) -C ../src/drivers clean; \
  1008. fi
  1009. @touch ../src/drivers/build.hostapd
  1010. BCHECK=../src/drivers/build.hostapd
  1011. hostapd: $(BCHECK) $(OBJS)
  1012. $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
  1013. @$(E) " LD " $@
  1014. ifdef CONFIG_WPA_TRACE
  1015. OBJS_c += ../src/utils/trace.o
  1016. endif
  1017. hostapd_cli: $(OBJS_c)
  1018. $(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c)
  1019. @$(E) " LD " $@
  1020. NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS)
  1021. NOBJS += ../src/utils/common.o
  1022. ifdef NEED_RC4
  1023. ifdef CONFIG_INTERNAL_RC4
  1024. ifndef CONFIG_NO_RC4
  1025. NOBJS += ../src/crypto/rc4.o
  1026. endif
  1027. endif
  1028. endif
  1029. ifdef CONFIG_INTERNAL_MD5
  1030. NOBJS += ../src/crypto/md5-internal.o
  1031. endif
  1032. NOBJS += ../src/crypto/crypto_openssl.o ../src/utils/os_$(CONFIG_OS).o
  1033. NOBJS += ../src/utils/wpa_debug.o
  1034. NOBJS += ../src/utils/wpabuf.o
  1035. ifdef CONFIG_WPA_TRACE
  1036. NOBJS += ../src/utils/trace.o
  1037. LIBS_n += -lbfd
  1038. endif
  1039. ifdef TLS_FUNCS
  1040. LIBS_n += -lcrypto
  1041. endif
  1042. 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
  1043. HOBJS += ../src/crypto/aes-encblock.o
  1044. ifdef CONFIG_INTERNAL_AES
  1045. HOBJS += ../src/crypto/aes-internal.o
  1046. HOBJS += ../src/crypto/aes-internal-enc.o
  1047. endif
  1048. ifeq ($(CONFIG_TLS), linux)
  1049. HOBJS += ../src/crypto/crypto_linux.o
  1050. endif
  1051. nt_password_hash: $(NOBJS)
  1052. $(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
  1053. @$(E) " LD " $@
  1054. hlr_auc_gw: $(HOBJS)
  1055. $(Q)$(CC) $(LDFLAGS) -o hlr_auc_gw $(HOBJS) $(LIBS_h)
  1056. @$(E) " LD " $@
  1057. lcov-html:
  1058. lcov -c -d .. > lcov.info
  1059. genhtml lcov.info --output-directory lcov-html
  1060. clean:
  1061. $(MAKE) -C ../src clean
  1062. rm -f core *~ *.o hostapd hostapd_cli nt_password_hash hlr_auc_gw
  1063. rm -f *.d *.gcno *.gcda *.gcov
  1064. rm -f lcov.info
  1065. rm -rf lcov-html
  1066. -include $(OBJS:%.o=%.d)