Makefile 28 KB

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