Makefile 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166
  1. ifndef CC
  2. CC=gcc
  3. endif
  4. ifndef CFLAGS
  5. CFLAGS = -MMD -O2 -Wall -g
  6. endif
  7. CFLAGS += -I../src
  8. CFLAGS += -I../src/crypto
  9. CFLAGS += -I../src/utils
  10. CFLAGS += -I../src/common
  11. CFLAGS += -I../src/rsn_supp
  12. ALL=wpa_supplicant wpa_passphrase wpa_cli
  13. all: verify_config $(ALL) dynamic_eap_methods
  14. verify_config:
  15. @if [ ! -r .config ]; then \
  16. echo 'Building wpa_supplicant requires a configuration file'; \
  17. echo '(.config). See README for more instructions. You can'; \
  18. echo 'run "cp defconfig .config" to create an example'; \
  19. echo 'configuration.'; \
  20. exit 1; \
  21. fi
  22. mkconfig:
  23. @if [ -e .config ]; then \
  24. echo '.config exists - did not replace it'; \
  25. exit 1; \
  26. fi
  27. echo CONFIG_DRIVER_HOSTAP=y >> .config
  28. echo CONFIG_DRIVER_WEXT=y >> .config
  29. echo CONFIG_WIRELESS_EXTENSION=y >> .config
  30. install: all
  31. mkdir -p $(DESTDIR)/usr/local/sbin/
  32. for i in $(ALL); do cp $$i $(DESTDIR)/usr/local/sbin/$$i; done
  33. OBJS = config.o
  34. OBJS += ../src/utils/common.o
  35. OBJS += ../src/utils/wpa_debug.o
  36. OBJS += ../src/utils/wpabuf.o
  37. OBJS += ../src/crypto/md5.o
  38. OBJS += ../src/crypto/rc4.o
  39. OBJS += ../src/crypto/md4.o
  40. OBJS += ../src/crypto/sha1.o
  41. OBJS += ../src/crypto/des.o
  42. OBJS_p = wpa_passphrase.o
  43. OBJS_p += ../src/utils/common.o
  44. OBJS_p += ../src/utils/wpa_debug.o
  45. OBJS_p += ../src/crypto/md5.o
  46. OBJS_p += ../src/crypto/md4.o
  47. OBJS_p += ../src/crypto/sha1.o
  48. OBJS_p += ../src/crypto/des.o
  49. OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
  50. -include .config
  51. ifndef CONFIG_OS
  52. ifdef CONFIG_NATIVE_WINDOWS
  53. CONFIG_OS=win32
  54. else
  55. CONFIG_OS=unix
  56. endif
  57. endif
  58. ifeq ($(CONFIG_OS), internal)
  59. CFLAGS += -DOS_NO_C_LIB_DEFINES
  60. endif
  61. OBJS += ../src/utils/os_$(CONFIG_OS).o
  62. OBJS_p += ../src/utils/os_$(CONFIG_OS).o
  63. OBJS_c += ../src/utils/os_$(CONFIG_OS).o
  64. ifndef CONFIG_ELOOP
  65. CONFIG_ELOOP=eloop
  66. endif
  67. OBJS += ../src/utils/$(CONFIG_ELOOP).o
  68. ifdef CONFIG_EAPOL_TEST
  69. CFLAGS += -Werror -DEAPOL_TEST
  70. endif
  71. ifndef CONFIG_BACKEND
  72. CONFIG_BACKEND=file
  73. endif
  74. ifeq ($(CONFIG_BACKEND), file)
  75. OBJS += config_file.o
  76. ifndef CONFIG_NO_CONFIG_BLOBS
  77. NEED_BASE64=y
  78. endif
  79. CFLAGS += -DCONFIG_BACKEND_FILE
  80. endif
  81. ifeq ($(CONFIG_BACKEND), winreg)
  82. OBJS += config_winreg.o
  83. endif
  84. ifeq ($(CONFIG_BACKEND), none)
  85. OBJS += config_none.o
  86. endif
  87. ifdef CONFIG_NO_CONFIG_WRITE
  88. CFLAGS += -DCONFIG_NO_CONFIG_WRITE
  89. endif
  90. ifdef CONFIG_NO_CONFIG_BLOBS
  91. CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
  92. endif
  93. ifdef CONFIG_NO_SCAN_PROCESSING
  94. CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
  95. endif
  96. ifdef CONFIG_DRIVER_HOSTAP
  97. CFLAGS += -DCONFIG_DRIVER_HOSTAP
  98. OBJS_d += ../src/drivers/driver_hostap.o
  99. CONFIG_WIRELESS_EXTENSION=y
  100. endif
  101. ifdef CONFIG_DRIVER_WEXT
  102. CFLAGS += -DCONFIG_DRIVER_WEXT
  103. CONFIG_WIRELESS_EXTENSION=y
  104. endif
  105. ifdef CONFIG_DRIVER_PRISM54
  106. CFLAGS += -DCONFIG_DRIVER_PRISM54
  107. OBJS_d += ../src/drivers/driver_prism54.o
  108. CONFIG_WIRELESS_EXTENSION=y
  109. endif
  110. ifdef CONFIG_DRIVER_HERMES
  111. CFLAGS += -DCONFIG_DRIVER_HERMES
  112. OBJS_d += ../src/drivers/driver_hermes.o
  113. CONFIG_WIRELESS_EXTENSION=y
  114. endif
  115. ifdef CONFIG_DRIVER_MADWIFI
  116. CFLAGS += -DCONFIG_DRIVER_MADWIFI
  117. OBJS_d += ../src/drivers/driver_madwifi.o
  118. CONFIG_WIRELESS_EXTENSION=y
  119. endif
  120. ifdef CONFIG_DRIVER_ATMEL
  121. CFLAGS += -DCONFIG_DRIVER_ATMEL
  122. OBJS_d += ../src/drivers/driver_atmel.o
  123. CONFIG_WIRELESS_EXTENSION=y
  124. endif
  125. ifdef CONFIG_DRIVER_NDISWRAPPER
  126. CFLAGS += -DCONFIG_DRIVER_NDISWRAPPER
  127. OBJS_d += ../src/drivers/driver_ndiswrapper.o
  128. CONFIG_WIRELESS_EXTENSION=y
  129. endif
  130. ifdef CONFIG_DRIVER_RALINK
  131. CFLAGS += -DCONFIG_DRIVER_RALINK
  132. OBJS_d += ../src/drivers/driver_ralink.o
  133. endif
  134. ifdef CONFIG_DRIVER_BROADCOM
  135. CFLAGS += -DCONFIG_DRIVER_BROADCOM
  136. OBJS_d += ../src/drivers/driver_broadcom.o
  137. endif
  138. ifdef CONFIG_DRIVER_IPW
  139. CFLAGS += -DCONFIG_DRIVER_IPW
  140. OBJS_d += ../src/drivers/driver_ipw.o
  141. CONFIG_WIRELESS_EXTENSION=y
  142. endif
  143. ifdef CONFIG_DRIVER_BSD
  144. CFLAGS += -DCONFIG_DRIVER_BSD
  145. OBJS_d += ../src/drivers/driver_bsd.o
  146. ifndef CONFIG_L2_PACKET
  147. CONFIG_L2_PACKET=freebsd
  148. endif
  149. endif
  150. ifdef CONFIG_DRIVER_NDIS
  151. CFLAGS += -DCONFIG_DRIVER_NDIS
  152. OBJS_d += ../src/drivers/driver_ndis.o ../src/drivers/driver_ndis_.o
  153. ifndef CONFIG_L2_PACKET
  154. CONFIG_L2_PACKET=pcap
  155. endif
  156. CONFIG_WINPCAP=y
  157. ifdef CONFIG_USE_NDISUIO
  158. CFLAGS += -DCONFIG_USE_NDISUIO
  159. endif
  160. endif
  161. ifdef CONFIG_DRIVER_WIRED
  162. CFLAGS += -DCONFIG_DRIVER_WIRED
  163. OBJS_d += ../src/drivers/driver_wired.o
  164. endif
  165. ifdef CONFIG_DRIVER_TEST
  166. CFLAGS += -DCONFIG_DRIVER_TEST
  167. OBJS_d += ../src/drivers/driver_test.o
  168. endif
  169. ifdef CONFIG_DRIVER_OSX
  170. CFLAGS += -DCONFIG_DRIVER_OSX
  171. OBJS_d += ../src/drivers/driver_osx.o
  172. LDFLAGS += -framework CoreFoundation
  173. LDFLAGS += -F/System/Library/PrivateFrameworks -framework Apple80211
  174. endif
  175. ifdef CONFIG_DRIVER_PS3
  176. CFLAGS += -DCONFIG_DRIVER_PS3 -m64
  177. OBJS_d += ../src/drivers/driver_ps3.o
  178. LDFLAGS += -m64
  179. endif
  180. ifdef CONFIG_DRIVER_IPHONE
  181. CFLAGS += -DCONFIG_DRIVER_IPHONE
  182. OBJS_d += ../src/drivers/driver_iphone.o
  183. OBJS_d += ../src/drivers/MobileApple80211.o
  184. LIBS += -framework CoreFoundation
  185. endif
  186. ifndef CONFIG_L2_PACKET
  187. CONFIG_L2_PACKET=linux
  188. endif
  189. OBJS_l2 += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o
  190. ifeq ($(CONFIG_L2_PACKET), pcap)
  191. ifdef CONFIG_WINPCAP
  192. CFLAGS += -DCONFIG_WINPCAP
  193. LIBS += -lwpcap -lpacket
  194. LIBS_w += -lwpcap
  195. else
  196. LIBS += -ldnet -lpcap
  197. endif
  198. endif
  199. ifeq ($(CONFIG_L2_PACKET), winpcap)
  200. LIBS += -lwpcap -lpacket
  201. LIBS_w += -lwpcap
  202. endif
  203. ifeq ($(CONFIG_L2_PACKET), freebsd)
  204. LIBS += -lpcap
  205. endif
  206. ifdef CONFIG_EAP_TLS
  207. # EAP-TLS
  208. ifeq ($(CONFIG_EAP_TLS), dyn)
  209. CFLAGS += -DEAP_TLS_DYNAMIC
  210. EAPDYN += ../src/eap_peer/eap_tls.so
  211. else
  212. CFLAGS += -DEAP_TLS
  213. OBJS += ../src/eap_peer/eap_tls.o
  214. OBJS_h += ../src/eap_server/eap_tls.o
  215. endif
  216. TLS_FUNCS=y
  217. CONFIG_IEEE8021X_EAPOL=y
  218. endif
  219. ifdef CONFIG_EAP_PEAP
  220. # EAP-PEAP
  221. ifeq ($(CONFIG_EAP_PEAP), dyn)
  222. CFLAGS += -DEAP_PEAP_DYNAMIC
  223. EAPDYN += ../src/eap_peer/eap_peap.so
  224. else
  225. CFLAGS += -DEAP_PEAP
  226. OBJS += ../src/eap_peer/eap_peap.o
  227. OBJS_h += ../src/eap_server/eap_peap.o
  228. endif
  229. TLS_FUNCS=y
  230. CONFIG_IEEE8021X_EAPOL=y
  231. CONFIG_EAP_TLV=y
  232. endif
  233. ifdef CONFIG_EAP_TTLS
  234. # EAP-TTLS
  235. ifeq ($(CONFIG_EAP_TTLS), dyn)
  236. CFLAGS += -DEAP_TTLS_DYNAMIC
  237. EAPDYN += ../src/eap_peer/eap_ttls.so
  238. else
  239. CFLAGS += -DEAP_TTLS
  240. OBJS += ../src/eap_peer/eap_ttls.o
  241. OBJS_h += ../src/eap_server/eap_ttls.o
  242. endif
  243. MS_FUNCS=y
  244. TLS_FUNCS=y
  245. CHAP=y
  246. CONFIG_IEEE8021X_EAPOL=y
  247. endif
  248. ifdef CONFIG_EAP_MD5
  249. # EAP-MD5
  250. ifeq ($(CONFIG_EAP_MD5), dyn)
  251. CFLAGS += -DEAP_MD5_DYNAMIC
  252. EAPDYN += ../src/eap_peer/eap_md5.so
  253. else
  254. CFLAGS += -DEAP_MD5
  255. OBJS += ../src/eap_peer/eap_md5.o
  256. OBJS_h += ../src/eap_server/eap_md5.o
  257. endif
  258. CHAP=y
  259. CONFIG_IEEE8021X_EAPOL=y
  260. endif
  261. # backwards compatibility for old spelling
  262. ifdef CONFIG_MSCHAPV2
  263. ifndef CONFIG_EAP_MSCHAPV2
  264. CONFIG_EAP_MSCHAPV2=y
  265. endif
  266. endif
  267. ifdef CONFIG_EAP_MSCHAPV2
  268. # EAP-MSCHAPv2
  269. ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
  270. CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
  271. EAPDYN += ../src/eap_peer/eap_mschapv2.so
  272. EAPDYN += ../src/eap_peer/mschapv2.so
  273. else
  274. CFLAGS += -DEAP_MSCHAPv2
  275. OBJS += ../src/eap_peer/eap_mschapv2.o
  276. OBJS += ../src/eap_peer/mschapv2.o
  277. OBJS_h += ../src/eap_server/eap_mschapv2.o
  278. endif
  279. MS_FUNCS=y
  280. CONFIG_IEEE8021X_EAPOL=y
  281. endif
  282. ifdef CONFIG_EAP_GTC
  283. # EAP-GTC
  284. ifeq ($(CONFIG_EAP_GTC), dyn)
  285. CFLAGS += -DEAP_GTC_DYNAMIC
  286. EAPDYN += ../src/eap_peer/eap_gtc.so
  287. else
  288. CFLAGS += -DEAP_GTC
  289. OBJS += ../src/eap_peer/eap_gtc.o
  290. OBJS_h += ../src/eap_server/eap_gtc.o
  291. endif
  292. CONFIG_IEEE8021X_EAPOL=y
  293. endif
  294. ifdef CONFIG_EAP_OTP
  295. # EAP-OTP
  296. ifeq ($(CONFIG_EAP_OTP), dyn)
  297. CFLAGS += -DEAP_OTP_DYNAMIC
  298. EAPDYN += ../src/eap_peer/eap_otp.so
  299. else
  300. CFLAGS += -DEAP_OTP
  301. OBJS += ../src/eap_peer/eap_otp.o
  302. endif
  303. CONFIG_IEEE8021X_EAPOL=y
  304. endif
  305. ifdef CONFIG_EAP_SIM
  306. # EAP-SIM
  307. ifeq ($(CONFIG_EAP_SIM), dyn)
  308. CFLAGS += -DEAP_SIM_DYNAMIC
  309. EAPDYN += ../src/eap_peer/eap_sim.so
  310. else
  311. CFLAGS += -DEAP_SIM
  312. OBJS += ../src/eap_peer/eap_sim.o
  313. OBJS_h += ../src/eap_server/eap_sim.o
  314. endif
  315. CONFIG_IEEE8021X_EAPOL=y
  316. CONFIG_EAP_SIM_COMMON=y
  317. endif
  318. ifdef CONFIG_EAP_LEAP
  319. # EAP-LEAP
  320. ifeq ($(CONFIG_EAP_LEAP), dyn)
  321. CFLAGS += -DEAP_LEAP_DYNAMIC
  322. EAPDYN += ../src/eap_peer/eap_leap.so
  323. else
  324. CFLAGS += -DEAP_LEAP
  325. OBJS += ../src/eap_peer/eap_leap.o
  326. endif
  327. MS_FUNCS=y
  328. CONFIG_IEEE8021X_EAPOL=y
  329. endif
  330. ifdef CONFIG_EAP_PSK
  331. # EAP-PSK
  332. ifeq ($(CONFIG_EAP_PSK), dyn)
  333. CFLAGS += -DEAP_PSK_DYNAMIC
  334. EAPDYN += ../src/eap_peer/eap_psk.so
  335. else
  336. CFLAGS += -DEAP_PSK
  337. OBJS += ../src/eap_peer/eap_psk.o ../src/eap_common/eap_psk_common.o
  338. OBJS_h += ../src/eap_server/eap_psk.o
  339. endif
  340. CONFIG_IEEE8021X_EAPOL=y
  341. NEED_AES=y
  342. endif
  343. ifdef CONFIG_EAP_AKA
  344. # EAP-AKA
  345. ifeq ($(CONFIG_EAP_AKA), dyn)
  346. CFLAGS += -DEAP_AKA_DYNAMIC
  347. EAPDYN += ../src/eap_peer/eap_aka.so
  348. else
  349. CFLAGS += -DEAP_AKA
  350. OBJS += ../src/eap_peer/eap_aka.o
  351. OBJS_h += ../src/eap_server/eap_aka.o
  352. endif
  353. CONFIG_IEEE8021X_EAPOL=y
  354. CONFIG_EAP_SIM_COMMON=y
  355. endif
  356. ifdef CONFIG_EAP_SIM_COMMON
  357. OBJS += ../src/eap_common/eap_sim_common.o
  358. OBJS_h += ../src/eap_server/eap_sim_db.o
  359. NEED_AES=y
  360. NEED_FIPS186_2_PRF=y
  361. endif
  362. ifdef CONFIG_EAP_TLV
  363. # EAP-TLV
  364. CFLAGS += -DEAP_TLV
  365. OBJS += ../src/eap_peer/eap_tlv.o
  366. OBJS_h += ../src/eap_server/eap_tlv.o
  367. endif
  368. ifdef CONFIG_EAP_FAST
  369. # EAP-FAST
  370. ifeq ($(CONFIG_EAP_FAST), dyn)
  371. CFLAGS += -DEAP_FAST_DYNAMIC
  372. EAPDYN += ../src/eap_peer/eap_fast.so
  373. EAPDYN += ../src/eap_common/eap_fast_common.o
  374. else
  375. CFLAGS += -DEAP_FAST
  376. OBJS += ../src/eap_peer/eap_fast.o ../src/eap_peer/eap_fast_pac.o
  377. OBJS += ../src/eap_common/eap_fast_common.o
  378. OBJS_h += ../src/eap_server/eap_fast.o
  379. endif
  380. TLS_FUNCS=y
  381. NEED_T_PRF=y
  382. endif
  383. ifdef CONFIG_EAP_PAX
  384. # EAP-PAX
  385. ifeq ($(CONFIG_EAP_PAX), dyn)
  386. CFLAGS += -DEAP_PAX_DYNAMIC
  387. EAPDYN += ../src/eap_peer/eap_pax.so
  388. else
  389. CFLAGS += -DEAP_PAX
  390. OBJS += ../src/eap_peer/eap_pax.o ../src/eap_common/eap_pax_common.o
  391. OBJS_h += ../src/eap_server/eap_pax.o
  392. endif
  393. CONFIG_IEEE8021X_EAPOL=y
  394. endif
  395. ifdef CONFIG_EAP_SAKE
  396. # EAP-SAKE
  397. ifeq ($(CONFIG_EAP_SAKE), dyn)
  398. CFLAGS += -DEAP_SAKE_DYNAMIC
  399. EAPDYN += ../src/eap_peer/eap_sake.so
  400. else
  401. CFLAGS += -DEAP_SAKE
  402. OBJS += ../src/eap_peer/eap_sake.o ../src/eap_common/eap_sake_common.o
  403. OBJS_h += ../src/eap_server/eap_sake.o
  404. endif
  405. CONFIG_IEEE8021X_EAPOL=y
  406. endif
  407. ifdef CONFIG_EAP_GPSK
  408. # EAP-GPSK
  409. ifeq ($(CONFIG_EAP_GPSK), dyn)
  410. CFLAGS += -DEAP_GPSK_DYNAMIC
  411. EAPDYN += ../src/eap_peer/eap_gpsk.so
  412. else
  413. CFLAGS += -DEAP_GPSK
  414. OBJS += ../src/eap_peer/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o
  415. OBJS_h += ../src/eap_server/eap_gpsk.o
  416. endif
  417. CONFIG_IEEE8021X_EAPOL=y
  418. ifdef CONFIG_EAP_GPSK_SHA256
  419. CFLAGS += -DEAP_GPSK_SHA256
  420. endif
  421. NEED_SHA256=y
  422. endif
  423. ifdef CONFIG_EAP_IKEV2
  424. # EAP-IKEv2
  425. ifeq ($(CONFIG_EAP_IKEV2), dyn)
  426. CFLAGS += -DEAP_IKEV2_DYNAMIC
  427. EAPDYN += ../src/eap_peer/eap_ikev2.so ../src/eap_peer/ikev2.o
  428. EAPDYN += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  429. else
  430. CFLAGS += -DEAP_IKEV2
  431. OBJS += ../src/eap_peer/eap_ikev2.o ../src/eap_peer/ikev2.o
  432. OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  433. OBJS_h += ../src/eap_server/eap_ikev2.o
  434. OBJS_h += ../src/eap_server/ikev2.o
  435. endif
  436. CONFIG_IEEE8021X_EAPOL=y
  437. NEED_DH_GROUPS=y
  438. endif
  439. ifdef CONFIG_EAP_VENDOR_TEST
  440. ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
  441. CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
  442. EAPDYN += ../src/eap_peer/eap_vendor_test.so
  443. else
  444. CFLAGS += -DEAP_VENDOR_TEST
  445. OBJS += ../src/eap_peer/eap_vendor_test.o
  446. OBJS_h += ../src/eap_server/eap_vendor_test.o
  447. endif
  448. CONFIG_IEEE8021X_EAPOL=y
  449. endif
  450. ifdef CONFIG_EAP_TNC
  451. # EAP-TNC
  452. CFLAGS += -DEAP_TNC
  453. OBJS += ../src/eap_peer/eap_tnc.o
  454. OBJS += ../src/eap_peer/tncc.o
  455. NEED_BASE64=y
  456. endif
  457. ifdef CONFIG_IEEE8021X_EAPOL
  458. # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
  459. CFLAGS += -DIEEE8021X_EAPOL
  460. OBJS += ../src/eapol_supp/eapol_supp_sm.o ../src/eap_peer/eap.o ../src/eap_common/eap_common.o ../src/eap_peer/eap_methods.o
  461. ifdef CONFIG_DYNAMIC_EAP_METHODS
  462. CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  463. LIBS += -ldl -rdynamic
  464. endif
  465. endif
  466. ifdef CONFIG_EAP_SERVER
  467. CFLAGS += -DEAP_SERVER
  468. OBJS_h += ../src/eap_server/eap.o
  469. OBJS_h += ../src/eap_server/eap_identity.o
  470. OBJS_h += ../src/eap_server/eap_methods.o
  471. endif
  472. ifdef CONFIG_RADIUS_CLIENT
  473. OBJS_h += ../src/utils/ip_addr.o
  474. OBJS_h += ../src/radius/radius.o
  475. OBJS_h += ../src/radius/radius_client.o
  476. endif
  477. ifdef CONFIG_AUTHENTICATOR
  478. OBJS_h += ../hostapd/eapol_sm.o
  479. OBJS_h += ../hostapd/ieee802_1x.o
  480. endif
  481. ifdef CONFIG_WPA_AUTHENTICATOR
  482. OBJS_h += ../hostapd/wpa.o
  483. OBJS_h += ../hostapd/wpa_auth_ie.o
  484. ifdef CONFIG_IEEE80211R
  485. OBJS_h += ../hostapd/wpa_ft.o
  486. endif
  487. ifdef CONFIG_PEERKEY
  488. OBJS_h += ../hostapd/peerkey.o
  489. endif
  490. endif
  491. ifdef CONFIG_PCSC
  492. # PC/SC interface for smartcards (USIM, GSM SIM)
  493. CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
  494. OBJS += ../src/utils/pcsc_funcs.o
  495. # -lpthread may not be needed depending on how pcsc-lite was configured
  496. ifdef CONFIG_NATIVE_WINDOWS
  497. #Once MinGW gets support for WinScard, -lwinscard could be used instead of the
  498. #dynamic symbol loading that is now used in pcsc_funcs.c
  499. #LIBS += -lwinscard
  500. else
  501. LIBS += -lpcsclite -lpthread
  502. endif
  503. endif
  504. ifndef CONFIG_TLS
  505. CONFIG_TLS=openssl
  506. endif
  507. ifeq ($(CONFIG_TLS), internal)
  508. ifndef CONFIG_CRYPTO
  509. CONFIG_CRYPTO=internal
  510. endif
  511. endif
  512. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  513. CFLAGS += -DCONFIG_INTERNAL_X509
  514. endif
  515. ifeq ($(CONFIG_CRYPTO), internal)
  516. CFLAGS += -DCONFIG_INTERNAL_X509
  517. endif
  518. ifdef TLS_FUNCS
  519. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
  520. CFLAGS += -DEAP_TLS_FUNCS
  521. OBJS += ../src/eap_peer/eap_tls_common.o
  522. OBJS_h += ../src/eap_server/eap_tls_common.o
  523. NEED_TLS_PRF=y
  524. ifeq ($(CONFIG_TLS), openssl)
  525. CFLAGS += -DEAP_TLS_OPENSSL
  526. OBJS += ../src/crypto/tls_openssl.o
  527. LIBS += -lssl -lcrypto
  528. LIBS_p += -lcrypto
  529. endif
  530. ifeq ($(CONFIG_TLS), gnutls)
  531. OBJS += ../src/crypto/tls_gnutls.o
  532. LIBS += -lgnutls -lgcrypt -lgpg-error
  533. LIBS_p += -lgcrypt
  534. ifdef CONFIG_GNUTLS_EXTRA
  535. CFLAGS += -DCONFIG_GNUTLS_EXTRA
  536. LIBS += -lgnutls-extra
  537. endif
  538. endif
  539. ifeq ($(CONFIG_TLS), schannel)
  540. OBJS += ../src/crypto/tls_schannel.o
  541. endif
  542. ifeq ($(CONFIG_TLS), internal)
  543. OBJS += ../src/crypto/tls_internal.o
  544. OBJS += ../src/tls/tlsv1_common.o ../src/tls/tlsv1_record.o
  545. OBJS += ../src/tls/tlsv1_cred.o ../src/tls/tlsv1_client.o
  546. OBJS += ../src/tls/tlsv1_client_write.o ../src/tls/tlsv1_client_read.o
  547. OBJS += ../src/tls/asn1.o ../src/tls/x509v3.o
  548. OBJS_p += ../src/tls/asn1.o
  549. OBJS_p += ../src/crypto/rc4.o ../src/crypto/aes_wrap.o ../src/crypto/aes.o
  550. NEED_BASE64=y
  551. NEED_TLS_PRF=y
  552. CFLAGS += -DCONFIG_TLS_INTERNAL
  553. CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
  554. ifeq ($(CONFIG_CRYPTO), internal)
  555. ifdef CONFIG_INTERNAL_LIBTOMMATH
  556. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  557. else
  558. LIBS += -ltommath
  559. LIBS_p += -ltommath
  560. endif
  561. endif
  562. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  563. LIBS += -ltomcrypt -ltfm
  564. LIBS_p += -ltomcrypt -ltfm
  565. endif
  566. endif
  567. ifeq ($(CONFIG_TLS), none)
  568. OBJS += ../src/crypto/tls_none.o
  569. CFLAGS += -DEAP_TLS_NONE
  570. CONFIG_INTERNAL_AES=y
  571. CONFIG_INTERNAL_SHA1=y
  572. CONFIG_INTERNAL_MD5=y
  573. CONFIG_INTERNAL_SHA256=y
  574. endif
  575. ifdef CONFIG_SMARTCARD
  576. ifndef CONFIG_NATIVE_WINDOWS
  577. ifneq ($(CONFIG_L2_PACKET), freebsd)
  578. LIBS += -ldl
  579. endif
  580. endif
  581. endif
  582. NEED_CRYPTO=y
  583. else
  584. OBJS += ../src/crypto/tls_none.o
  585. endif
  586. ifdef CONFIG_PKCS12
  587. CFLAGS += -DPKCS12_FUNCS
  588. endif
  589. ifdef CONFIG_SMARTCARD
  590. CFLAGS += -DCONFIG_SMARTCARD
  591. endif
  592. ifdef MS_FUNCS
  593. OBJS += ../src/crypto/ms_funcs.o
  594. NEED_CRYPTO=y
  595. endif
  596. ifdef CHAP
  597. OBJS += ../src/eap_common/chap.o
  598. endif
  599. ifdef NEED_CRYPTO
  600. ifndef TLS_FUNCS
  601. ifeq ($(CONFIG_TLS), openssl)
  602. LIBS += -lcrypto
  603. LIBS_p += -lcrypto
  604. endif
  605. ifeq ($(CONFIG_TLS), gnutls)
  606. LIBS += -lgcrypt
  607. LIBS_p += -lgcrypt
  608. endif
  609. ifeq ($(CONFIG_TLS), schannel)
  610. endif
  611. ifeq ($(CONFIG_TLS), internal)
  612. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  613. LIBS += -ltomcrypt -ltfm
  614. LIBS_p += -ltomcrypt -ltfm
  615. endif
  616. endif
  617. endif
  618. ifeq ($(CONFIG_TLS), openssl)
  619. OBJS += ../src/crypto/crypto_openssl.o
  620. OBJS_p += ../src/crypto/crypto_openssl.o
  621. CONFIG_INTERNAL_SHA256=y
  622. endif
  623. ifeq ($(CONFIG_TLS), gnutls)
  624. OBJS += ../src/crypto/crypto_gnutls.o
  625. OBJS_p += ../src/crypto/crypto_gnutls.o
  626. CONFIG_INTERNAL_SHA256=y
  627. endif
  628. ifeq ($(CONFIG_TLS), schannel)
  629. OBJS += ../src/crypto/crypto_cryptoapi.o
  630. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  631. CONFIG_INTERNAL_SHA256=y
  632. endif
  633. ifeq ($(CONFIG_TLS), internal)
  634. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  635. OBJS += ../src/crypto/crypto_libtomcrypt.o
  636. OBJS_p += ../src/crypto/crypto_libtomcrypt.o
  637. CONFIG_INTERNAL_SHA256=y
  638. endif
  639. ifeq ($(CONFIG_CRYPTO), internal)
  640. OBJS += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o
  641. OBJS_p += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o
  642. CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  643. CONFIG_INTERNAL_AES=y
  644. CONFIG_INTERNAL_DES=y
  645. CONFIG_INTERNAL_SHA1=y
  646. CONFIG_INTERNAL_MD4=y
  647. CONFIG_INTERNAL_MD5=y
  648. CONFIG_INTERNAL_SHA256=y
  649. endif
  650. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  651. OBJS += ../src/crypto/crypto_cryptoapi.o
  652. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  653. CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  654. CONFIG_INTERNAL_SHA256=y
  655. endif
  656. endif
  657. ifeq ($(CONFIG_TLS), none)
  658. OBJS += ../src/crypto/crypto_none.o
  659. OBJS_p += ../src/crypto/crypto_none.o
  660. CONFIG_INTERNAL_SHA256=y
  661. endif
  662. else
  663. CONFIG_INTERNAL_AES=y
  664. CONFIG_INTERNAL_SHA1=y
  665. CONFIG_INTERNAL_MD5=y
  666. endif
  667. ifdef CONFIG_INTERNAL_AES
  668. CFLAGS += -DINTERNAL_AES
  669. endif
  670. ifdef CONFIG_INTERNAL_SHA1
  671. CFLAGS += -DINTERNAL_SHA1
  672. endif
  673. ifdef CONFIG_INTERNAL_SHA256
  674. CFLAGS += -DINTERNAL_SHA256
  675. endif
  676. ifdef CONFIG_INTERNAL_MD5
  677. CFLAGS += -DINTERNAL_MD5
  678. endif
  679. ifdef CONFIG_INTERNAL_MD4
  680. CFLAGS += -DINTERNAL_MD4
  681. endif
  682. ifdef CONFIG_INTERNAL_DES
  683. CFLAGS += -DINTERNAL_DES
  684. endif
  685. ifdef CONFIG_IEEE80211R
  686. NEED_SHA256=y
  687. endif
  688. ifdef NEED_SHA256
  689. OBJS += ../src/crypto/sha256.o
  690. endif
  691. ifdef CONFIG_WIRELESS_EXTENSION
  692. CFLAGS += -DCONFIG_WIRELESS_EXTENSION
  693. OBJS_d += ../src/drivers/driver_wext.o
  694. endif
  695. ifdef CONFIG_CTRL_IFACE
  696. ifeq ($(CONFIG_CTRL_IFACE), y)
  697. ifdef CONFIG_NATIVE_WINDOWS
  698. CONFIG_CTRL_IFACE=named_pipe
  699. else
  700. CONFIG_CTRL_IFACE=unix
  701. endif
  702. endif
  703. CFLAGS += -DCONFIG_CTRL_IFACE
  704. ifeq ($(CONFIG_CTRL_IFACE), unix)
  705. CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
  706. endif
  707. ifeq ($(CONFIG_CTRL_IFACE), udp)
  708. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  709. endif
  710. ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
  711. CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
  712. endif
  713. OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o
  714. endif
  715. ifdef CONFIG_CTRL_IFACE_DBUS
  716. CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
  717. OBJS += ctrl_iface_dbus.o ctrl_iface_dbus_handlers.o dbus_dict_helpers.o
  718. ifndef DBUS_LIBS
  719. DBUS_LIBS := $(shell pkg-config --libs dbus-1)
  720. endif
  721. LIBS += $(DBUS_LIBS)
  722. ifndef DBUS_INCLUDE
  723. DBUS_INCLUDE := $(shell pkg-config --cflags dbus-1)
  724. endif
  725. dbus_version=$(subst ., ,$(shell pkg-config --modversion dbus-1))
  726. DBUS_VERSION_MAJOR=$(word 1,$(dbus_version))
  727. DBUS_VERSION_MINOR=$(word 2,$(dbus_version))
  728. ifeq ($(DBUS_VERSION_MAJOR),)
  729. DBUS_VERSION_MAJOR=0
  730. endif
  731. ifeq ($(DBUS_VERSION_MINOR),)
  732. DBUS_VERSION_MINOR=0
  733. endif
  734. DBUS_INCLUDE += -DDBUS_VERSION_MAJOR=$(DBUS_VERSION_MAJOR)
  735. DBUS_INCLUDE += -DDBUS_VERSION_MINOR=$(DBUS_VERSION_MINOR)
  736. CFLAGS += $(DBUS_INCLUDE)
  737. endif
  738. ifdef CONFIG_READLINE
  739. CFLAGS += -DCONFIG_READLINE
  740. LIBS_c += -lncurses -lreadline
  741. endif
  742. ifdef CONFIG_NATIVE_WINDOWS
  743. CFLAGS += -DCONFIG_NATIVE_WINDOWS
  744. LIBS += -lws2_32 -lgdi32 -lcrypt32
  745. LIBS_c += -lws2_32
  746. LIBS_p += -lws2_32 -lgdi32
  747. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  748. LIBS_p += -lcrypt32
  749. endif
  750. endif
  751. ifdef CONFIG_NO_STDOUT_DEBUG
  752. CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  753. ifndef CONFIG_CTRL_IFACE
  754. CFLAGS += -DCONFIG_NO_WPA_MSG
  755. endif
  756. endif
  757. ifdef CONFIG_IPV6
  758. # for eapol_test only
  759. CFLAGS += -DCONFIG_IPV6
  760. endif
  761. ifdef CONFIG_PEERKEY
  762. CFLAGS += -DCONFIG_PEERKEY
  763. endif
  764. ifdef CONFIG_IEEE80211W
  765. CFLAGS += -DCONFIG_IEEE80211W
  766. NEED_SHA256=y
  767. endif
  768. ifdef CONFIG_IEEE80211R
  769. CFLAGS += -DCONFIG_IEEE80211R
  770. OBJS += ../src/rsn_supp/wpa_ft.o
  771. endif
  772. ifndef CONFIG_NO_WPA
  773. OBJS += ../src/rsn_supp/wpa.o
  774. OBJS += ../src/rsn_supp/preauth.o
  775. OBJS += ../src/rsn_supp/pmksa_cache.o
  776. OBJS += ../src/rsn_supp/peerkey.o
  777. OBJS += ../src/rsn_supp/wpa_ie.o
  778. OBJS += ../src/common/wpa_common.o
  779. NEED_AES=y
  780. else
  781. CFLAGS += -DCONFIG_NO_WPA -DCONFIG_NO_WPA2
  782. endif
  783. ifdef CONFIG_NO_WPA2
  784. CFLAGS += -DCONFIG_NO_WPA2
  785. endif
  786. ifdef CONFIG_NO_WPA_PASSPHRASE
  787. CFLAGS += -DCONFIG_NO_PBKDF2
  788. endif
  789. ifdef CONFIG_NO_AES_EXTRAS
  790. CFLAGS += -DCONFIG_NO_AES_WRAP
  791. CFLAGS += -DCONFIG_NO_AES_CTR -DCONFIG_NO_AES_OMAC1
  792. CFLAGS += -DCONFIG_NO_AES_EAX -DCONFIG_NO_AES_CBC
  793. CFLAGS += -DCONFIG_NO_AES_ENCRYPT
  794. CFLAGS += -DCONFIG_NO_AES_ENCRYPT_BLOCK
  795. endif
  796. ifdef NEED_AES
  797. OBJS += ../src/crypto/aes_wrap.o ../src/crypto/aes.o
  798. endif
  799. ifdef NEED_DH_GROUPS
  800. OBJS += ../src/crypto/dh_groups.o
  801. endif
  802. ifndef NEED_FIPS186_2_PRF
  803. CFLAGS += -DCONFIG_NO_FIPS186_2_PRF
  804. endif
  805. ifndef NEED_T_PRF
  806. CFLAGS += -DCONFIG_NO_T_PRF
  807. endif
  808. ifndef NEED_TLS_PRF
  809. CFLAGS += -DCONFIG_NO_TLS_PRF
  810. endif
  811. ifdef NEED_BASE64
  812. OBJS += ../src/utils/base64.o
  813. endif
  814. ifdef CONFIG_CLIENT_MLME
  815. OBJS += mlme.o
  816. CFLAGS += -DCONFIG_CLIENT_MLME
  817. endif
  818. ifndef CONFIG_MAIN
  819. CONFIG_MAIN=main
  820. endif
  821. ifdef CONFIG_DEBUG_FILE
  822. CFLAGS += -DCONFIG_DEBUG_FILE
  823. endif
  824. OBJS += ../src/drivers/scan_helpers.o
  825. OBJS_wpa_rm := ctrl_iface.o mlme.o ctrl_iface_unix.o
  826. OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.o
  827. ifdef CONFIG_AUTHENTICATOR
  828. OBJS_wpa += tests/link_test.o
  829. endif
  830. OBJS_wpa += $(OBJS_l2)
  831. OBJS += wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o
  832. OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o ../src/radius/radius.o ../src/radius/radius_client.o
  833. OBJS_t += ../src/utils/ip_addr.o
  834. OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o
  835. OBJS += $(CONFIG_MAIN).o
  836. ifdef CONFIG_PRIVSEP
  837. OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o ../src/drivers/scan_helpers.o
  838. OBJS_priv += $(OBJS_l2)
  839. OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
  840. OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
  841. OBJS_priv += ../src/utils/common.o
  842. OBJS_priv += ../src/utils/wpa_debug.o
  843. OBJS_priv += wpa_priv.o
  844. ifdef CONFIG_DRIVER_TEST
  845. OBJS_priv += ../src/crypto/sha1.o
  846. OBJS_priv += ../src/crypto/md5.o
  847. ifeq ($(CONFIG_TLS), openssl)
  848. OBJS_priv += ../src/crypto/crypto_openssl.o
  849. endif
  850. ifeq ($(CONFIG_TLS), gnutls)
  851. OBJS_priv += ../src/crypto/crypto_gnutls.o
  852. endif
  853. ifeq ($(CONFIG_TLS), internal)
  854. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  855. OBJS_priv += ../src/crypto/crypto_libtomcrypt.o
  856. else
  857. OBJS_priv += ../src/crypto/crypto_internal.o
  858. endif
  859. endif
  860. endif # CONFIG_DRIVER_TEST
  861. OBJS += ../src/l2_packet/l2_packet_privsep.o
  862. OBJS += ../src/drivers/driver_privsep.o
  863. EXTRA_progs += wpa_priv
  864. else
  865. OBJS += $(OBJS_d) ../src/drivers/drivers.o
  866. OBJS += $(OBJS_l2)
  867. endif
  868. ifdef CONFIG_NDIS_EVENTS_INTEGRATED
  869. CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
  870. OBJS += ../src/drivers/ndis_events.o
  871. EXTRALIBS += -loleaut32 -lole32 -luuid
  872. ifdef PLATFORMSDKLIB
  873. EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
  874. else
  875. EXTRALIBS += WbemUuid.Lib
  876. endif
  877. endif
  878. ifndef LDO
  879. LDO=$(CC)
  880. endif
  881. dynamic_eap_methods: $(EAPDYN)
  882. wpa_priv: $(OBJS_priv)
  883. $(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
  884. wpa_supplicant: .config $(OBJS) $(EXTRA_progs)
  885. $(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
  886. eapol_test: .config $(OBJS_t)
  887. $(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
  888. preauth_test: .config $(OBJS_t2)
  889. $(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
  890. wpa_passphrase: $(OBJS_p)
  891. $(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p)
  892. wpa_cli: $(OBJS_c)
  893. $(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
  894. link_test: $(OBJS) $(OBJS_h) tests/link_test.o
  895. $(LDO) $(LDFLAGS) -o link_test $(OBJS) $(OBJS_h) tests/link_test.o $(LIBS)
  896. test_wpa: $(OBJS_wpa) $(OBJS_h)
  897. $(LDO) $(LDFLAGS) -o test_wpa $(OBJS_wpa) $(LIBS)
  898. OBJSa=../src/tls/asn1_test.o ../src/tls/asn1.o ../src/tls/x509v3.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_unix.o \
  899. ../src/crypto/crypto_$(CONFIG_CRYPTO).o ../src/crypto/md5.o ../src/crypto/sha1.o \
  900. ../src/crypto/rc4.o ../src/crypto/des.o ../src/crypto/aes_wrap.o \
  901. ../src/crypto/aes.o ../src/tls/bignum.o ../src/tls/rsa.o
  902. asn1_test: $(OBJSa)
  903. $(LDO) $(LDFLAGS) -o asn1_test $(OBJSa)
  904. OBJSx=tests/test_x509v3.o ../src/tls/asn1.o ../src/tls/x509v3.o \
  905. ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_unix.o \
  906. ../src/crypto/crypto_$(CONFIG_CRYPTO).o \
  907. ../src/crypto/md5.o ../src/crypto/sha1.o ../src/crypto/aes.o \
  908. ../src/crypto/rc4.o ../src/crypto/des.o ../src/crypto/aes_wrap.o \
  909. ../src/tls/bignum.o ../src/tls/rsa.o
  910. test_x509v3: $(OBJSx)
  911. $(LDO) $(LDFLAGS) -o test_x509v3 $(OBJSx)
  912. win_if_list: win_if_list.c
  913. $(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
  914. eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c
  915. $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  916. -Deap_peer_psk_register=eap_peer_method_dynamic_init
  917. eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c
  918. $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  919. -Deap_peer_pax_register=eap_peer_method_dynamic_init
  920. eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c
  921. $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  922. -Deap_peer_sake_register=eap_peer_method_dynamic_init
  923. 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
  924. $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  925. -Deap_peer_ikev2_register=eap_peer_method_dynamic_init
  926. %.so: %.c
  927. $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
  928. -D$(*:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
  929. wpa_supplicant.exe: wpa_supplicant
  930. mv -f $< $@
  931. wpa_cli.exe: wpa_cli
  932. mv -f $< $@
  933. wpa_passphrase.exe: wpa_passphrase
  934. mv -f $< $@
  935. win_if_list.exe: win_if_list
  936. mv -f $< $@
  937. eapol_test.exe: eapol_test
  938. mv -f $< $@
  939. WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe
  940. windows-bin: $(WINALL)
  941. $(STRIP) $(WINALL)
  942. wpa_gui/Makefile:
  943. qmake -o wpa_gui/Makefile wpa_gui/wpa_gui.pro
  944. wpa_gui: wpa_gui/Makefile
  945. $(MAKE) -C wpa_gui
  946. wpa_gui-qt4/Makefile:
  947. qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro
  948. wpa_gui-qt4: wpa_gui-qt4/Makefile
  949. $(MAKE) -C wpa_gui-qt4
  950. TEST_MS_FUNCS_OBJS = ../src/crypto/crypto_openssl.o ../src/crypto/sha1.o ../src/crypto/md5.o \
  951. ../src/utils/os_unix.o ../src/crypto/rc4.o tests/test_ms_funcs.o
  952. test-ms_funcs: $(TEST_MS_FUNCS_OBJS)
  953. $(LDO) $(LDFLAGS) -o $@ $(TEST_MS_FUNCS_OBJS) $(LIBS) -lcrypto
  954. ./test-ms_funcs
  955. rm test-ms_funcs
  956. TEST_SHA1_OBJS = ../src/crypto/sha1.o ../src/crypto/md5.o tests/test_sha1.o #../src/crypto/crypto_openssl.o
  957. test-sha1: $(TEST_SHA1_OBJS)
  958. $(LDO) $(LDFLAGS) -o $@ $(TEST_SHA1_OBJS) $(LIBS)
  959. ./test-sha1
  960. rm test-sha1
  961. TEST_SHA256_OBJS = ../src/crypto/sha256.o ../src/crypto/md5.o tests/test_sha256.o ../src/crypto/crypto_openssl.o
  962. test-sha256: $(TEST_SHA256_OBJS)
  963. $(LDO) $(LDFLAGS) -o $@ $(TEST_SHA256_OBJS) $(LIBS)
  964. ./test-sha256
  965. rm test-sha256
  966. TEST_AES_OBJS = ../src/crypto/aes_wrap.o ../src/crypto/aes.o tests/test_aes.o
  967. test-aes: $(TEST_AES_OBJS)
  968. $(LDO) $(LDFLAGS) -o $@ $(TEST_AES_OBJS) $(LIBS)
  969. ./test-aes
  970. rm test-aes
  971. TEST_EAP_SIM_COMMON_OBJS = ../src/crypto/sha1.o ../src/crypto/md5.o \
  972. ../src/crypto/aes_wrap.o ../src/utils/common.o ../src/utils/os_unix.o \
  973. ../src/utils/wpa_debug.o ../src/crypto/aes.o \
  974. tests/test_eap_sim_common.o
  975. test-eap_sim_common: $(TEST_EAP_SIM_COMMON_OBJS)
  976. $(LDO) $(LDFLAGS) -o $@ $(TEST_AES_OBJS) $(LIBS)
  977. ./test-eap_sim_common
  978. rm test-eap_sim_common
  979. TEST_MD4_OBJS = ../src/crypto/md4.o tests/test_md4.o #../src/crypto/crypto_openssl.o
  980. test-md4: $(TEST_MD4_OBJS)
  981. $(LDO) $(LDFLAGS) -o $@ $(TEST_MD4_OBJS) $(LIBS)
  982. ./test-md4
  983. rm test-md4
  984. TEST_MD5_OBJS = ../src/crypto/md5.o tests/test_md5.o #../src/crypto/crypto_openssl.o
  985. test-md5: $(TEST_MD5_OBJS)
  986. $(LDO) $(LDFLAGS) -o $@ $(TEST_MD5_OBJS) $(LIBS)
  987. ./test-md5
  988. rm test-md5
  989. tests: test-ms_funcs test-sha1 test-aes test-eap_sim_common test-md4 test-md5
  990. clean:
  991. $(MAKE) -C ../src clean
  992. rm -f core *~ *.o *.d eap_*.so $(ALL) $(WINALL)
  993. %.eps: %.fig
  994. fig2dev -L eps $*.fig $*.eps
  995. %.png: %.fig
  996. fig2dev -L png -m 3 $*.fig | pngtopnm | pnmscale 0.4 | pnmtopng \
  997. > $*.png
  998. docs-pics: doc/wpa_supplicant.png doc/wpa_supplicant.eps
  999. docs: docs-pics
  1000. (cd ..; doxygen wpa_supplicant/doc/doxygen.full; cd wpa_supplicant)
  1001. $(MAKE) -C doc/latex
  1002. cp doc/latex/refman.pdf wpa_supplicant-devel.pdf
  1003. docs-fast: docs-pics
  1004. doxygen doc/doxygen.fast
  1005. clean-docs:
  1006. rm -rf doc/latex doc/html
  1007. rm -f doc/wpa_supplicant.{eps,png} wpa_supplicant-devel.pdf
  1008. wpa_supplicant-sparse: .config $(OBJS)
  1009. @echo Sparse run completed
  1010. run-sparse:
  1011. CC="sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -D__INT_MAX__=2147483647 -D__SHRT_MAX__=32767 -D__LONG_MAX__=2147483647 -D__SCHAR_MAX__=127 -Wbitwise" $(MAKE) wpa_supplicant-sparse
  1012. -include $(OBJS:%.o=%.d)