Makefile 39 KB

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