Makefile 31 KB

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