Makefile 33 KB

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