Makefile 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766
  1. ifndef CC
  2. CC=gcc
  3. endif
  4. ifndef CFLAGS
  5. CFLAGS = -MMD -O2 -Wall -g
  6. endif
  7. export LIBDIR ?= /usr/local/lib/
  8. export BINDIR ?= /usr/local/sbin/
  9. PKG_CONFIG ?= pkg-config
  10. CFLAGS += $(EXTRA_CFLAGS)
  11. CFLAGS += -I$(abspath ../src)
  12. CFLAGS += -I$(abspath ../src/utils)
  13. -include .config
  14. ifdef CONFIG_TESTING_OPTIONS
  15. CFLAGS += -DCONFIG_TESTING_OPTIONS
  16. CONFIG_WPS_TESTING=y
  17. CONFIG_TDLS_TESTING=y
  18. endif
  19. BINALL=wpa_supplicant wpa_cli
  20. ifndef CONFIG_NO_WPA_PASSPHRASE
  21. BINALL += wpa_passphrase
  22. endif
  23. ALL = $(BINALL)
  24. ALL += systemd/wpa_supplicant.service
  25. ALL += systemd/wpa_supplicant@.service
  26. ALL += systemd/wpa_supplicant-nl80211@.service
  27. ALL += systemd/wpa_supplicant-wired@.service
  28. ALL += dbus/fi.epitest.hostap.WPASupplicant.service
  29. ALL += dbus/fi.w1.wpa_supplicant1.service
  30. all: verify_config $(ALL) dynamic_eap_methods
  31. verify_config:
  32. @if [ ! -r .config ]; then \
  33. echo 'Building wpa_supplicant requires a configuration file'; \
  34. echo '(.config). See README for more instructions. You can'; \
  35. echo 'run "cp defconfig .config" to create an example'; \
  36. echo 'configuration.'; \
  37. exit 1; \
  38. fi
  39. mkconfig:
  40. @if [ -f .config ]; then \
  41. echo '.config exists - did not replace it'; \
  42. exit 1; \
  43. fi
  44. echo CONFIG_DRIVER_HOSTAP=y >> .config
  45. echo CONFIG_DRIVER_WEXT=y >> .config
  46. $(DESTDIR)$(BINDIR)/%: %
  47. install -D $(<) $(@)
  48. install: $(addprefix $(DESTDIR)$(BINDIR)/,$(BINALL))
  49. $(MAKE) -C ../src install
  50. ifdef CONFIG_FIPS
  51. CONFIG_NO_RANDOM_POOL=
  52. CONFIG_OPENSSL_CMAC=y
  53. endif
  54. OBJS = config.o
  55. OBJS += notify.o
  56. OBJS += bss.o
  57. OBJS += eap_register.o
  58. OBJS += ../src/utils/common.o
  59. OBJS += ../src/utils/wpa_debug.o
  60. OBJS += ../src/utils/wpabuf.o
  61. OBJS_p = wpa_passphrase.o
  62. OBJS_p += ../src/utils/common.o
  63. OBJS_p += ../src/utils/wpa_debug.o
  64. OBJS_p += ../src/utils/wpabuf.o
  65. OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
  66. OBJS_c += ../src/utils/wpa_debug.o
  67. OBJS_c += ../src/utils/common.o
  68. OBJS += wmm_ac.o
  69. ifndef CONFIG_OS
  70. ifdef CONFIG_NATIVE_WINDOWS
  71. CONFIG_OS=win32
  72. else
  73. CONFIG_OS=unix
  74. endif
  75. endif
  76. ifeq ($(CONFIG_OS), internal)
  77. CFLAGS += -DOS_NO_C_LIB_DEFINES
  78. endif
  79. OBJS += ../src/utils/os_$(CONFIG_OS).o
  80. OBJS_p += ../src/utils/os_$(CONFIG_OS).o
  81. OBJS_c += ../src/utils/os_$(CONFIG_OS).o
  82. ifdef CONFIG_WPA_TRACE
  83. CFLAGS += -DWPA_TRACE
  84. OBJS += ../src/utils/trace.o
  85. OBJS_p += ../src/utils/trace.o
  86. OBJS_c += ../src/utils/trace.o
  87. OBJS_priv += ../src/utils/trace.o
  88. LIBCTRL += ../src/utils/trace.o
  89. LDFLAGS += -rdynamic
  90. CFLAGS += -funwind-tables
  91. ifdef CONFIG_WPA_TRACE_BFD
  92. CFLAGS += -DPACKAGE="wpa_supplicant" -DWPA_TRACE_BFD
  93. LIBS += -lbfd -ldl -liberty -lz
  94. LIBS_p += -lbfd -ldl -liberty -lz
  95. LIBS_c += -lbfd -ldl -liberty -lz
  96. endif
  97. endif
  98. ifndef CONFIG_ELOOP
  99. CONFIG_ELOOP=eloop
  100. endif
  101. OBJS += ../src/utils/$(CONFIG_ELOOP).o
  102. OBJS_c += ../src/utils/$(CONFIG_ELOOP).o
  103. ifeq ($(CONFIG_ELOOP), eloop)
  104. # Using glibc < 2.17 requires -lrt for clock_gettime()
  105. LIBS += -lrt
  106. LIBS_c += -lrt
  107. LIBS_p += -lrt
  108. endif
  109. ifdef CONFIG_ELOOP_POLL
  110. CFLAGS += -DCONFIG_ELOOP_POLL
  111. endif
  112. ifdef CONFIG_ELOOP_EPOLL
  113. CFLAGS += -DCONFIG_ELOOP_EPOLL
  114. endif
  115. ifdef CONFIG_EAPOL_TEST
  116. CFLAGS += -Werror -DEAPOL_TEST
  117. endif
  118. ifdef CONFIG_CODE_COVERAGE
  119. CFLAGS += -O0 -fprofile-arcs -ftest-coverage
  120. LIBS += -lgcov
  121. LIBS_c += -lgcov
  122. LIBS_p += -lgcov
  123. endif
  124. ifdef CONFIG_HT_OVERRIDES
  125. CFLAGS += -DCONFIG_HT_OVERRIDES
  126. endif
  127. ifdef CONFIG_VHT_OVERRIDES
  128. CFLAGS += -DCONFIG_VHT_OVERRIDES
  129. endif
  130. ifndef CONFIG_BACKEND
  131. CONFIG_BACKEND=file
  132. endif
  133. ifeq ($(CONFIG_BACKEND), file)
  134. OBJS += config_file.o
  135. ifndef CONFIG_NO_CONFIG_BLOBS
  136. NEED_BASE64=y
  137. endif
  138. CFLAGS += -DCONFIG_BACKEND_FILE
  139. endif
  140. ifeq ($(CONFIG_BACKEND), winreg)
  141. OBJS += config_winreg.o
  142. endif
  143. ifeq ($(CONFIG_BACKEND), none)
  144. OBJS += config_none.o
  145. endif
  146. ifdef CONFIG_NO_CONFIG_WRITE
  147. CFLAGS += -DCONFIG_NO_CONFIG_WRITE
  148. endif
  149. ifdef CONFIG_NO_CONFIG_BLOBS
  150. CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
  151. endif
  152. ifdef CONFIG_NO_SCAN_PROCESSING
  153. CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
  154. endif
  155. ifdef CONFIG_SUITEB
  156. CFLAGS += -DCONFIG_SUITEB
  157. NEED_SHA256=y
  158. NEED_AES_OMAC1=y
  159. endif
  160. ifdef CONFIG_SUITEB192
  161. CFLAGS += -DCONFIG_SUITEB192
  162. NEED_SHA384=y
  163. endif
  164. ifdef CONFIG_IEEE80211W
  165. CFLAGS += -DCONFIG_IEEE80211W
  166. NEED_SHA256=y
  167. NEED_AES_OMAC1=y
  168. endif
  169. ifdef CONFIG_IEEE80211R
  170. CFLAGS += -DCONFIG_IEEE80211R
  171. OBJS += ../src/rsn_supp/wpa_ft.o
  172. NEED_SHA256=y
  173. NEED_AES_OMAC1=y
  174. endif
  175. ifdef CONFIG_MESH
  176. NEED_80211_COMMON=y
  177. NEED_SHA256=y
  178. NEED_AES_SIV=y
  179. NEED_AES_OMAC1=y
  180. NEED_AES_CTR=y
  181. CONFIG_SAE=y
  182. CONFIG_AP=y
  183. CFLAGS += -DCONFIG_MESH
  184. OBJS += mesh.o
  185. OBJS += mesh_mpm.o
  186. OBJS += mesh_rsn.o
  187. endif
  188. ifdef CONFIG_SAE
  189. CFLAGS += -DCONFIG_SAE
  190. OBJS += ../src/common/sae.o
  191. NEED_ECC=y
  192. NEED_DH_GROUPS=y
  193. endif
  194. ifdef CONFIG_WNM
  195. CFLAGS += -DCONFIG_WNM
  196. OBJS += wnm_sta.o
  197. endif
  198. ifdef CONFIG_TDLS
  199. CFLAGS += -DCONFIG_TDLS
  200. OBJS += ../src/rsn_supp/tdls.o
  201. NEED_SHA256=y
  202. NEED_AES_OMAC1=y
  203. endif
  204. ifdef CONFIG_TDLS_TESTING
  205. CFLAGS += -DCONFIG_TDLS_TESTING
  206. endif
  207. ifdef CONFIG_PEERKEY
  208. CFLAGS += -DCONFIG_PEERKEY
  209. endif
  210. ifndef CONFIG_NO_WPA
  211. OBJS += ../src/rsn_supp/wpa.o
  212. OBJS += ../src/rsn_supp/preauth.o
  213. OBJS += ../src/rsn_supp/pmksa_cache.o
  214. OBJS += ../src/rsn_supp/peerkey.o
  215. OBJS += ../src/rsn_supp/wpa_ie.o
  216. OBJS += ../src/common/wpa_common.o
  217. NEED_AES=y
  218. NEED_SHA1=y
  219. NEED_MD5=y
  220. NEED_RC4=y
  221. else
  222. CFLAGS += -DCONFIG_NO_WPA
  223. endif
  224. ifdef CONFIG_IBSS_RSN
  225. NEED_RSN_AUTHENTICATOR=y
  226. CFLAGS += -DCONFIG_IBSS_RSN
  227. OBJS += ibss_rsn.o
  228. endif
  229. ifdef CONFIG_P2P
  230. OBJS += p2p_supplicant.o
  231. OBJS += p2p_supplicant_sd.o
  232. OBJS += ../src/p2p/p2p.o
  233. OBJS += ../src/p2p/p2p_utils.o
  234. OBJS += ../src/p2p/p2p_parse.o
  235. OBJS += ../src/p2p/p2p_build.o
  236. OBJS += ../src/p2p/p2p_go_neg.o
  237. OBJS += ../src/p2p/p2p_sd.o
  238. OBJS += ../src/p2p/p2p_pd.o
  239. OBJS += ../src/p2p/p2p_invitation.o
  240. OBJS += ../src/p2p/p2p_dev_disc.o
  241. OBJS += ../src/p2p/p2p_group.o
  242. OBJS += ../src/ap/p2p_hostapd.o
  243. OBJS += ../src/utils/bitfield.o
  244. CFLAGS += -DCONFIG_P2P
  245. NEED_GAS=y
  246. NEED_OFFCHANNEL=y
  247. CONFIG_WPS=y
  248. CONFIG_AP=y
  249. ifdef CONFIG_P2P_STRICT
  250. CFLAGS += -DCONFIG_P2P_STRICT
  251. endif
  252. endif
  253. ifdef CONFIG_WIFI_DISPLAY
  254. CFLAGS += -DCONFIG_WIFI_DISPLAY
  255. OBJS += wifi_display.o
  256. endif
  257. ifdef CONFIG_HS20
  258. OBJS += hs20_supplicant.o
  259. CFLAGS += -DCONFIG_HS20
  260. CONFIG_INTERWORKING=y
  261. NEED_AES_OMAC1=y
  262. endif
  263. ifdef CONFIG_INTERWORKING
  264. OBJS += interworking.o
  265. CFLAGS += -DCONFIG_INTERWORKING
  266. NEED_GAS=y
  267. endif
  268. ifdef CONFIG_NO_ROAMING
  269. CFLAGS += -DCONFIG_NO_ROAMING
  270. endif
  271. include ../src/drivers/drivers.mak
  272. ifdef CONFIG_AP
  273. OBJS_d += $(DRV_BOTH_OBJS)
  274. CFLAGS += $(DRV_BOTH_CFLAGS)
  275. LDFLAGS += $(DRV_BOTH_LDFLAGS)
  276. LIBS += $(DRV_BOTH_LIBS)
  277. else
  278. NEED_AP_MLME=
  279. OBJS_d += $(DRV_WPA_OBJS)
  280. CFLAGS += $(DRV_WPA_CFLAGS)
  281. LDFLAGS += $(DRV_WPA_LDFLAGS)
  282. LIBS += $(DRV_WPA_LIBS)
  283. endif
  284. ifndef CONFIG_L2_PACKET
  285. CONFIG_L2_PACKET=linux
  286. endif
  287. OBJS_l2 += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o
  288. ifeq ($(CONFIG_L2_PACKET), pcap)
  289. ifdef CONFIG_WINPCAP
  290. CFLAGS += -DCONFIG_WINPCAP
  291. LIBS += -lwpcap -lpacket
  292. LIBS_w += -lwpcap
  293. else
  294. LIBS += -ldnet -lpcap
  295. endif
  296. endif
  297. ifeq ($(CONFIG_L2_PACKET), winpcap)
  298. LIBS += -lwpcap -lpacket
  299. LIBS_w += -lwpcap
  300. endif
  301. ifeq ($(CONFIG_L2_PACKET), freebsd)
  302. LIBS += -lpcap
  303. endif
  304. ifdef CONFIG_ERP
  305. CFLAGS += -DCONFIG_ERP
  306. NEED_SHA256=y
  307. NEED_HMAC_SHA256_KDF=y
  308. endif
  309. ifdef CONFIG_EAP_TLS
  310. # EAP-TLS
  311. ifeq ($(CONFIG_EAP_TLS), dyn)
  312. CFLAGS += -DEAP_TLS_DYNAMIC
  313. EAPDYN += ../src/eap_peer/eap_tls.so
  314. else
  315. CFLAGS += -DEAP_TLS
  316. OBJS += ../src/eap_peer/eap_tls.o
  317. OBJS_h += ../src/eap_server/eap_server_tls.o
  318. endif
  319. TLS_FUNCS=y
  320. CONFIG_IEEE8021X_EAPOL=y
  321. endif
  322. ifdef CONFIG_EAP_UNAUTH_TLS
  323. # EAP-UNAUTH-TLS
  324. CFLAGS += -DEAP_UNAUTH_TLS
  325. ifndef CONFIG_EAP_TLS
  326. OBJS += ../src/eap_peer/eap_tls.o
  327. OBJS_h += ../src/eap_server/eap_server_tls.o
  328. TLS_FUNCS=y
  329. endif
  330. CONFIG_IEEE8021X_EAPOL=y
  331. endif
  332. ifdef CONFIG_EAP_PEAP
  333. # EAP-PEAP
  334. ifeq ($(CONFIG_EAP_PEAP), dyn)
  335. CFLAGS += -DEAP_PEAP_DYNAMIC
  336. EAPDYN += ../src/eap_peer/eap_peap.so
  337. else
  338. CFLAGS += -DEAP_PEAP
  339. OBJS += ../src/eap_peer/eap_peap.o
  340. OBJS += ../src/eap_common/eap_peap_common.o
  341. OBJS_h += ../src/eap_server/eap_server_peap.o
  342. endif
  343. TLS_FUNCS=y
  344. CONFIG_IEEE8021X_EAPOL=y
  345. endif
  346. ifdef CONFIG_EAP_TTLS
  347. # EAP-TTLS
  348. ifeq ($(CONFIG_EAP_TTLS), dyn)
  349. CFLAGS += -DEAP_TTLS_DYNAMIC
  350. EAPDYN += ../src/eap_peer/eap_ttls.so
  351. else
  352. CFLAGS += -DEAP_TTLS
  353. OBJS += ../src/eap_peer/eap_ttls.o
  354. OBJS_h += ../src/eap_server/eap_server_ttls.o
  355. endif
  356. MS_FUNCS=y
  357. TLS_FUNCS=y
  358. CHAP=y
  359. CONFIG_IEEE8021X_EAPOL=y
  360. endif
  361. ifdef CONFIG_EAP_MD5
  362. # EAP-MD5
  363. ifeq ($(CONFIG_EAP_MD5), dyn)
  364. CFLAGS += -DEAP_MD5_DYNAMIC
  365. EAPDYN += ../src/eap_peer/eap_md5.so
  366. else
  367. CFLAGS += -DEAP_MD5
  368. OBJS += ../src/eap_peer/eap_md5.o
  369. OBJS_h += ../src/eap_server/eap_server_md5.o
  370. endif
  371. CHAP=y
  372. CONFIG_IEEE8021X_EAPOL=y
  373. endif
  374. # backwards compatibility for old spelling
  375. ifdef CONFIG_MSCHAPV2
  376. ifndef CONFIG_EAP_MSCHAPV2
  377. CONFIG_EAP_MSCHAPV2=y
  378. endif
  379. endif
  380. ifdef CONFIG_EAP_MSCHAPV2
  381. # EAP-MSCHAPv2
  382. ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
  383. CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
  384. EAPDYN += ../src/eap_peer/eap_mschapv2.so
  385. EAPDYN += ../src/eap_peer/mschapv2.so
  386. else
  387. CFLAGS += -DEAP_MSCHAPv2
  388. OBJS += ../src/eap_peer/eap_mschapv2.o
  389. OBJS += ../src/eap_peer/mschapv2.o
  390. OBJS_h += ../src/eap_server/eap_server_mschapv2.o
  391. endif
  392. MS_FUNCS=y
  393. CONFIG_IEEE8021X_EAPOL=y
  394. endif
  395. ifdef CONFIG_EAP_GTC
  396. # EAP-GTC
  397. ifeq ($(CONFIG_EAP_GTC), dyn)
  398. CFLAGS += -DEAP_GTC_DYNAMIC
  399. EAPDYN += ../src/eap_peer/eap_gtc.so
  400. else
  401. CFLAGS += -DEAP_GTC
  402. OBJS += ../src/eap_peer/eap_gtc.o
  403. OBJS_h += ../src/eap_server/eap_server_gtc.o
  404. endif
  405. CONFIG_IEEE8021X_EAPOL=y
  406. endif
  407. ifdef CONFIG_EAP_OTP
  408. # EAP-OTP
  409. ifeq ($(CONFIG_EAP_OTP), dyn)
  410. CFLAGS += -DEAP_OTP_DYNAMIC
  411. EAPDYN += ../src/eap_peer/eap_otp.so
  412. else
  413. CFLAGS += -DEAP_OTP
  414. OBJS += ../src/eap_peer/eap_otp.o
  415. endif
  416. CONFIG_IEEE8021X_EAPOL=y
  417. endif
  418. ifdef CONFIG_EAP_SIM
  419. # EAP-SIM
  420. ifeq ($(CONFIG_EAP_SIM), dyn)
  421. CFLAGS += -DEAP_SIM_DYNAMIC
  422. EAPDYN += ../src/eap_peer/eap_sim.so
  423. else
  424. CFLAGS += -DEAP_SIM
  425. OBJS += ../src/eap_peer/eap_sim.o
  426. OBJS_h += ../src/eap_server/eap_server_sim.o
  427. endif
  428. CONFIG_IEEE8021X_EAPOL=y
  429. CONFIG_EAP_SIM_COMMON=y
  430. NEED_AES_CBC=y
  431. endif
  432. ifdef CONFIG_EAP_LEAP
  433. # EAP-LEAP
  434. ifeq ($(CONFIG_EAP_LEAP), dyn)
  435. CFLAGS += -DEAP_LEAP_DYNAMIC
  436. EAPDYN += ../src/eap_peer/eap_leap.so
  437. else
  438. CFLAGS += -DEAP_LEAP
  439. OBJS += ../src/eap_peer/eap_leap.o
  440. endif
  441. MS_FUNCS=y
  442. CONFIG_IEEE8021X_EAPOL=y
  443. endif
  444. ifdef CONFIG_EAP_PSK
  445. # EAP-PSK
  446. ifeq ($(CONFIG_EAP_PSK), dyn)
  447. CFLAGS += -DEAP_PSK_DYNAMIC
  448. EAPDYN += ../src/eap_peer/eap_psk.so
  449. else
  450. CFLAGS += -DEAP_PSK
  451. OBJS += ../src/eap_peer/eap_psk.o ../src/eap_common/eap_psk_common.o
  452. OBJS_h += ../src/eap_server/eap_server_psk.o
  453. endif
  454. CONFIG_IEEE8021X_EAPOL=y
  455. NEED_AES=y
  456. NEED_AES_OMAC1=y
  457. NEED_AES_ENCBLOCK=y
  458. NEED_AES_EAX=y
  459. endif
  460. ifdef CONFIG_EAP_AKA
  461. # EAP-AKA
  462. ifeq ($(CONFIG_EAP_AKA), dyn)
  463. CFLAGS += -DEAP_AKA_DYNAMIC
  464. EAPDYN += ../src/eap_peer/eap_aka.so
  465. else
  466. CFLAGS += -DEAP_AKA
  467. OBJS += ../src/eap_peer/eap_aka.o
  468. OBJS_h += ../src/eap_server/eap_server_aka.o
  469. endif
  470. CONFIG_IEEE8021X_EAPOL=y
  471. CONFIG_EAP_SIM_COMMON=y
  472. NEED_AES_CBC=y
  473. endif
  474. ifdef CONFIG_EAP_PROXY
  475. CFLAGS += -DCONFIG_EAP_PROXY
  476. OBJS += ../src/eap_peer/eap_proxy_$(CONFIG_EAP_PROXY).o
  477. include eap_proxy_$(CONFIG_EAP_PROXY).mak
  478. CONFIG_IEEE8021X_EAPOL=y
  479. endif
  480. ifdef CONFIG_EAP_AKA_PRIME
  481. # EAP-AKA'
  482. ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
  483. CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
  484. else
  485. CFLAGS += -DEAP_AKA_PRIME
  486. endif
  487. NEED_SHA256=y
  488. endif
  489. ifdef CONFIG_EAP_SIM_COMMON
  490. OBJS += ../src/eap_common/eap_sim_common.o
  491. OBJS_h += ../src/eap_server/eap_sim_db.o
  492. NEED_AES=y
  493. NEED_FIPS186_2_PRF=y
  494. endif
  495. ifdef CONFIG_EAP_FAST
  496. # EAP-FAST
  497. ifeq ($(CONFIG_EAP_FAST), dyn)
  498. CFLAGS += -DEAP_FAST_DYNAMIC
  499. EAPDYN += ../src/eap_peer/eap_fast.so
  500. EAPDYN += ../src/eap_common/eap_fast_common.o
  501. else
  502. CFLAGS += -DEAP_FAST
  503. OBJS += ../src/eap_peer/eap_fast.o ../src/eap_peer/eap_fast_pac.o
  504. OBJS += ../src/eap_common/eap_fast_common.o
  505. OBJS_h += ../src/eap_server/eap_server_fast.o
  506. endif
  507. TLS_FUNCS=y
  508. CONFIG_IEEE8021X_EAPOL=y
  509. NEED_T_PRF=y
  510. endif
  511. ifdef CONFIG_EAP_PAX
  512. # EAP-PAX
  513. ifeq ($(CONFIG_EAP_PAX), dyn)
  514. CFLAGS += -DEAP_PAX_DYNAMIC
  515. EAPDYN += ../src/eap_peer/eap_pax.so
  516. else
  517. CFLAGS += -DEAP_PAX
  518. OBJS += ../src/eap_peer/eap_pax.o ../src/eap_common/eap_pax_common.o
  519. OBJS_h += ../src/eap_server/eap_server_pax.o
  520. endif
  521. CONFIG_IEEE8021X_EAPOL=y
  522. endif
  523. ifdef CONFIG_EAP_SAKE
  524. # EAP-SAKE
  525. ifeq ($(CONFIG_EAP_SAKE), dyn)
  526. CFLAGS += -DEAP_SAKE_DYNAMIC
  527. EAPDYN += ../src/eap_peer/eap_sake.so
  528. else
  529. CFLAGS += -DEAP_SAKE
  530. OBJS += ../src/eap_peer/eap_sake.o ../src/eap_common/eap_sake_common.o
  531. OBJS_h += ../src/eap_server/eap_server_sake.o
  532. endif
  533. CONFIG_IEEE8021X_EAPOL=y
  534. endif
  535. ifdef CONFIG_EAP_GPSK
  536. # EAP-GPSK
  537. ifeq ($(CONFIG_EAP_GPSK), dyn)
  538. CFLAGS += -DEAP_GPSK_DYNAMIC
  539. EAPDYN += ../src/eap_peer/eap_gpsk.so
  540. else
  541. CFLAGS += -DEAP_GPSK
  542. OBJS += ../src/eap_peer/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o
  543. OBJS_h += ../src/eap_server/eap_server_gpsk.o
  544. endif
  545. CONFIG_IEEE8021X_EAPOL=y
  546. ifdef CONFIG_EAP_GPSK_SHA256
  547. CFLAGS += -DEAP_GPSK_SHA256
  548. endif
  549. NEED_SHA256=y
  550. NEED_AES_OMAC1=y
  551. endif
  552. ifdef CONFIG_EAP_PWD
  553. CFLAGS += -DEAP_PWD
  554. OBJS += ../src/eap_peer/eap_pwd.o ../src/eap_common/eap_pwd_common.o
  555. OBJS_h += ../src/eap_server/eap_server_pwd.o
  556. CONFIG_IEEE8021X_EAPOL=y
  557. NEED_SHA256=y
  558. endif
  559. ifdef CONFIG_EAP_EKE
  560. # EAP-EKE
  561. ifeq ($(CONFIG_EAP_EKE), dyn)
  562. CFLAGS += -DEAP_EKE_DYNAMIC
  563. EAPDYN += ../src/eap_peer/eap_eke.so
  564. else
  565. CFLAGS += -DEAP_EKE
  566. OBJS += ../src/eap_peer/eap_eke.o ../src/eap_common/eap_eke_common.o
  567. OBJS_h += ../src/eap_server/eap_server_eke.o
  568. endif
  569. CONFIG_IEEE8021X_EAPOL=y
  570. NEED_DH_GROUPS=y
  571. NEED_DH_GROUPS_ALL=y
  572. NEED_SHA256=y
  573. endif
  574. ifdef CONFIG_WPS
  575. # EAP-WSC
  576. CFLAGS += -DCONFIG_WPS -DEAP_WSC
  577. OBJS += wps_supplicant.o
  578. OBJS += ../src/utils/uuid.o
  579. OBJS += ../src/eap_peer/eap_wsc.o ../src/eap_common/eap_wsc_common.o
  580. OBJS += ../src/wps/wps.o
  581. OBJS += ../src/wps/wps_common.o
  582. OBJS += ../src/wps/wps_attr_parse.o
  583. OBJS += ../src/wps/wps_attr_build.o
  584. OBJS += ../src/wps/wps_attr_process.o
  585. OBJS += ../src/wps/wps_dev_attr.o
  586. OBJS += ../src/wps/wps_enrollee.o
  587. OBJS += ../src/wps/wps_registrar.o
  588. OBJS_h += ../src/eap_server/eap_server_wsc.o
  589. CONFIG_IEEE8021X_EAPOL=y
  590. NEED_DH_GROUPS=y
  591. NEED_SHA256=y
  592. NEED_BASE64=y
  593. NEED_AES_CBC=y
  594. NEED_MODEXP=y
  595. ifdef CONFIG_WPS_NFC
  596. CFLAGS += -DCONFIG_WPS_NFC
  597. OBJS += ../src/wps/ndef.o
  598. NEED_WPS_OOB=y
  599. endif
  600. ifdef NEED_WPS_OOB
  601. CFLAGS += -DCONFIG_WPS_OOB
  602. endif
  603. ifdef CONFIG_WPS_ER
  604. CONFIG_WPS_UPNP=y
  605. CFLAGS += -DCONFIG_WPS_ER
  606. OBJS += ../src/wps/wps_er.o
  607. OBJS += ../src/wps/wps_er_ssdp.o
  608. endif
  609. ifdef CONFIG_WPS_UPNP
  610. CFLAGS += -DCONFIG_WPS_UPNP
  611. OBJS += ../src/wps/wps_upnp.o
  612. OBJS += ../src/wps/wps_upnp_ssdp.o
  613. OBJS += ../src/wps/wps_upnp_web.o
  614. OBJS += ../src/wps/wps_upnp_event.o
  615. OBJS += ../src/wps/wps_upnp_ap.o
  616. OBJS += ../src/wps/upnp_xml.o
  617. OBJS += ../src/wps/httpread.o
  618. OBJS += ../src/wps/http_client.o
  619. OBJS += ../src/wps/http_server.o
  620. endif
  621. ifdef CONFIG_WPS_STRICT
  622. CFLAGS += -DCONFIG_WPS_STRICT
  623. OBJS += ../src/wps/wps_validate.o
  624. endif
  625. ifdef CONFIG_WPS_TESTING
  626. CFLAGS += -DCONFIG_WPS_TESTING
  627. endif
  628. ifdef CONFIG_WPS_REG_DISABLE_OPEN
  629. CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
  630. endif
  631. endif
  632. ifdef CONFIG_EAP_IKEV2
  633. # EAP-IKEv2
  634. ifeq ($(CONFIG_EAP_IKEV2), dyn)
  635. CFLAGS += -DEAP_IKEV2_DYNAMIC
  636. EAPDYN += ../src/eap_peer/eap_ikev2.so ../src/eap_peer/ikev2.o
  637. EAPDYN += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  638. else
  639. CFLAGS += -DEAP_IKEV2
  640. OBJS += ../src/eap_peer/eap_ikev2.o ../src/eap_peer/ikev2.o
  641. OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  642. OBJS_h += ../src/eap_server/eap_server_ikev2.o
  643. OBJS_h += ../src/eap_server/ikev2.o
  644. endif
  645. CONFIG_IEEE8021X_EAPOL=y
  646. NEED_DH_GROUPS=y
  647. NEED_DH_GROUPS_ALL=y
  648. NEED_MODEXP=y
  649. NEED_CIPHER=y
  650. endif
  651. ifdef CONFIG_EAP_VENDOR_TEST
  652. ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
  653. CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
  654. EAPDYN += ../src/eap_peer/eap_vendor_test.so
  655. else
  656. CFLAGS += -DEAP_VENDOR_TEST
  657. OBJS += ../src/eap_peer/eap_vendor_test.o
  658. OBJS_h += ../src/eap_server/eap_server_vendor_test.o
  659. endif
  660. CONFIG_IEEE8021X_EAPOL=y
  661. endif
  662. ifdef CONFIG_EAP_TNC
  663. # EAP-TNC
  664. CFLAGS += -DEAP_TNC
  665. OBJS += ../src/eap_peer/eap_tnc.o
  666. OBJS += ../src/eap_peer/tncc.o
  667. OBJS_h += ../src/eap_server/eap_server_tnc.o
  668. OBJS_h += ../src/eap_server/tncs.o
  669. NEED_BASE64=y
  670. ifndef CONFIG_NATIVE_WINDOWS
  671. ifndef CONFIG_DRIVER_BSD
  672. LIBS += -ldl
  673. endif
  674. endif
  675. endif
  676. ifdef CONFIG_IEEE8021X_EAPOL
  677. # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
  678. CFLAGS += -DIEEE8021X_EAPOL
  679. OBJS += ../src/eapol_supp/eapol_supp_sm.o
  680. OBJS += ../src/eap_peer/eap.o ../src/eap_peer/eap_methods.o
  681. NEED_EAP_COMMON=y
  682. ifdef CONFIG_DYNAMIC_EAP_METHODS
  683. CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  684. LIBS += -ldl -rdynamic
  685. endif
  686. endif
  687. ifdef CONFIG_MACSEC
  688. CFLAGS += -DCONFIG_MACSEC
  689. NEED_AES_ENCBLOCK=y
  690. NEED_AES_UNWRAP=y
  691. NEED_AES_WRAP=y
  692. NEED_AES_OMAC1=y
  693. OBJS += wpas_kay.o
  694. OBJS += ../src/pae/ieee802_1x_cp.o
  695. OBJS += ../src/pae/ieee802_1x_kay.o
  696. OBJS += ../src/pae/ieee802_1x_key.o
  697. OBJS += ../src/pae/ieee802_1x_secy_ops.o
  698. endif
  699. ifdef CONFIG_AP
  700. NEED_EAP_COMMON=y
  701. NEED_RSN_AUTHENTICATOR=y
  702. CFLAGS += -DCONFIG_AP
  703. OBJS += ap.o
  704. CFLAGS += -DCONFIG_NO_RADIUS
  705. CFLAGS += -DCONFIG_NO_ACCOUNTING
  706. CFLAGS += -DCONFIG_NO_VLAN
  707. OBJS += ../src/ap/hostapd.o
  708. OBJS += ../src/ap/wpa_auth_glue.o
  709. OBJS += ../src/ap/utils.o
  710. OBJS += ../src/ap/authsrv.o
  711. OBJS += ../src/ap/ap_config.o
  712. OBJS += ../src/utils/ip_addr.o
  713. OBJS += ../src/ap/sta_info.o
  714. OBJS += ../src/ap/tkip_countermeasures.o
  715. OBJS += ../src/ap/ap_mlme.o
  716. OBJS += ../src/ap/ieee802_1x.o
  717. OBJS += ../src/eapol_auth/eapol_auth_sm.o
  718. OBJS += ../src/ap/ieee802_11_auth.o
  719. OBJS += ../src/ap/ieee802_11_shared.o
  720. OBJS += ../src/ap/drv_callbacks.o
  721. OBJS += ../src/ap/ap_drv_ops.o
  722. OBJS += ../src/ap/beacon.o
  723. OBJS += ../src/ap/bss_load.o
  724. OBJS += ../src/ap/eap_user_db.o
  725. ifdef CONFIG_IEEE80211N
  726. OBJS += ../src/ap/ieee802_11_ht.o
  727. ifdef CONFIG_IEEE80211AC
  728. OBJS += ../src/ap/ieee802_11_vht.o
  729. endif
  730. endif
  731. ifdef CONFIG_WNM
  732. OBJS += ../src/ap/wnm_ap.o
  733. endif
  734. ifdef CONFIG_CTRL_IFACE
  735. OBJS += ../src/ap/ctrl_iface_ap.o
  736. endif
  737. CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
  738. OBJS += ../src/eap_server/eap_server.o
  739. OBJS += ../src/eap_server/eap_server_identity.o
  740. OBJS += ../src/eap_server/eap_server_methods.o
  741. ifdef CONFIG_IEEE80211N
  742. CFLAGS += -DCONFIG_IEEE80211N
  743. ifdef CONFIG_IEEE80211AC
  744. CFLAGS += -DCONFIG_IEEE80211AC
  745. endif
  746. endif
  747. ifdef NEED_AP_MLME
  748. OBJS += ../src/ap/wmm.o
  749. OBJS += ../src/ap/ap_list.o
  750. OBJS += ../src/ap/ieee802_11.o
  751. OBJS += ../src/ap/hw_features.o
  752. OBJS += ../src/ap/dfs.o
  753. CFLAGS += -DNEED_AP_MLME
  754. endif
  755. ifdef CONFIG_WPS
  756. CFLAGS += -DEAP_SERVER_WSC
  757. OBJS += ../src/ap/wps_hostapd.o
  758. OBJS += ../src/eap_server/eap_server_wsc.o
  759. endif
  760. ifdef CONFIG_INTERWORKING
  761. OBJS += ../src/ap/gas_serv.o
  762. endif
  763. ifdef CONFIG_HS20
  764. OBJS += ../src/ap/hs20.o
  765. endif
  766. endif
  767. ifdef NEED_RSN_AUTHENTICATOR
  768. CFLAGS += -DCONFIG_NO_RADIUS
  769. NEED_AES_WRAP=y
  770. OBJS += ../src/ap/wpa_auth.o
  771. OBJS += ../src/ap/wpa_auth_ie.o
  772. OBJS += ../src/ap/pmksa_cache_auth.o
  773. ifdef CONFIG_IEEE80211R
  774. OBJS += ../src/ap/wpa_auth_ft.o
  775. endif
  776. ifdef CONFIG_PEERKEY
  777. OBJS += ../src/ap/peerkey_auth.o
  778. endif
  779. endif
  780. ifdef CONFIG_EAP_SERVER
  781. CFLAGS += -DEAP_SERVER
  782. OBJS_h += ../src/eap_server/eap_server.o
  783. OBJS_h += ../src/eap_server/eap_server_identity.o
  784. OBJS_h += ../src/eap_server/eap_server_methods.o
  785. endif
  786. ifdef CONFIG_RADIUS_CLIENT
  787. OBJS_h += ../src/utils/ip_addr.o
  788. OBJS_h += ../src/radius/radius.o
  789. OBJS_h += ../src/radius/radius_client.o
  790. endif
  791. ifdef CONFIG_AUTHENTICATOR
  792. OBJS_h += ../src/eapol_auth/eapol_auth_sm.o
  793. OBJS_h += ../src/ap/ieee802_1x.o
  794. endif
  795. ifdef CONFIG_WPA_AUTHENTICATOR
  796. OBJS_h += ../src/ap/wpa_auth.o
  797. OBJS_h += ../src/ap/wpa_auth_ie.o
  798. OBJS_h += ../src/ap/pmksa_cache_auth.o
  799. ifdef CONFIG_IEEE80211R
  800. OBJS_h += ../src/ap/wpa_auth_ft.o
  801. endif
  802. ifdef CONFIG_PEERKEY
  803. OBJS_h += ../src/ap/peerkey_auth.o
  804. endif
  805. endif
  806. ifdef CONFIG_PCSC
  807. # PC/SC interface for smartcards (USIM, GSM SIM)
  808. CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
  809. OBJS += ../src/utils/pcsc_funcs.o
  810. # -lpthread may not be needed depending on how pcsc-lite was configured
  811. ifdef CONFIG_NATIVE_WINDOWS
  812. #Once MinGW gets support for WinScard, -lwinscard could be used instead of the
  813. #dynamic symbol loading that is now used in pcsc_funcs.c
  814. #LIBS += -lwinscard
  815. else
  816. LIBS += -lpcsclite -lpthread
  817. endif
  818. endif
  819. ifdef CONFIG_SIM_SIMULATOR
  820. CFLAGS += -DCONFIG_SIM_SIMULATOR
  821. NEED_MILENAGE=y
  822. endif
  823. ifdef CONFIG_USIM_SIMULATOR
  824. CFLAGS += -DCONFIG_USIM_SIMULATOR
  825. NEED_MILENAGE=y
  826. endif
  827. ifdef NEED_MILENAGE
  828. OBJS += ../src/crypto/milenage.o
  829. NEED_AES_ENCBLOCK=y
  830. endif
  831. ifdef CONFIG_PKCS12
  832. CFLAGS += -DPKCS12_FUNCS
  833. endif
  834. ifdef CONFIG_SMARTCARD
  835. CFLAGS += -DCONFIG_SMARTCARD
  836. endif
  837. ifdef MS_FUNCS
  838. OBJS += ../src/crypto/ms_funcs.o
  839. NEED_DES=y
  840. NEED_MD4=y
  841. endif
  842. ifdef CHAP
  843. OBJS += ../src/eap_common/chap.o
  844. endif
  845. ifdef TLS_FUNCS
  846. NEED_DES=y
  847. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
  848. OBJS += ../src/eap_peer/eap_tls_common.o
  849. OBJS_h += ../src/eap_server/eap_server_tls_common.o
  850. ifndef CONFIG_FIPS
  851. NEED_TLS_PRF=y
  852. NEED_SHA1=y
  853. NEED_MD5=y
  854. endif
  855. endif
  856. ifndef CONFIG_TLS
  857. CONFIG_TLS=openssl
  858. endif
  859. ifdef CONFIG_TLSV11
  860. CFLAGS += -DCONFIG_TLSV11
  861. endif
  862. ifdef CONFIG_TLSV12
  863. CFLAGS += -DCONFIG_TLSV12
  864. NEED_SHA256=y
  865. endif
  866. ifeq ($(CONFIG_TLS), openssl)
  867. ifdef TLS_FUNCS
  868. CFLAGS += -DEAP_TLS_OPENSSL
  869. OBJS += ../src/crypto/tls_openssl.o
  870. LIBS += -lssl
  871. endif
  872. OBJS += ../src/crypto/crypto_openssl.o
  873. OBJS_p += ../src/crypto/crypto_openssl.o
  874. OBJS_priv += ../src/crypto/crypto_openssl.o
  875. ifdef NEED_FIPS186_2_PRF
  876. OBJS += ../src/crypto/fips_prf_openssl.o
  877. endif
  878. LIBS += -lcrypto
  879. LIBS_p += -lcrypto
  880. ifdef CONFIG_TLS_ADD_DL
  881. LIBS += -ldl
  882. LIBS_p += -ldl
  883. endif
  884. endif
  885. ifeq ($(CONFIG_TLS), gnutls)
  886. ifdef TLS_FUNCS
  887. OBJS += ../src/crypto/tls_gnutls.o
  888. LIBS += -lgnutls -lgpg-error
  889. endif
  890. OBJS += ../src/crypto/crypto_gnutls.o
  891. OBJS_p += ../src/crypto/crypto_gnutls.o
  892. OBJS_priv += ../src/crypto/crypto_gnutls.o
  893. ifdef NEED_FIPS186_2_PRF
  894. OBJS += ../src/crypto/fips_prf_internal.o
  895. SHA1OBJS += ../src/crypto/sha1-internal.o
  896. endif
  897. LIBS += -lgcrypt
  898. LIBS_p += -lgcrypt
  899. CONFIG_INTERNAL_SHA256=y
  900. CONFIG_INTERNAL_RC4=y
  901. CONFIG_INTERNAL_DH_GROUP5=y
  902. endif
  903. ifeq ($(CONFIG_TLS), internal)
  904. ifndef CONFIG_CRYPTO
  905. CONFIG_CRYPTO=internal
  906. endif
  907. ifdef TLS_FUNCS
  908. OBJS += ../src/crypto/crypto_internal-rsa.o
  909. OBJS += ../src/crypto/tls_internal.o
  910. OBJS += ../src/tls/tlsv1_common.o
  911. OBJS += ../src/tls/tlsv1_record.o
  912. OBJS += ../src/tls/tlsv1_cred.o
  913. OBJS += ../src/tls/tlsv1_client.o
  914. OBJS += ../src/tls/tlsv1_client_write.o
  915. OBJS += ../src/tls/tlsv1_client_read.o
  916. OBJS += ../src/tls/asn1.o
  917. OBJS += ../src/tls/rsa.o
  918. OBJS += ../src/tls/x509v3.o
  919. OBJS += ../src/tls/pkcs1.o
  920. OBJS += ../src/tls/pkcs5.o
  921. OBJS += ../src/tls/pkcs8.o
  922. NEED_SHA256=y
  923. NEED_BASE64=y
  924. NEED_TLS_PRF=y
  925. ifdef CONFIG_TLSV12
  926. NEED_TLS_PRF_SHA256=y
  927. endif
  928. NEED_MODEXP=y
  929. NEED_CIPHER=y
  930. CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
  931. endif
  932. ifdef NEED_CIPHER
  933. NEED_DES=y
  934. OBJS += ../src/crypto/crypto_internal-cipher.o
  935. endif
  936. ifdef NEED_MODEXP
  937. OBJS += ../src/crypto/crypto_internal-modexp.o
  938. OBJS += ../src/tls/bignum.o
  939. endif
  940. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  941. OBJS += ../src/crypto/crypto_libtomcrypt.o
  942. OBJS_p += ../src/crypto/crypto_libtomcrypt.o
  943. LIBS += -ltomcrypt -ltfm
  944. LIBS_p += -ltomcrypt -ltfm
  945. CONFIG_INTERNAL_SHA256=y
  946. CONFIG_INTERNAL_RC4=y
  947. CONFIG_INTERNAL_DH_GROUP5=y
  948. endif
  949. ifeq ($(CONFIG_CRYPTO), internal)
  950. OBJS += ../src/crypto/crypto_internal.o
  951. OBJS_p += ../src/crypto/crypto_internal.o
  952. NEED_AES_ENC=y
  953. CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  954. ifdef CONFIG_INTERNAL_LIBTOMMATH
  955. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  956. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  957. CFLAGS += -DLTM_FAST
  958. endif
  959. else
  960. LIBS += -ltommath
  961. LIBS_p += -ltommath
  962. endif
  963. CONFIG_INTERNAL_AES=y
  964. CONFIG_INTERNAL_DES=y
  965. CONFIG_INTERNAL_SHA1=y
  966. CONFIG_INTERNAL_MD4=y
  967. CONFIG_INTERNAL_MD5=y
  968. CONFIG_INTERNAL_SHA256=y
  969. CONFIG_INTERNAL_RC4=y
  970. CONFIG_INTERNAL_DH_GROUP5=y
  971. endif
  972. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  973. OBJS += ../src/crypto/crypto_cryptoapi.o
  974. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  975. CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  976. CONFIG_INTERNAL_SHA256=y
  977. CONFIG_INTERNAL_RC4=y
  978. endif
  979. endif
  980. ifeq ($(CONFIG_TLS), none)
  981. ifdef TLS_FUNCS
  982. OBJS += ../src/crypto/tls_none.o
  983. CFLAGS += -DEAP_TLS_NONE
  984. CONFIG_INTERNAL_AES=y
  985. CONFIG_INTERNAL_SHA1=y
  986. CONFIG_INTERNAL_MD5=y
  987. endif
  988. OBJS += ../src/crypto/crypto_none.o
  989. OBJS_p += ../src/crypto/crypto_none.o
  990. CONFIG_INTERNAL_SHA256=y
  991. CONFIG_INTERNAL_RC4=y
  992. endif
  993. ifdef TLS_FUNCS
  994. ifdef CONFIG_SMARTCARD
  995. ifndef CONFIG_NATIVE_WINDOWS
  996. ifneq ($(CONFIG_L2_PACKET), freebsd)
  997. LIBS += -ldl
  998. endif
  999. endif
  1000. endif
  1001. endif
  1002. ifndef TLS_FUNCS
  1003. OBJS += ../src/crypto/tls_none.o
  1004. ifeq ($(CONFIG_TLS), internal)
  1005. CONFIG_INTERNAL_AES=y
  1006. CONFIG_INTERNAL_SHA1=y
  1007. CONFIG_INTERNAL_MD5=y
  1008. CONFIG_INTERNAL_RC4=y
  1009. endif
  1010. endif
  1011. AESOBJS = # none so far (see below)
  1012. ifdef CONFIG_INTERNAL_AES
  1013. AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-dec.o
  1014. endif
  1015. ifneq ($(CONFIG_TLS), openssl)
  1016. AESOBJS += ../src/crypto/aes-unwrap.o
  1017. endif
  1018. ifdef NEED_AES_EAX
  1019. AESOBJS += ../src/crypto/aes-eax.o
  1020. NEED_AES_CTR=y
  1021. endif
  1022. ifdef NEED_AES_CTR
  1023. AESOBJS += ../src/crypto/aes-ctr.o
  1024. endif
  1025. ifdef NEED_AES_ENCBLOCK
  1026. AESOBJS += ../src/crypto/aes-encblock.o
  1027. endif
  1028. ifdef NEED_AES_OMAC1
  1029. NEED_AES_ENC=y
  1030. ifdef CONFIG_OPENSSL_CMAC
  1031. CFLAGS += -DCONFIG_OPENSSL_CMAC
  1032. else
  1033. AESOBJS += ../src/crypto/aes-omac1.o
  1034. endif
  1035. endif
  1036. ifdef NEED_AES_SIV
  1037. AESOBJS += ../src/crypto/aes-siv.o
  1038. endif
  1039. ifdef NEED_AES_WRAP
  1040. NEED_AES_ENC=y
  1041. ifneq ($(CONFIG_TLS), openssl)
  1042. AESOBJS += ../src/crypto/aes-wrap.o
  1043. endif
  1044. endif
  1045. ifdef NEED_AES_CBC
  1046. NEED_AES_ENC=y
  1047. ifneq ($(CONFIG_TLS), openssl)
  1048. AESOBJS += ../src/crypto/aes-cbc.o
  1049. endif
  1050. endif
  1051. ifdef NEED_AES_ENC
  1052. ifdef CONFIG_INTERNAL_AES
  1053. AESOBJS += ../src/crypto/aes-internal-enc.o
  1054. endif
  1055. endif
  1056. ifdef NEED_AES
  1057. OBJS += $(AESOBJS)
  1058. endif
  1059. ifdef NEED_SHA1
  1060. ifneq ($(CONFIG_TLS), openssl)
  1061. SHA1OBJS += ../src/crypto/sha1.o
  1062. endif
  1063. SHA1OBJS += ../src/crypto/sha1-prf.o
  1064. ifdef CONFIG_INTERNAL_SHA1
  1065. SHA1OBJS += ../src/crypto/sha1-internal.o
  1066. ifdef NEED_FIPS186_2_PRF
  1067. SHA1OBJS += ../src/crypto/fips_prf_internal.o
  1068. endif
  1069. endif
  1070. ifdef CONFIG_NO_WPA_PASSPHRASE
  1071. CFLAGS += -DCONFIG_NO_PBKDF2
  1072. else
  1073. ifneq ($(CONFIG_TLS), openssl)
  1074. SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
  1075. endif
  1076. endif
  1077. ifdef NEED_T_PRF
  1078. SHA1OBJS += ../src/crypto/sha1-tprf.o
  1079. endif
  1080. ifdef NEED_TLS_PRF
  1081. SHA1OBJS += ../src/crypto/sha1-tlsprf.o
  1082. endif
  1083. endif
  1084. ifndef CONFIG_FIPS
  1085. ifneq ($(CONFIG_TLS), openssl)
  1086. MD5OBJS += ../src/crypto/md5.o
  1087. endif
  1088. endif
  1089. ifdef NEED_MD5
  1090. ifdef CONFIG_INTERNAL_MD5
  1091. MD5OBJS += ../src/crypto/md5-internal.o
  1092. endif
  1093. OBJS += $(MD5OBJS)
  1094. OBJS_p += $(MD5OBJS)
  1095. OBJS_priv += $(MD5OBJS)
  1096. endif
  1097. ifdef NEED_MD4
  1098. ifdef CONFIG_INTERNAL_MD4
  1099. OBJS += ../src/crypto/md4-internal.o
  1100. endif
  1101. endif
  1102. DESOBJS = # none needed when not internal
  1103. ifdef NEED_DES
  1104. ifdef CONFIG_INTERNAL_DES
  1105. DESOBJS += ../src/crypto/des-internal.o
  1106. endif
  1107. endif
  1108. ifdef NEED_RC4
  1109. ifdef CONFIG_INTERNAL_RC4
  1110. OBJS += ../src/crypto/rc4.o
  1111. endif
  1112. endif
  1113. SHA256OBJS = # none by default
  1114. ifdef NEED_SHA256
  1115. CFLAGS += -DCONFIG_SHA256
  1116. ifneq ($(CONFIG_TLS), openssl)
  1117. SHA256OBJS += ../src/crypto/sha256.o
  1118. endif
  1119. SHA256OBJS += ../src/crypto/sha256-prf.o
  1120. ifdef CONFIG_INTERNAL_SHA256
  1121. SHA256OBJS += ../src/crypto/sha256-internal.o
  1122. endif
  1123. ifdef NEED_TLS_PRF_SHA256
  1124. SHA256OBJS += ../src/crypto/sha256-tlsprf.o
  1125. endif
  1126. ifdef NEED_HMAC_SHA256_KDF
  1127. OBJS += ../src/crypto/sha256-kdf.o
  1128. endif
  1129. OBJS += $(SHA256OBJS)
  1130. endif
  1131. ifdef NEED_SHA384
  1132. CFLAGS += -DCONFIG_SHA384
  1133. endif
  1134. ifdef NEED_DH_GROUPS
  1135. OBJS += ../src/crypto/dh_groups.o
  1136. endif
  1137. ifdef NEED_DH_GROUPS_ALL
  1138. CFLAGS += -DALL_DH_GROUPS
  1139. endif
  1140. ifdef CONFIG_INTERNAL_DH_GROUP5
  1141. ifdef NEED_DH_GROUPS
  1142. OBJS += ../src/crypto/dh_group5.o
  1143. endif
  1144. endif
  1145. ifdef NEED_ECC
  1146. CFLAGS += -DCONFIG_ECC
  1147. endif
  1148. ifdef CONFIG_NO_RANDOM_POOL
  1149. CFLAGS += -DCONFIG_NO_RANDOM_POOL
  1150. else
  1151. OBJS += ../src/crypto/random.o
  1152. endif
  1153. ifdef CONFIG_CTRL_IFACE
  1154. ifeq ($(CONFIG_CTRL_IFACE), y)
  1155. ifdef CONFIG_NATIVE_WINDOWS
  1156. CONFIG_CTRL_IFACE=named_pipe
  1157. else
  1158. CONFIG_CTRL_IFACE=unix
  1159. endif
  1160. endif
  1161. CFLAGS += -DCONFIG_CTRL_IFACE
  1162. ifeq ($(CONFIG_CTRL_IFACE), unix)
  1163. CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
  1164. endif
  1165. ifeq ($(CONFIG_CTRL_IFACE), udp)
  1166. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1167. endif
  1168. ifeq ($(CONFIG_CTRL_IFACE), udp6)
  1169. CONFIG_CTRL_IFACE=udp
  1170. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1171. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
  1172. endif
  1173. ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
  1174. CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
  1175. endif
  1176. ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
  1177. CONFIG_CTRL_IFACE=udp
  1178. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1179. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  1180. endif
  1181. ifeq ($(CONFIG_CTRL_IFACE), udp6-remote)
  1182. CONFIG_CTRL_IFACE=udp
  1183. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1184. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  1185. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
  1186. endif
  1187. OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o
  1188. endif
  1189. ifdef CONFIG_CTRL_IFACE_DBUS
  1190. DBUS=y
  1191. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
  1192. DBUS_OBJS += dbus/dbus_old.o dbus/dbus_old_handlers.o
  1193. ifdef CONFIG_WPS
  1194. DBUS_OBJS += dbus/dbus_old_handlers_wps.o
  1195. endif
  1196. DBUS_OBJS += dbus/dbus_dict_helpers.o
  1197. ifndef DBUS_LIBS
  1198. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1199. endif
  1200. ifndef DBUS_INCLUDE
  1201. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1202. endif
  1203. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1204. endif
  1205. ifdef CONFIG_CTRL_IFACE_DBUS_NEW
  1206. DBUS=y
  1207. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
  1208. DBUS_OBJS ?= dbus/dbus_dict_helpers.o
  1209. DBUS_OBJS += dbus/dbus_new_helpers.o
  1210. DBUS_OBJS += dbus/dbus_new.o dbus/dbus_new_handlers.o
  1211. ifdef CONFIG_WPS
  1212. DBUS_OBJS += dbus/dbus_new_handlers_wps.o
  1213. endif
  1214. ifdef CONFIG_P2P
  1215. DBUS_OBJS += dbus/dbus_new_handlers_p2p.o
  1216. endif
  1217. ifndef DBUS_LIBS
  1218. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1219. endif
  1220. ifndef DBUS_INCLUDE
  1221. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1222. endif
  1223. ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
  1224. DBUS_OBJS += dbus/dbus_new_introspect.o
  1225. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
  1226. endif
  1227. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1228. endif
  1229. ifdef DBUS
  1230. DBUS_CFLAGS += -DCONFIG_DBUS
  1231. DBUS_OBJS += dbus/dbus_common.o
  1232. endif
  1233. OBJS += $(DBUS_OBJS)
  1234. CFLAGS += $(DBUS_CFLAGS)
  1235. LIBS += $(DBUS_LIBS)
  1236. ifdef CONFIG_READLINE
  1237. OBJS_c += ../src/utils/edit_readline.o
  1238. LIBS_c += -lncurses -lreadline
  1239. else
  1240. ifdef CONFIG_WPA_CLI_EDIT
  1241. OBJS_c += ../src/utils/edit.o
  1242. else
  1243. OBJS_c += ../src/utils/edit_simple.o
  1244. endif
  1245. endif
  1246. ifdef CONFIG_NATIVE_WINDOWS
  1247. CFLAGS += -DCONFIG_NATIVE_WINDOWS
  1248. LIBS += -lws2_32 -lgdi32 -lcrypt32
  1249. LIBS_c += -lws2_32
  1250. LIBS_p += -lws2_32 -lgdi32
  1251. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  1252. LIBS_p += -lcrypt32
  1253. endif
  1254. endif
  1255. ifdef CONFIG_NO_STDOUT_DEBUG
  1256. CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  1257. ifndef CONFIG_CTRL_IFACE
  1258. CFLAGS += -DCONFIG_NO_WPA_MSG
  1259. endif
  1260. endif
  1261. ifdef CONFIG_IPV6
  1262. # for eapol_test only
  1263. CFLAGS += -DCONFIG_IPV6
  1264. endif
  1265. ifdef NEED_BASE64
  1266. OBJS += ../src/utils/base64.o
  1267. endif
  1268. ifdef NEED_SME
  1269. OBJS += sme.o
  1270. CFLAGS += -DCONFIG_SME
  1271. endif
  1272. OBJS += ../src/common/ieee802_11_common.o
  1273. OBJS += ../src/common/hw_features_common.o
  1274. ifdef NEED_EAP_COMMON
  1275. OBJS += ../src/eap_common/eap_common.o
  1276. endif
  1277. ifndef CONFIG_MAIN
  1278. CONFIG_MAIN=main
  1279. endif
  1280. ifdef CONFIG_DEBUG_SYSLOG
  1281. CFLAGS += -DCONFIG_DEBUG_SYSLOG
  1282. ifdef CONFIG_DEBUG_SYSLOG_FACILITY
  1283. CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
  1284. endif
  1285. endif
  1286. ifdef CONFIG_DEBUG_LINUX_TRACING
  1287. CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
  1288. endif
  1289. ifdef CONFIG_DEBUG_FILE
  1290. CFLAGS += -DCONFIG_DEBUG_FILE
  1291. endif
  1292. ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
  1293. CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
  1294. endif
  1295. ifdef CONFIG_FIPS
  1296. CFLAGS += -DCONFIG_FIPS
  1297. ifneq ($(CONFIG_TLS), openssl)
  1298. $(error CONFIG_FIPS=y requires CONFIG_TLS=openssl)
  1299. endif
  1300. endif
  1301. OBJS += $(SHA1OBJS) $(DESOBJS)
  1302. OBJS_p += $(SHA1OBJS)
  1303. OBJS_p += $(SHA256OBJS)
  1304. OBJS_priv += $(SHA1OBJS)
  1305. ifdef CONFIG_BGSCAN_SIMPLE
  1306. CFLAGS += -DCONFIG_BGSCAN_SIMPLE
  1307. OBJS += bgscan_simple.o
  1308. NEED_BGSCAN=y
  1309. endif
  1310. ifdef CONFIG_BGSCAN_LEARN
  1311. CFLAGS += -DCONFIG_BGSCAN_LEARN
  1312. OBJS += bgscan_learn.o
  1313. NEED_BGSCAN=y
  1314. endif
  1315. ifdef NEED_BGSCAN
  1316. CFLAGS += -DCONFIG_BGSCAN
  1317. OBJS += bgscan.o
  1318. endif
  1319. ifdef CONFIG_AUTOSCAN_EXPONENTIAL
  1320. CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL
  1321. OBJS += autoscan_exponential.o
  1322. NEED_AUTOSCAN=y
  1323. endif
  1324. ifdef CONFIG_AUTOSCAN_PERIODIC
  1325. CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC
  1326. OBJS += autoscan_periodic.o
  1327. NEED_AUTOSCAN=y
  1328. endif
  1329. ifdef NEED_AUTOSCAN
  1330. CFLAGS += -DCONFIG_AUTOSCAN
  1331. OBJS += autoscan.o
  1332. endif
  1333. ifdef CONFIG_EXT_PASSWORD_TEST
  1334. OBJS += ../src/utils/ext_password_test.o
  1335. CFLAGS += -DCONFIG_EXT_PASSWORD_TEST
  1336. NEED_EXT_PASSWORD=y
  1337. endif
  1338. ifdef NEED_EXT_PASSWORD
  1339. OBJS += ../src/utils/ext_password.o
  1340. CFLAGS += -DCONFIG_EXT_PASSWORD
  1341. endif
  1342. ifdef NEED_GAS
  1343. OBJS += ../src/common/gas.o
  1344. OBJS += gas_query.o
  1345. CFLAGS += -DCONFIG_GAS
  1346. NEED_OFFCHANNEL=y
  1347. endif
  1348. ifdef NEED_OFFCHANNEL
  1349. OBJS += offchannel.o
  1350. CFLAGS += -DCONFIG_OFFCHANNEL
  1351. endif
  1352. ifdef CONFIG_MODULE_TESTS
  1353. CFLAGS += -DCONFIG_MODULE_TESTS
  1354. OBJS += wpas_module_tests.o
  1355. OBJS += ../src/utils/utils_module_tests.o
  1356. OBJS += ../src/common/common_module_tests.o
  1357. OBJS += ../src/crypto/crypto_module_tests.o
  1358. ifdef CONFIG_WPS
  1359. OBJS += ../src/wps/wps_module_tests.o
  1360. endif
  1361. ifndef CONFIG_P2P
  1362. OBJS += ../src/utils/bitfield.o
  1363. endif
  1364. endif
  1365. OBJS += ../src/drivers/driver_common.o
  1366. OBJS_priv += ../src/drivers/driver_common.o
  1367. OBJS_wpa_rm := ctrl_iface.o ctrl_iface_unix.o
  1368. OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.o
  1369. ifdef CONFIG_AUTHENTICATOR
  1370. OBJS_wpa += tests/link_test.o
  1371. endif
  1372. OBJS_wpa += $(OBJS_l2)
  1373. OBJS += wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o
  1374. OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o
  1375. OBJS_t += ../src/radius/radius_client.o
  1376. OBJS_t += ../src/radius/radius.o
  1377. ifndef CONFIG_AP
  1378. OBJS_t += ../src/utils/ip_addr.o
  1379. endif
  1380. OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o
  1381. OBJS_nfc := $(OBJS) $(OBJS_l2) nfc_pw_token.o
  1382. OBJS_nfc += $(OBJS_d) ../src/drivers/drivers.o
  1383. OBJS += $(CONFIG_MAIN).o
  1384. ifdef CONFIG_PRIVSEP
  1385. OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o
  1386. OBJS_priv += $(OBJS_l2)
  1387. OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
  1388. OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
  1389. OBJS_priv += ../src/utils/common.o
  1390. OBJS_priv += ../src/utils/wpa_debug.o
  1391. OBJS_priv += ../src/utils/wpabuf.o
  1392. OBJS_priv += wpa_priv.o
  1393. ifdef CONFIG_DRIVER_NL80211
  1394. OBJS_priv += ../src/common/ieee802_11_common.o
  1395. endif
  1396. OBJS += ../src/l2_packet/l2_packet_privsep.o
  1397. OBJS += ../src/drivers/driver_privsep.o
  1398. EXTRA_progs += wpa_priv
  1399. else
  1400. OBJS += $(OBJS_d) ../src/drivers/drivers.o
  1401. OBJS += $(OBJS_l2)
  1402. endif
  1403. ifdef CONFIG_NDIS_EVENTS_INTEGRATED
  1404. CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
  1405. OBJS += ../src/drivers/ndis_events.o
  1406. EXTRALIBS += -loleaut32 -lole32 -luuid
  1407. ifdef PLATFORMSDKLIB
  1408. EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
  1409. else
  1410. EXTRALIBS += WbemUuid.Lib
  1411. endif
  1412. endif
  1413. ifndef LDO
  1414. LDO=$(CC)
  1415. endif
  1416. Q=@
  1417. E=echo
  1418. ifeq ($(V), 1)
  1419. Q=
  1420. E=true
  1421. endif
  1422. ifeq ($(QUIET), 1)
  1423. Q=@
  1424. E=true
  1425. endif
  1426. dynamic_eap_methods: $(EAPDYN)
  1427. ../src/drivers/build.wpa_supplicant:
  1428. @if [ -f ../src/drivers/build.hostapd ]; then \
  1429. $(MAKE) -C ../src/drivers clean; \
  1430. fi
  1431. @touch ../src/drivers/build.wpa_supplicant
  1432. BCHECK=../src/drivers/build.wpa_supplicant
  1433. wpa_priv: $(BCHECK) $(OBJS_priv)
  1434. $(Q)$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
  1435. @$(E) " LD " $@
  1436. $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
  1437. wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
  1438. $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
  1439. @$(E) " LD " $@
  1440. eapol_test: $(OBJS_t)
  1441. $(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
  1442. @$(E) " LD " $@
  1443. preauth_test: $(OBJS_t2)
  1444. $(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
  1445. @$(E) " LD " $@
  1446. wpa_passphrase: $(OBJS_p)
  1447. $(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p)
  1448. @$(E) " LD " $@
  1449. wpa_cli: $(OBJS_c)
  1450. $(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
  1451. @$(E) " LD " $@
  1452. LIBCTRL += ../src/common/wpa_ctrl.o
  1453. LIBCTRL += ../src/utils/os_$(CONFIG_OS).o
  1454. LIBCTRL += ../src/utils/wpa_debug.o
  1455. libwpa_ctrl.a: $(LIBCTRL)
  1456. $(Q)rm -f $@
  1457. $(Q)$(AR) crs $@ $?
  1458. @$(E) " AR " $@
  1459. link_test: $(OBJS) $(OBJS_h) tests/link_test.o
  1460. $(Q)$(LDO) $(LDFLAGS) -o link_test $(OBJS) $(OBJS_h) tests/link_test.o $(LIBS)
  1461. @$(E) " LD " $@
  1462. test_wpa: $(OBJS_wpa) $(OBJS_h)
  1463. $(Q)$(LDO) $(LDFLAGS) -o test_wpa $(OBJS_wpa) $(LIBS)
  1464. @$(E) " LD " $@
  1465. nfc_pw_token: $(OBJS_nfc)
  1466. $(Q)$(LDO) $(LDFLAGS) -o nfc_pw_token $(OBJS_nfc) $(LIBS)
  1467. @$(E) " LD " $@
  1468. win_if_list: win_if_list.c
  1469. $(Q)$(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
  1470. @$(E) " LD " $@
  1471. eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c
  1472. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1473. -Deap_peer_psk_register=eap_peer_method_dynamic_init
  1474. eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c
  1475. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1476. -Deap_peer_pax_register=eap_peer_method_dynamic_init
  1477. eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c
  1478. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1479. -Deap_peer_sake_register=eap_peer_method_dynamic_init
  1480. eap_wsc.so: ../src/eap_peer/eap_wsc.c ../src/eap_common/eap_wsc_common.c ../src/wps/wps.c
  1481. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1482. -Deap_peer_wsc_register=eap_peer_method_dynamic_init
  1483. eap_ikev2.so: ../src/eap_peer/eap_ikev2.c ../src/eap_peer/ikev2.c ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.c
  1484. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1485. -Deap_peer_ikev2_register=eap_peer_method_dynamic_init
  1486. eap_eke.so: ../src/eap_peer/eap_eke.c ../src/eap_common/eap_eke_common.c
  1487. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1488. -Deap_peer_eke_register=eap_peer_method_dynamic_init
  1489. %.so: %.c
  1490. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
  1491. -D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
  1492. ifdef CONFIG_CODE_COVERAGE
  1493. %.o: %.c
  1494. @$(E) " CC " $<
  1495. $(Q)cd $(dir $@); $(CC) -c -o $(notdir $@) $(CFLAGS) $(notdir $<)
  1496. else
  1497. %.o: %.c
  1498. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  1499. @$(E) " CC " $<
  1500. endif
  1501. %.service: %.service.in
  1502. $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
  1503. @$(E) " sed" $<
  1504. %@.service: %.service.arg.in
  1505. $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
  1506. @$(E) " sed" $<
  1507. wpa_supplicant.exe: wpa_supplicant
  1508. mv -f $< $@
  1509. wpa_cli.exe: wpa_cli
  1510. mv -f $< $@
  1511. wpa_passphrase.exe: wpa_passphrase
  1512. mv -f $< $@
  1513. win_if_list.exe: win_if_list
  1514. mv -f $< $@
  1515. eapol_test.exe: eapol_test
  1516. mv -f $< $@
  1517. WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe
  1518. windows-bin: $(WINALL)
  1519. $(STRIP) $(WINALL)
  1520. wpa_gui:
  1521. @echo "wpa_gui has been removed - see wpa_gui-qt4 for replacement"
  1522. wpa_gui-qt4/Makefile:
  1523. qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro
  1524. wpa_gui-qt4/lang/wpa_gui_de.qm: wpa_gui-qt4/lang/wpa_gui_de.ts
  1525. lrelease wpa_gui-qt4/wpa_gui.pro
  1526. wpa_gui-qt4: wpa_gui-qt4/Makefile wpa_gui-qt4/lang/wpa_gui_de.qm
  1527. $(MAKE) -C wpa_gui-qt4
  1528. TEST_EAP_SIM_COMMON_OBJS = $(SHA1OBJS) $(MD5OBJS) \
  1529. ../src/utils/common.o ../src/utils/os_unix.o \
  1530. ../src/utils/wpa_debug.o $(AESOBJS) \
  1531. tests/test_eap_sim_common.o
  1532. test-eap_sim_common: $(TEST_EAP_SIM_COMMON_OBJS)
  1533. $(LDO) $(LDFLAGS) -o $@ $(TEST_EAP_SIM_COMMON_OBJS) $(LIBS)
  1534. ./test-eap_sim_common
  1535. rm test-eap_sim_common
  1536. tests: test-eap_sim_common
  1537. FIPSDIR=/usr/local/ssl/fips-2.0
  1538. FIPSLD=$(FIPSDIR)/bin/fipsld
  1539. fips:
  1540. $(MAKE) CC=$(FIPSLD) FIPSLD_CC="$(CC)"
  1541. lcov-html: wpa_supplicant.gcda
  1542. lcov -c -d .. > lcov.info
  1543. genhtml lcov.info --output-directory lcov-html
  1544. clean:
  1545. $(MAKE) -C ../src clean
  1546. $(MAKE) -C dbus clean
  1547. rm -f core *~ *.o *.d *.gcno *.gcda *.gcov
  1548. rm -f eap_*.so $(ALL) $(WINALL) eapol_test preauth_test
  1549. rm -f wpa_priv
  1550. rm -f nfc_pw_token
  1551. rm -f lcov.info
  1552. rm -rf lcov-html
  1553. rm -f libwpa_ctrl.a
  1554. -include $(OBJS:%.o=%.d)