Makefile 39 KB

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