Makefile 30 KB

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