Makefile 39 KB

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