Makefile 29 KB

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