Makefile 30 KB

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