Makefile 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337
  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=+ --tags)
  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_HS20
  225. NEED_AES_OMAC1=y
  226. CONFIG_PROXYARP=y
  227. endif
  228. ifdef CONFIG_PROXYARP
  229. CONFIG_L2_PACKET=y
  230. endif
  231. ifdef CONFIG_SUITEB
  232. CFLAGS += -DCONFIG_SUITEB
  233. NEED_SHA256=y
  234. NEED_AES_OMAC1=y
  235. endif
  236. ifdef CONFIG_SUITEB192
  237. CFLAGS += -DCONFIG_SUITEB192
  238. NEED_SHA384=y
  239. endif
  240. ifdef CONFIG_IEEE80211W
  241. CFLAGS += -DCONFIG_IEEE80211W
  242. NEED_SHA256=y
  243. NEED_AES_OMAC1=y
  244. endif
  245. ifdef CONFIG_IEEE80211R
  246. CFLAGS += -DCONFIG_IEEE80211R -DCONFIG_IEEE80211R_AP
  247. OBJS += ../src/ap/wpa_auth_ft.o
  248. NEED_SHA256=y
  249. NEED_AES_OMAC1=y
  250. NEED_AES_UNWRAP=y
  251. NEED_AES_SIV=y
  252. NEED_ETH_P_OUI=y
  253. NEED_SHA256=y
  254. NEED_HMAC_SHA256_KDF=y
  255. endif
  256. ifdef NEED_ETH_P_OUI
  257. CFLAGS += -DCONFIG_ETH_P_OUI
  258. OBJS += ../src/ap/eth_p_oui.o
  259. endif
  260. ifdef CONFIG_SAE
  261. CFLAGS += -DCONFIG_SAE
  262. OBJS += ../src/common/sae.o
  263. NEED_ECC=y
  264. NEED_DH_GROUPS=y
  265. NEED_AP_MLME=y
  266. endif
  267. ifdef CONFIG_OWE
  268. CFLAGS += -DCONFIG_OWE
  269. NEED_ECC=y
  270. NEED_HMAC_SHA256_KDF=y
  271. NEED_HMAC_SHA384_KDF=y
  272. NEED_HMAC_SHA512_KDF=y
  273. NEED_SHA256=y
  274. NEED_SHA384=y
  275. NEED_SHA512=y
  276. endif
  277. ifdef CONFIG_FILS
  278. CFLAGS += -DCONFIG_FILS
  279. OBJS += ../src/ap/fils_hlp.o
  280. NEED_SHA384=y
  281. NEED_AES_SIV=y
  282. ifdef CONFIG_FILS_SK_PFS
  283. CFLAGS += -DCONFIG_FILS_SK_PFS
  284. NEED_ECC=y
  285. endif
  286. endif
  287. ifdef CONFIG_WNM
  288. CFLAGS += -DCONFIG_WNM -DCONFIG_WNM_AP
  289. OBJS += ../src/ap/wnm_ap.o
  290. endif
  291. ifdef CONFIG_IEEE80211N
  292. CFLAGS += -DCONFIG_IEEE80211N
  293. endif
  294. ifdef CONFIG_IEEE80211AC
  295. CFLAGS += -DCONFIG_IEEE80211AC
  296. endif
  297. ifdef CONFIG_IEEE80211AX
  298. CFLAGS += -DCONFIG_IEEE80211AX
  299. OBJS += ../src/ap/ieee802_11_he.o
  300. endif
  301. ifdef CONFIG_MBO
  302. CFLAGS += -DCONFIG_MBO
  303. OBJS += ../src/ap/mbo_ap.o
  304. endif
  305. include ../src/drivers/drivers.mak
  306. OBJS += $(DRV_AP_OBJS)
  307. CFLAGS += $(DRV_AP_CFLAGS)
  308. LDFLAGS += $(DRV_AP_LDFLAGS)
  309. LIBS += $(DRV_AP_LIBS)
  310. ifdef CONFIG_L2_PACKET
  311. ifdef CONFIG_DNET_PCAP
  312. ifdef CONFIG_L2_FREEBSD
  313. LIBS += -lpcap
  314. OBJS += ../src/l2_packet/l2_packet_freebsd.o
  315. else
  316. LIBS += -ldnet -lpcap
  317. OBJS += ../src/l2_packet/l2_packet_pcap.o
  318. endif
  319. else
  320. OBJS += ../src/l2_packet/l2_packet_linux.o
  321. endif
  322. else
  323. OBJS += ../src/l2_packet/l2_packet_none.o
  324. endif
  325. ifdef CONFIG_ERP
  326. CFLAGS += -DCONFIG_ERP
  327. NEED_SHA256=y
  328. NEED_HMAC_SHA256_KDF=y
  329. endif
  330. ifdef CONFIG_EAP_MD5
  331. CFLAGS += -DEAP_SERVER_MD5
  332. OBJS += ../src/eap_server/eap_server_md5.o
  333. CHAP=y
  334. endif
  335. ifdef CONFIG_EAP_TLS
  336. CFLAGS += -DEAP_SERVER_TLS
  337. OBJS += ../src/eap_server/eap_server_tls.o
  338. TLS_FUNCS=y
  339. endif
  340. ifdef CONFIG_EAP_UNAUTH_TLS
  341. CFLAGS += -DEAP_SERVER_UNAUTH_TLS
  342. ifndef CONFIG_EAP_TLS
  343. OBJS += ../src/eap_server/eap_server_tls.o
  344. TLS_FUNCS=y
  345. endif
  346. endif
  347. ifdef CONFIG_EAP_PEAP
  348. CFLAGS += -DEAP_SERVER_PEAP
  349. OBJS += ../src/eap_server/eap_server_peap.o
  350. OBJS += ../src/eap_common/eap_peap_common.o
  351. TLS_FUNCS=y
  352. CONFIG_EAP_MSCHAPV2=y
  353. endif
  354. ifdef CONFIG_EAP_TTLS
  355. CFLAGS += -DEAP_SERVER_TTLS
  356. OBJS += ../src/eap_server/eap_server_ttls.o
  357. TLS_FUNCS=y
  358. CHAP=y
  359. endif
  360. ifdef CONFIG_EAP_MSCHAPV2
  361. CFLAGS += -DEAP_SERVER_MSCHAPV2
  362. OBJS += ../src/eap_server/eap_server_mschapv2.o
  363. MS_FUNCS=y
  364. endif
  365. ifdef CONFIG_EAP_GTC
  366. CFLAGS += -DEAP_SERVER_GTC
  367. OBJS += ../src/eap_server/eap_server_gtc.o
  368. endif
  369. ifdef CONFIG_EAP_SIM
  370. CFLAGS += -DEAP_SERVER_SIM
  371. OBJS += ../src/eap_server/eap_server_sim.o
  372. CONFIG_EAP_SIM_COMMON=y
  373. NEED_AES_CBC=y
  374. endif
  375. ifdef CONFIG_EAP_AKA
  376. CFLAGS += -DEAP_SERVER_AKA
  377. OBJS += ../src/eap_server/eap_server_aka.o
  378. CONFIG_EAP_SIM_COMMON=y
  379. NEED_SHA256=y
  380. NEED_AES_CBC=y
  381. endif
  382. ifdef CONFIG_EAP_AKA_PRIME
  383. CFLAGS += -DEAP_SERVER_AKA_PRIME
  384. endif
  385. ifdef CONFIG_EAP_SIM_COMMON
  386. OBJS += ../src/eap_common/eap_sim_common.o
  387. # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
  388. # replaced with another file implementating the interface specified in
  389. # eap_sim_db.h.
  390. OBJS += ../src/eap_server/eap_sim_db.o
  391. NEED_FIPS186_2_PRF=y
  392. endif
  393. ifdef CONFIG_EAP_PAX
  394. CFLAGS += -DEAP_SERVER_PAX
  395. OBJS += ../src/eap_server/eap_server_pax.o ../src/eap_common/eap_pax_common.o
  396. endif
  397. ifdef CONFIG_EAP_PSK
  398. CFLAGS += -DEAP_SERVER_PSK
  399. OBJS += ../src/eap_server/eap_server_psk.o ../src/eap_common/eap_psk_common.o
  400. NEED_AES_OMAC1=y
  401. NEED_AES_ENCBLOCK=y
  402. NEED_AES_EAX=y
  403. endif
  404. ifdef CONFIG_EAP_SAKE
  405. CFLAGS += -DEAP_SERVER_SAKE
  406. OBJS += ../src/eap_server/eap_server_sake.o ../src/eap_common/eap_sake_common.o
  407. endif
  408. ifdef CONFIG_EAP_GPSK
  409. CFLAGS += -DEAP_SERVER_GPSK
  410. OBJS += ../src/eap_server/eap_server_gpsk.o ../src/eap_common/eap_gpsk_common.o
  411. ifdef CONFIG_EAP_GPSK_SHA256
  412. CFLAGS += -DEAP_GPSK_SHA256
  413. endif
  414. NEED_SHA256=y
  415. NEED_AES_OMAC1=y
  416. endif
  417. ifdef CONFIG_EAP_PWD
  418. CFLAGS += -DEAP_SERVER_PWD
  419. OBJS += ../src/eap_server/eap_server_pwd.o ../src/eap_common/eap_pwd_common.o
  420. NEED_SHA256=y
  421. NEED_ECC=y
  422. endif
  423. ifdef CONFIG_EAP_EKE
  424. CFLAGS += -DEAP_SERVER_EKE
  425. OBJS += ../src/eap_server/eap_server_eke.o ../src/eap_common/eap_eke_common.o
  426. NEED_DH_GROUPS=y
  427. NEED_DH_GROUPS_ALL=y
  428. endif
  429. ifdef CONFIG_EAP_VENDOR_TEST
  430. CFLAGS += -DEAP_SERVER_VENDOR_TEST
  431. OBJS += ../src/eap_server/eap_server_vendor_test.o
  432. endif
  433. ifdef CONFIG_EAP_FAST
  434. CFLAGS += -DEAP_SERVER_FAST
  435. OBJS += ../src/eap_server/eap_server_fast.o
  436. OBJS += ../src/eap_common/eap_fast_common.o
  437. TLS_FUNCS=y
  438. NEED_T_PRF=y
  439. NEED_AES_UNWRAP=y
  440. endif
  441. ifdef CONFIG_WPS
  442. CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
  443. OBJS += ../src/utils/uuid.o
  444. OBJS += ../src/ap/wps_hostapd.o
  445. OBJS += ../src/eap_server/eap_server_wsc.o ../src/eap_common/eap_wsc_common.o
  446. OBJS += ../src/wps/wps.o
  447. OBJS += ../src/wps/wps_common.o
  448. OBJS += ../src/wps/wps_attr_parse.o
  449. OBJS += ../src/wps/wps_attr_build.o
  450. OBJS += ../src/wps/wps_attr_process.o
  451. OBJS += ../src/wps/wps_dev_attr.o
  452. OBJS += ../src/wps/wps_enrollee.o
  453. OBJS += ../src/wps/wps_registrar.o
  454. NEED_DH_GROUPS=y
  455. NEED_SHA256=y
  456. NEED_BASE64=y
  457. NEED_AES_CBC=y
  458. NEED_MODEXP=y
  459. CONFIG_EAP=y
  460. ifdef CONFIG_WPS_NFC
  461. CFLAGS += -DCONFIG_WPS_NFC
  462. OBJS += ../src/wps/ndef.o
  463. NEED_WPS_OOB=y
  464. endif
  465. ifdef NEED_WPS_OOB
  466. CFLAGS += -DCONFIG_WPS_OOB
  467. endif
  468. ifdef CONFIG_WPS_UPNP
  469. CFLAGS += -DCONFIG_WPS_UPNP
  470. OBJS += ../src/wps/wps_upnp.o
  471. OBJS += ../src/wps/wps_upnp_ssdp.o
  472. OBJS += ../src/wps/wps_upnp_web.o
  473. OBJS += ../src/wps/wps_upnp_event.o
  474. OBJS += ../src/wps/wps_upnp_ap.o
  475. OBJS += ../src/wps/upnp_xml.o
  476. OBJS += ../src/wps/httpread.o
  477. OBJS += ../src/wps/http_client.o
  478. OBJS += ../src/wps/http_server.o
  479. endif
  480. ifdef CONFIG_WPS_STRICT
  481. CFLAGS += -DCONFIG_WPS_STRICT
  482. OBJS += ../src/wps/wps_validate.o
  483. endif
  484. ifdef CONFIG_WPS_TESTING
  485. CFLAGS += -DCONFIG_WPS_TESTING
  486. endif
  487. endif
  488. ifdef CONFIG_DPP
  489. CFLAGS += -DCONFIG_DPP
  490. OBJS += ../src/common/dpp.o
  491. OBJS += ../src/ap/dpp_hostapd.o
  492. OBJS += ../src/ap/gas_query_ap.o
  493. NEED_AES_SIV=y
  494. NEED_HMAC_SHA256_KDF=y
  495. NEED_HMAC_SHA384_KDF=y
  496. NEED_HMAC_SHA512_KDF=y
  497. NEED_SHA256=y
  498. NEED_SHA384=y
  499. NEED_SHA512=y
  500. NEED_JSON=y
  501. NEED_GAS=y
  502. NEED_BASE64=y
  503. endif
  504. ifdef CONFIG_EAP_IKEV2
  505. CFLAGS += -DEAP_SERVER_IKEV2
  506. OBJS += ../src/eap_server/eap_server_ikev2.o ../src/eap_server/ikev2.o
  507. OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  508. NEED_DH_GROUPS=y
  509. NEED_DH_GROUPS_ALL=y
  510. NEED_MODEXP=y
  511. NEED_CIPHER=y
  512. endif
  513. ifdef CONFIG_EAP_TNC
  514. CFLAGS += -DEAP_SERVER_TNC
  515. OBJS += ../src/eap_server/eap_server_tnc.o
  516. OBJS += ../src/eap_server/tncs.o
  517. NEED_BASE64=y
  518. ifndef CONFIG_DRIVER_BSD
  519. LIBS += -ldl
  520. endif
  521. endif
  522. # Basic EAP functionality is needed for EAPOL
  523. OBJS += eap_register.o
  524. OBJS += ../src/eap_server/eap_server.o
  525. OBJS += ../src/eap_common/eap_common.o
  526. OBJS += ../src/eap_server/eap_server_methods.o
  527. OBJS += ../src/eap_server/eap_server_identity.o
  528. CFLAGS += -DEAP_SERVER_IDENTITY
  529. ifdef CONFIG_EAP
  530. CFLAGS += -DEAP_SERVER
  531. endif
  532. ifdef CONFIG_PKCS12
  533. CFLAGS += -DPKCS12_FUNCS
  534. endif
  535. ifdef MS_FUNCS
  536. OBJS += ../src/crypto/ms_funcs.o
  537. NEED_DES=y
  538. NEED_MD4=y
  539. endif
  540. ifdef CHAP
  541. OBJS += ../src/eap_common/chap.o
  542. endif
  543. ifdef TLS_FUNCS
  544. NEED_DES=y
  545. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
  546. CFLAGS += -DEAP_TLS_FUNCS
  547. OBJS += ../src/eap_server/eap_server_tls_common.o
  548. NEED_TLS_PRF=y
  549. endif
  550. ifndef CONFIG_TLS
  551. CONFIG_TLS=openssl
  552. endif
  553. ifdef CONFIG_TLSV11
  554. CFLAGS += -DCONFIG_TLSV11
  555. endif
  556. ifdef CONFIG_TLSV12
  557. CFLAGS += -DCONFIG_TLSV12
  558. NEED_SHA256=y
  559. endif
  560. ifeq ($(CONFIG_TLS), wolfssl)
  561. CONFIG_CRYPTO=wolfssl
  562. ifdef TLS_FUNCS
  563. OBJS += ../src/crypto/tls_wolfssl.o
  564. LIBS += -lwolfssl -lm
  565. endif
  566. OBJS += ../src/crypto/crypto_wolfssl.o
  567. HOBJS += ../src/crypto/crypto_wolfssl.o
  568. ifdef NEED_FIPS186_2_PRF
  569. OBJS += ../src/crypto/fips_prf_wolfssl.o
  570. endif
  571. NEED_SHA256=y
  572. NEED_TLS_PRF_SHA256=y
  573. LIBS += -lwolfssl -lm
  574. LIBS_h += -lwolfssl -lm
  575. ifdef CONFIG_TLS_ADD_DL
  576. LIBS += -ldl
  577. LIBS_h += -ldl
  578. endif
  579. endif
  580. ifeq ($(CONFIG_TLS), openssl)
  581. CONFIG_CRYPTO=openssl
  582. ifdef TLS_FUNCS
  583. OBJS += ../src/crypto/tls_openssl.o
  584. OBJS += ../src/crypto/tls_openssl_ocsp.o
  585. LIBS += -lssl
  586. endif
  587. OBJS += ../src/crypto/crypto_openssl.o
  588. HOBJS += ../src/crypto/crypto_openssl.o
  589. ifdef NEED_FIPS186_2_PRF
  590. OBJS += ../src/crypto/fips_prf_openssl.o
  591. endif
  592. NEED_SHA256=y
  593. NEED_TLS_PRF_SHA256=y
  594. LIBS += -lcrypto
  595. LIBS_h += -lcrypto
  596. ifdef CONFIG_TLS_ADD_DL
  597. LIBS += -ldl
  598. LIBS_h += -ldl
  599. endif
  600. ifndef CONFIG_TLS_DEFAULT_CIPHERS
  601. CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW"
  602. endif
  603. CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\"
  604. endif
  605. ifeq ($(CONFIG_TLS), gnutls)
  606. ifndef CONFIG_CRYPTO
  607. # default to libgcrypt
  608. CONFIG_CRYPTO=gnutls
  609. endif
  610. ifdef TLS_FUNCS
  611. OBJS += ../src/crypto/tls_gnutls.o
  612. LIBS += -lgnutls -lgpg-error
  613. endif
  614. OBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
  615. HOBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
  616. ifdef NEED_FIPS186_2_PRF
  617. OBJS += ../src/crypto/fips_prf_internal.o
  618. SHA1OBJS += ../src/crypto/sha1-internal.o
  619. endif
  620. ifeq ($(CONFIG_CRYPTO), gnutls)
  621. LIBS += -lgcrypt
  622. LIBS_h += -lgcrypt
  623. CONFIG_INTERNAL_RC4=y
  624. CONFIG_INTERNAL_DH_GROUP5=y
  625. endif
  626. ifeq ($(CONFIG_CRYPTO), nettle)
  627. LIBS += -lnettle -lgmp
  628. LIBS_p += -lnettle -lgmp
  629. CONFIG_INTERNAL_RC4=y
  630. CONFIG_INTERNAL_DH_GROUP5=y
  631. endif
  632. endif
  633. ifeq ($(CONFIG_TLS), internal)
  634. ifndef CONFIG_CRYPTO
  635. CONFIG_CRYPTO=internal
  636. endif
  637. ifdef TLS_FUNCS
  638. OBJS += ../src/crypto/crypto_internal-rsa.o
  639. OBJS += ../src/crypto/tls_internal.o
  640. OBJS += ../src/tls/tlsv1_common.o
  641. OBJS += ../src/tls/tlsv1_record.o
  642. OBJS += ../src/tls/tlsv1_cred.o
  643. OBJS += ../src/tls/tlsv1_server.o
  644. OBJS += ../src/tls/tlsv1_server_write.o
  645. OBJS += ../src/tls/tlsv1_server_read.o
  646. OBJS += ../src/tls/asn1.o
  647. OBJS += ../src/tls/rsa.o
  648. OBJS += ../src/tls/x509v3.o
  649. OBJS += ../src/tls/pkcs1.o
  650. OBJS += ../src/tls/pkcs5.o
  651. OBJS += ../src/tls/pkcs8.o
  652. NEED_SHA256=y
  653. NEED_BASE64=y
  654. NEED_TLS_PRF=y
  655. ifdef CONFIG_TLSV12
  656. NEED_TLS_PRF_SHA256=y
  657. endif
  658. NEED_MODEXP=y
  659. NEED_CIPHER=y
  660. CFLAGS += -DCONFIG_TLS_INTERNAL
  661. CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
  662. endif
  663. ifdef NEED_CIPHER
  664. NEED_DES=y
  665. OBJS += ../src/crypto/crypto_internal-cipher.o
  666. endif
  667. ifdef NEED_MODEXP
  668. OBJS += ../src/crypto/crypto_internal-modexp.o
  669. OBJS += ../src/tls/bignum.o
  670. endif
  671. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  672. OBJS += ../src/crypto/crypto_libtomcrypt.o
  673. LIBS += -ltomcrypt -ltfm
  674. LIBS_h += -ltomcrypt -ltfm
  675. CONFIG_INTERNAL_SHA256=y
  676. CONFIG_INTERNAL_RC4=y
  677. CONFIG_INTERNAL_DH_GROUP5=y
  678. endif
  679. ifeq ($(CONFIG_CRYPTO), internal)
  680. OBJS += ../src/crypto/crypto_internal.o
  681. NEED_AES_DEC=y
  682. CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  683. ifdef CONFIG_INTERNAL_LIBTOMMATH
  684. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  685. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  686. CFLAGS += -DLTM_FAST
  687. endif
  688. else
  689. LIBS += -ltommath
  690. LIBS_h += -ltommath
  691. endif
  692. CONFIG_INTERNAL_AES=y
  693. CONFIG_INTERNAL_DES=y
  694. CONFIG_INTERNAL_SHA1=y
  695. CONFIG_INTERNAL_MD4=y
  696. CONFIG_INTERNAL_MD5=y
  697. CONFIG_INTERNAL_SHA256=y
  698. CONFIG_INTERNAL_SHA384=y
  699. CONFIG_INTERNAL_SHA512=y
  700. CONFIG_INTERNAL_RC4=y
  701. CONFIG_INTERNAL_DH_GROUP5=y
  702. endif
  703. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  704. OBJS += ../src/crypto/crypto_cryptoapi.o
  705. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  706. CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  707. CONFIG_INTERNAL_SHA256=y
  708. CONFIG_INTERNAL_RC4=y
  709. endif
  710. endif
  711. ifeq ($(CONFIG_TLS), linux)
  712. OBJS += ../src/crypto/crypto_linux.o
  713. ifdef TLS_FUNCS
  714. OBJS += ../src/crypto/crypto_internal-rsa.o
  715. OBJS += ../src/crypto/tls_internal.o
  716. OBJS += ../src/tls/tlsv1_common.o
  717. OBJS += ../src/tls/tlsv1_record.o
  718. OBJS += ../src/tls/tlsv1_cred.o
  719. OBJS += ../src/tls/tlsv1_server.o
  720. OBJS += ../src/tls/tlsv1_server_write.o
  721. OBJS += ../src/tls/tlsv1_server_read.o
  722. OBJS += ../src/tls/asn1.o
  723. OBJS += ../src/tls/rsa.o
  724. OBJS += ../src/tls/x509v3.o
  725. OBJS += ../src/tls/pkcs1.o
  726. OBJS += ../src/tls/pkcs5.o
  727. OBJS += ../src/tls/pkcs8.o
  728. NEED_SHA256=y
  729. NEED_BASE64=y
  730. NEED_TLS_PRF=y
  731. ifdef CONFIG_TLSV12
  732. NEED_TLS_PRF_SHA256=y
  733. endif
  734. NEED_MODEXP=y
  735. NEED_CIPHER=y
  736. CFLAGS += -DCONFIG_TLS_INTERNAL
  737. CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
  738. endif
  739. ifdef NEED_MODEXP
  740. OBJS += ../src/crypto/crypto_internal-modexp.o
  741. OBJS += ../src/tls/bignum.o
  742. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  743. CFLAGS += -DLTM_FAST
  744. endif
  745. CONFIG_INTERNAL_DH_GROUP5=y
  746. ifdef NEED_FIPS186_2_PRF
  747. OBJS += ../src/crypto/fips_prf_internal.o
  748. OBJS += ../src/crypto/sha1-internal.o
  749. endif
  750. endif
  751. ifeq ($(CONFIG_TLS), none)
  752. ifdef TLS_FUNCS
  753. OBJS += ../src/crypto/tls_none.o
  754. CFLAGS += -DEAP_TLS_NONE
  755. CONFIG_INTERNAL_AES=y
  756. CONFIG_INTERNAL_SHA1=y
  757. CONFIG_INTERNAL_MD5=y
  758. endif
  759. OBJS += ../src/crypto/crypto_none.o
  760. OBJS_p += ../src/crypto/crypto_none.o
  761. CONFIG_INTERNAL_SHA256=y
  762. CONFIG_INTERNAL_RC4=y
  763. endif
  764. ifndef TLS_FUNCS
  765. OBJS += ../src/crypto/tls_none.o
  766. ifeq ($(CONFIG_TLS), internal)
  767. CONFIG_INTERNAL_AES=y
  768. CONFIG_INTERNAL_SHA1=y
  769. CONFIG_INTERNAL_MD5=y
  770. CONFIG_INTERNAL_RC4=y
  771. endif
  772. endif
  773. AESOBJS = # none so far
  774. ifdef CONFIG_INTERNAL_AES
  775. AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-enc.o
  776. endif
  777. ifneq ($(CONFIG_TLS), openssl)
  778. ifneq ($(CONFIG_TLS), wolfssl)
  779. AESOBJS += ../src/crypto/aes-wrap.o
  780. endif
  781. endif
  782. ifdef NEED_AES_EAX
  783. AESOBJS += ../src/crypto/aes-eax.o
  784. NEED_AES_CTR=y
  785. NEED_AES_OMAC1=y
  786. endif
  787. ifdef NEED_AES_SIV
  788. AESOBJS += ../src/crypto/aes-siv.o
  789. NEED_AES_CTR=y
  790. NEED_AES_OMAC1=y
  791. endif
  792. ifdef NEED_AES_CTR
  793. AESOBJS += ../src/crypto/aes-ctr.o
  794. endif
  795. ifdef NEED_AES_ENCBLOCK
  796. AESOBJS += ../src/crypto/aes-encblock.o
  797. endif
  798. ifdef NEED_AES_OMAC1
  799. ifneq ($(CONFIG_TLS), linux)
  800. AESOBJS += ../src/crypto/aes-omac1.o
  801. endif
  802. endif
  803. ifdef NEED_AES_UNWRAP
  804. ifneq ($(CONFIG_TLS), openssl)
  805. ifneq ($(CONFIG_TLS), linux)
  806. ifneq ($(CONFIG_TLS), wolfssl)
  807. NEED_AES_DEC=y
  808. AESOBJS += ../src/crypto/aes-unwrap.o
  809. endif
  810. endif
  811. endif
  812. endif
  813. ifdef NEED_AES_CBC
  814. NEED_AES_DEC=y
  815. ifneq ($(CONFIG_TLS), openssl)
  816. ifneq ($(CONFIG_TLS), linux)
  817. ifneq ($(CONFIG_TLS), wolfssl)
  818. AESOBJS += ../src/crypto/aes-cbc.o
  819. endif
  820. endif
  821. endif
  822. endif
  823. ifdef NEED_AES_DEC
  824. ifdef CONFIG_INTERNAL_AES
  825. AESOBJS += ../src/crypto/aes-internal-dec.o
  826. endif
  827. endif
  828. ifdef NEED_AES
  829. OBJS += $(AESOBJS)
  830. endif
  831. ifdef NEED_SHA1
  832. ifneq ($(CONFIG_TLS), openssl)
  833. ifneq ($(CONFIG_TLS), linux)
  834. ifneq ($(CONFIG_TLS), gnutls)
  835. ifneq ($(CONFIG_TLS), wolfssl)
  836. SHA1OBJS += ../src/crypto/sha1.o
  837. endif
  838. endif
  839. endif
  840. endif
  841. SHA1OBJS += ../src/crypto/sha1-prf.o
  842. ifdef CONFIG_INTERNAL_SHA1
  843. SHA1OBJS += ../src/crypto/sha1-internal.o
  844. ifdef NEED_FIPS186_2_PRF
  845. SHA1OBJS += ../src/crypto/fips_prf_internal.o
  846. endif
  847. endif
  848. ifneq ($(CONFIG_TLS), openssl)
  849. ifneq ($(CONFIG_TLS), wolfssl)
  850. SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
  851. endif
  852. endif
  853. ifdef NEED_T_PRF
  854. SHA1OBJS += ../src/crypto/sha1-tprf.o
  855. endif
  856. ifdef NEED_TLS_PRF
  857. SHA1OBJS += ../src/crypto/sha1-tlsprf.o
  858. endif
  859. endif
  860. ifdef NEED_SHA1
  861. OBJS += $(SHA1OBJS)
  862. endif
  863. ifneq ($(CONFIG_TLS), openssl)
  864. ifneq ($(CONFIG_TLS), linux)
  865. ifneq ($(CONFIG_TLS), gnutls)
  866. ifneq ($(CONFIG_TLS), wolfssl)
  867. OBJS += ../src/crypto/md5.o
  868. endif
  869. endif
  870. endif
  871. endif
  872. ifdef NEED_MD5
  873. ifdef CONFIG_INTERNAL_MD5
  874. OBJS += ../src/crypto/md5-internal.o
  875. HOBJS += ../src/crypto/md5-internal.o
  876. endif
  877. endif
  878. ifdef NEED_MD4
  879. ifdef CONFIG_INTERNAL_MD4
  880. OBJS += ../src/crypto/md4-internal.o
  881. endif
  882. endif
  883. ifdef NEED_DES
  884. CFLAGS += -DCONFIG_DES
  885. ifdef CONFIG_INTERNAL_DES
  886. OBJS += ../src/crypto/des-internal.o
  887. endif
  888. endif
  889. ifdef CONFIG_NO_RC4
  890. CFLAGS += -DCONFIG_NO_RC4
  891. endif
  892. ifdef NEED_RC4
  893. ifdef CONFIG_INTERNAL_RC4
  894. ifndef CONFIG_NO_RC4
  895. OBJS += ../src/crypto/rc4.o
  896. endif
  897. endif
  898. endif
  899. ifdef NEED_SHA256
  900. CFLAGS += -DCONFIG_SHA256
  901. ifneq ($(CONFIG_TLS), openssl)
  902. ifneq ($(CONFIG_TLS), linux)
  903. ifneq ($(CONFIG_TLS), gnutls)
  904. ifneq ($(CONFIG_TLS), wolfssl)
  905. OBJS += ../src/crypto/sha256.o
  906. endif
  907. endif
  908. endif
  909. endif
  910. OBJS += ../src/crypto/sha256-prf.o
  911. ifdef CONFIG_INTERNAL_SHA256
  912. OBJS += ../src/crypto/sha256-internal.o
  913. endif
  914. ifdef NEED_TLS_PRF_SHA256
  915. OBJS += ../src/crypto/sha256-tlsprf.o
  916. endif
  917. ifdef NEED_HMAC_SHA256_KDF
  918. OBJS += ../src/crypto/sha256-kdf.o
  919. endif
  920. ifdef NEED_HMAC_SHA384_KDF
  921. OBJS += ../src/crypto/sha384-kdf.o
  922. endif
  923. ifdef NEED_HMAC_SHA512_KDF
  924. OBJS += ../src/crypto/sha512-kdf.o
  925. endif
  926. endif
  927. ifdef NEED_SHA384
  928. CFLAGS += -DCONFIG_SHA384
  929. ifneq ($(CONFIG_TLS), openssl)
  930. ifneq ($(CONFIG_TLS), linux)
  931. ifneq ($(CONFIG_TLS), gnutls)
  932. ifneq ($(CONFIG_TLS), wolfssl)
  933. OBJS += ../src/crypto/sha384.o
  934. endif
  935. endif
  936. endif
  937. endif
  938. OBJS += ../src/crypto/sha384-prf.o
  939. endif
  940. ifdef NEED_SHA512
  941. CFLAGS += -DCONFIG_SHA512
  942. ifneq ($(CONFIG_TLS), openssl)
  943. ifneq ($(CONFIG_TLS), linux)
  944. ifneq ($(CONFIG_TLS), gnutls)
  945. ifneq ($(CONFIG_TLS), wolfssl)
  946. OBJS += ../src/crypto/sha512.o
  947. endif
  948. endif
  949. endif
  950. endif
  951. OBJS += ../src/crypto/sha512-prf.o
  952. endif
  953. ifdef CONFIG_INTERNAL_SHA384
  954. CFLAGS += -DCONFIG_INTERNAL_SHA384
  955. OBJS += ../src/crypto/sha384-internal.o
  956. endif
  957. ifdef CONFIG_INTERNAL_SHA512
  958. CFLAGS += -DCONFIG_INTERNAL_SHA512
  959. OBJS += ../src/crypto/sha512-internal.o
  960. endif
  961. ifdef NEED_DH_GROUPS
  962. OBJS += ../src/crypto/dh_groups.o
  963. endif
  964. ifdef NEED_DH_GROUPS_ALL
  965. CFLAGS += -DALL_DH_GROUPS
  966. endif
  967. ifdef CONFIG_INTERNAL_DH_GROUP5
  968. ifdef NEED_DH_GROUPS
  969. OBJS += ../src/crypto/dh_group5.o
  970. endif
  971. endif
  972. ifdef NEED_ECC
  973. CFLAGS += -DCONFIG_ECC
  974. endif
  975. ifdef CONFIG_NO_RANDOM_POOL
  976. CFLAGS += -DCONFIG_NO_RANDOM_POOL
  977. else
  978. OBJS += ../src/crypto/random.o
  979. HOBJS += ../src/crypto/random.o
  980. HOBJS += ../src/utils/eloop.o
  981. HOBJS += $(SHA1OBJS)
  982. ifneq ($(CONFIG_TLS), openssl)
  983. ifneq ($(CONFIG_TLS), linux)
  984. ifneq ($(CONFIG_TLS), wolfssl)
  985. HOBJS += ../src/crypto/md5.o
  986. endif
  987. endif
  988. endif
  989. endif
  990. ifdef CONFIG_RADIUS_SERVER
  991. CFLAGS += -DRADIUS_SERVER
  992. OBJS += ../src/radius/radius_server.o
  993. endif
  994. ifdef CONFIG_IPV6
  995. CFLAGS += -DCONFIG_IPV6
  996. endif
  997. ifdef CONFIG_DRIVER_RADIUS_ACL
  998. CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
  999. endif
  1000. ifdef NEED_BASE64
  1001. OBJS += ../src/utils/base64.o
  1002. endif
  1003. ifdef NEED_JSON
  1004. OBJS += ../src/utils/json.o
  1005. CFLAGS += -DCONFIG_JSON
  1006. endif
  1007. ifdef NEED_AP_MLME
  1008. OBJS += ../src/ap/wmm.o
  1009. OBJS += ../src/ap/ap_list.o
  1010. OBJS += ../src/ap/ieee802_11.o
  1011. OBJS += ../src/ap/hw_features.o
  1012. OBJS += ../src/ap/dfs.o
  1013. CFLAGS += -DNEED_AP_MLME
  1014. endif
  1015. ifdef CONFIG_IEEE80211N
  1016. OBJS += ../src/ap/ieee802_11_ht.o
  1017. endif
  1018. ifdef CONFIG_IEEE80211AC
  1019. OBJS += ../src/ap/ieee802_11_vht.o
  1020. endif
  1021. ifdef CONFIG_P2P_MANAGER
  1022. CFLAGS += -DCONFIG_P2P_MANAGER
  1023. OBJS += ../src/ap/p2p_hostapd.o
  1024. endif
  1025. ifdef CONFIG_HS20
  1026. CFLAGS += -DCONFIG_HS20
  1027. OBJS += ../src/ap/hs20.o
  1028. CONFIG_INTERWORKING=y
  1029. endif
  1030. ifdef CONFIG_INTERWORKING
  1031. CFLAGS += -DCONFIG_INTERWORKING
  1032. NEED_GAS=y
  1033. endif
  1034. ifdef NEED_GAS
  1035. OBJS += ../src/common/gas.o
  1036. OBJS += ../src/ap/gas_serv.o
  1037. endif
  1038. ifdef CONFIG_PROXYARP
  1039. CFLAGS += -DCONFIG_PROXYARP
  1040. OBJS += ../src/ap/x_snoop.o
  1041. OBJS += ../src/ap/dhcp_snoop.o
  1042. ifdef CONFIG_IPV6
  1043. OBJS += ../src/ap/ndisc_snoop.o
  1044. endif
  1045. endif
  1046. OBJS += ../src/drivers/driver_common.o
  1047. ifdef CONFIG_WPA_CLI_EDIT
  1048. OBJS_c += ../src/utils/edit.o
  1049. else
  1050. OBJS_c += ../src/utils/edit_simple.o
  1051. endif
  1052. ifdef CONFIG_ACS
  1053. CFLAGS += -DCONFIG_ACS
  1054. OBJS += ../src/ap/acs.o
  1055. LIBS += -lm
  1056. endif
  1057. ifdef CONFIG_NO_STDOUT_DEBUG
  1058. CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  1059. endif
  1060. ifdef CONFIG_DEBUG_SYSLOG
  1061. CFLAGS += -DCONFIG_DEBUG_SYSLOG
  1062. endif
  1063. ifdef CONFIG_DEBUG_LINUX_TRACING
  1064. CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
  1065. endif
  1066. ifdef CONFIG_DEBUG_FILE
  1067. CFLAGS += -DCONFIG_DEBUG_FILE
  1068. endif
  1069. ifdef CONFIG_SQLITE
  1070. CFLAGS += -DCONFIG_SQLITE
  1071. LIBS += -lsqlite3
  1072. LIBS_h += -lsqlite3
  1073. endif
  1074. ifdef CONFIG_FST
  1075. CFLAGS += -DCONFIG_FST
  1076. OBJS += ../src/fst/fst.o
  1077. OBJS += ../src/fst/fst_group.o
  1078. OBJS += ../src/fst/fst_iface.o
  1079. OBJS += ../src/fst/fst_session.o
  1080. OBJS += ../src/fst/fst_ctrl_aux.o
  1081. ifdef CONFIG_FST_TEST
  1082. CFLAGS += -DCONFIG_FST_TEST
  1083. endif
  1084. ifndef CONFIG_NO_CTRL_IFACE
  1085. OBJS += ../src/fst/fst_ctrl_iface.o
  1086. endif
  1087. endif
  1088. ALL=hostapd hostapd_cli
  1089. all: verify_config $(ALL)
  1090. Q=@
  1091. E=echo
  1092. ifeq ($(V), 1)
  1093. Q=
  1094. E=true
  1095. endif
  1096. ifeq ($(QUIET), 1)
  1097. Q=@
  1098. E=true
  1099. endif
  1100. ifdef CONFIG_CODE_COVERAGE
  1101. %.o: %.c
  1102. @$(E) " CC " $<
  1103. $(Q)cd $(dir $@); $(CC) -c -o $(notdir $@) $(CFLAGS) $(notdir $<)
  1104. else
  1105. %.o: %.c
  1106. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  1107. @$(E) " CC " $<
  1108. endif
  1109. verify_config:
  1110. @if [ ! -r .config ]; then \
  1111. echo 'Building hostapd requires a configuration file'; \
  1112. echo '(.config). See README for more instructions. You can'; \
  1113. echo 'run "cp defconfig .config" to create an example'; \
  1114. echo 'configuration.'; \
  1115. exit 1; \
  1116. fi
  1117. $(DESTDIR)$(BINDIR)/%: %
  1118. install -D $(<) $(@)
  1119. install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL))
  1120. ../src/drivers/build.hostapd:
  1121. @if [ -f ../src/drivers/build.wpa_supplicant ]; then \
  1122. $(MAKE) -C ../src/drivers clean; \
  1123. fi
  1124. @touch ../src/drivers/build.hostapd
  1125. BCHECK=../src/drivers/build.hostapd
  1126. hostapd: $(BCHECK) $(OBJS)
  1127. $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
  1128. @$(E) " LD " $@
  1129. ifdef CONFIG_WPA_TRACE
  1130. OBJS_c += ../src/utils/trace.o
  1131. endif
  1132. hostapd_cli: $(OBJS_c)
  1133. $(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c)
  1134. @$(E) " LD " $@
  1135. NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS)
  1136. NOBJS += ../src/utils/common.o
  1137. ifdef NEED_RC4
  1138. ifdef CONFIG_INTERNAL_RC4
  1139. ifndef CONFIG_NO_RC4
  1140. NOBJS += ../src/crypto/rc4.o
  1141. endif
  1142. endif
  1143. endif
  1144. ifdef CONFIG_INTERNAL_MD5
  1145. NOBJS += ../src/crypto/md5-internal.o
  1146. endif
  1147. NOBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
  1148. NOBJS += ../src/utils/os_$(CONFIG_OS).o
  1149. NOBJS += ../src/utils/wpa_debug.o
  1150. NOBJS += ../src/utils/wpabuf.o
  1151. ifdef CONFIG_WPA_TRACE
  1152. NOBJS += ../src/utils/trace.o
  1153. LIBS_n += -lbfd
  1154. endif
  1155. ifdef TLS_FUNCS
  1156. LIBS_n += -lcrypto
  1157. endif
  1158. 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
  1159. HOBJS += ../src/crypto/aes-encblock.o
  1160. ifdef CONFIG_INTERNAL_AES
  1161. HOBJS += ../src/crypto/aes-internal.o
  1162. HOBJS += ../src/crypto/aes-internal-enc.o
  1163. endif
  1164. ifeq ($(CONFIG_TLS), linux)
  1165. HOBJS += ../src/crypto/crypto_linux.o
  1166. endif
  1167. nt_password_hash: $(NOBJS)
  1168. $(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
  1169. @$(E) " LD " $@
  1170. hlr_auc_gw: $(HOBJS)
  1171. $(Q)$(CC) $(LDFLAGS) -o hlr_auc_gw $(HOBJS) $(LIBS_h)
  1172. @$(E) " LD " $@
  1173. lcov-html:
  1174. lcov -c -d .. > lcov.info
  1175. genhtml lcov.info --output-directory lcov-html
  1176. clean:
  1177. $(MAKE) -C ../src clean
  1178. rm -f core *~ *.o hostapd hostapd_cli nt_password_hash hlr_auc_gw
  1179. rm -f *.d *.gcno *.gcda *.gcov
  1180. rm -f lcov.info
  1181. rm -rf lcov-html
  1182. -include $(OBJS:%.o=%.d)