Makefile 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379
  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. CFLAGS += -DEAP_TLS_FUNCS
  617. OBJS += ../src/eap_peer/eap_tls_common.o
  618. OBJS_h += ../src/eap_server/eap_tls_common.o
  619. NEED_TLS_PRF=y
  620. endif
  621. ifndef CONFIG_TLS
  622. CONFIG_TLS=openssl
  623. endif
  624. ifeq ($(CONFIG_TLS), openssl)
  625. ifdef TLS_FUNCS
  626. CFLAGS += -DEAP_TLS_OPENSSL
  627. OBJS += ../src/crypto/tls_openssl.o
  628. LIBS += -lssl
  629. endif
  630. OBJS += ../src/crypto/crypto_openssl.o
  631. OBJS_p += ../src/crypto/crypto_openssl.o
  632. ifdef NEED_FIPS186_2_PRF
  633. OBJS += ../src/crypto/fips_prf_openssl.o
  634. endif
  635. LIBS += -lcrypto
  636. LIBS_p += -lcrypto
  637. endif
  638. ifeq ($(CONFIG_TLS), gnutls)
  639. ifdef TLS_FUNCS
  640. OBJS += ../src/crypto/tls_gnutls.o
  641. LIBS += -lgnutls -lgpg-error
  642. ifdef CONFIG_GNUTLS_EXTRA
  643. CFLAGS += -DCONFIG_GNUTLS_EXTRA
  644. LIBS += -lgnutls-extra
  645. endif
  646. endif
  647. OBJS += ../src/crypto/crypto_gnutls.o
  648. OBJS_p += ../src/crypto/crypto_gnutls.o
  649. ifdef NEED_FIPS186_2_PRF
  650. OBJS += ../src/crypto/fips_prf_gnutls.o
  651. endif
  652. LIBS += -lgcrypt
  653. LIBS_p += -lgcrypt
  654. CONFIG_INTERNAL_SHA256=y
  655. CONFIG_INTERNAL_RC4=y
  656. CONFIG_INTERNAL_DH_GROUP5=y
  657. endif
  658. ifeq ($(CONFIG_TLS), schannel)
  659. ifdef TLS_FUNCS
  660. OBJS += ../src/crypto/tls_schannel.o
  661. endif
  662. OBJS += ../src/crypto/crypto_cryptoapi.o
  663. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  664. CONFIG_INTERNAL_SHA256=y
  665. CONFIG_INTERNAL_RC4=y
  666. CONFIG_INTERNAL_DH_GROUP5=y
  667. endif
  668. ifeq ($(CONFIG_TLS), nss)
  669. ifdef TLS_FUNCS
  670. OBJS += ../src/crypto/tls_nss.o
  671. LIBS += -lssl3
  672. endif
  673. OBJS += ../src/crypto/crypto_nss.o
  674. OBJS_p += ../src/crypto/crypto_nss.o
  675. ifdef NEED_FIPS186_2_PRF
  676. OBJS += ../src/crypto/fips_prf_nss.o
  677. endif
  678. LIBS += -lnss3
  679. LIBS_p += -lnss3
  680. CONFIG_INTERNAL_MD4=y
  681. CONFIG_INTERNAL_DH_GROUP5=y
  682. endif
  683. ifeq ($(CONFIG_TLS), internal)
  684. ifndef CONFIG_CRYPTO
  685. CONFIG_CRYPTO=internal
  686. endif
  687. ifdef TLS_FUNCS
  688. OBJS += ../src/crypto/tls_internal.o
  689. OBJS += ../src/tls/tlsv1_common.o
  690. OBJS += ../src/tls/tlsv1_record.o
  691. OBJS += ../src/tls/tlsv1_cred.o
  692. OBJS += ../src/tls/tlsv1_client.o
  693. OBJS += ../src/tls/tlsv1_client_write.o
  694. OBJS += ../src/tls/tlsv1_client_read.o
  695. OBJS += ../src/tls/asn1.o
  696. OBJS += ../src/tls/rsa.o
  697. OBJS += ../src/tls/x509v3.o
  698. OBJS += ../src/tls/pkcs1.o
  699. OBJS += ../src/tls/pkcs5.o
  700. OBJS += ../src/tls/pkcs8.o
  701. OBJS_p += ../src/tls/asn1.o
  702. OBJS_p += ../src/tls/rsa.o
  703. OBJS_p += ../src/tls/pkcs1.o
  704. OBJS_p += ../src/tls/pkcs5.o
  705. OBJS_p += ../src/tls/pkcs8.o
  706. OBJS_p += ../src/crypto/rc4.o
  707. NEED_BASE64=y
  708. NEED_TLS_PRF=y
  709. NEED_MODEXP=y
  710. CFLAGS += -DCONFIG_TLS_INTERNAL
  711. CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
  712. endif
  713. ifdef NEED_MODEXP
  714. OBJS += ../src/tls/bignum.o
  715. OBJS_p += ../src/tls/bignum.o
  716. endif
  717. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  718. CFLAGS += -DCONFIG_INTERNAL_X509
  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. CFLAGS += -DCONFIG_INTERNAL_X509
  729. OBJS += ../src/crypto/crypto_internal.o
  730. OBJS_p += ../src/crypto/crypto_internal.o
  731. NEED_AES_ENC=y
  732. CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  733. ifdef CONFIG_INTERNAL_LIBTOMMATH
  734. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  735. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  736. CFLAGS += -DLTM_FAST
  737. endif
  738. else
  739. LIBS += -ltommath
  740. LIBS_p += -ltommath
  741. endif
  742. CONFIG_INTERNAL_AES=y
  743. CONFIG_INTERNAL_DES=y
  744. CONFIG_INTERNAL_SHA1=y
  745. CONFIG_INTERNAL_MD4=y
  746. CONFIG_INTERNAL_MD5=y
  747. CONFIG_INTERNAL_SHA256=y
  748. CONFIG_INTERNAL_RC4=y
  749. CONFIG_INTERNAL_DH_GROUP5=y
  750. endif
  751. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  752. OBJS += ../src/crypto/crypto_cryptoapi.o
  753. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  754. CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  755. CONFIG_INTERNAL_SHA256=y
  756. CONFIG_INTERNAL_RC4=y
  757. endif
  758. endif
  759. ifeq ($(CONFIG_TLS), none)
  760. ifdef TLS_FUNCS
  761. OBJS += ../src/crypto/tls_none.o
  762. CFLAGS += -DEAP_TLS_NONE
  763. CONFIG_INTERNAL_AES=y
  764. CONFIG_INTERNAL_SHA1=y
  765. CONFIG_INTERNAL_MD5=y
  766. endif
  767. OBJS += ../src/crypto/crypto_none.o
  768. OBJS_p += ../src/crypto/crypto_none.o
  769. CONFIG_INTERNAL_SHA256=y
  770. CONFIG_INTERNAL_RC4=y
  771. endif
  772. ifdef TLS_FUNCS
  773. ifdef CONFIG_SMARTCARD
  774. ifndef CONFIG_NATIVE_WINDOWS
  775. ifneq ($(CONFIG_L2_PACKET), freebsd)
  776. LIBS += -ldl
  777. endif
  778. endif
  779. endif
  780. endif
  781. ifndef TLS_FUNCS
  782. OBJS += ../src/crypto/tls_none.o
  783. ifeq ($(CONFIG_TLS), internal)
  784. CONFIG_INTERNAL_AES=y
  785. CONFIG_INTERNAL_SHA1=y
  786. CONFIG_INTERNAL_MD5=y
  787. CONFIG_INTERNAL_RC4=y
  788. endif
  789. endif
  790. ifdef NEED_MODEXP
  791. CFLAGS += -DCONFIG_MODEXP
  792. endif
  793. AESOBJS = # none so far (see below)
  794. ifdef CONFIG_INTERNAL_AES
  795. AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-dec.o
  796. endif
  797. AESOBJS += ../src/crypto/aes-unwrap.o
  798. ifdef NEED_AES_EAX
  799. AESOBJS += ../src/crypto/aes-eax.o
  800. NEED_AES_CTR=y
  801. endif
  802. ifdef NEED_AES_CTR
  803. AESOBJS += ../src/crypto/aes-ctr.o
  804. endif
  805. ifdef NEED_AES_ENCBLOCK
  806. AESOBJS += ../src/crypto/aes-encblock.o
  807. endif
  808. ifdef NEED_AES_OMAC1
  809. NEED_AES_ENC=y
  810. AESOBJS += ../src/crypto/aes-omac1.o
  811. endif
  812. ifdef NEED_AES_WRAP
  813. NEED_AES_ENC=y
  814. AESOBJS += ../src/crypto/aes-wrap.o
  815. endif
  816. ifdef NEED_AES_CBC
  817. NEED_AES_ENC=y
  818. AESOBJS += ../src/crypto/aes-cbc.o
  819. endif
  820. ifdef NEED_AES_ENC
  821. ifdef CONFIG_INTERNAL_AES
  822. AESOBJS += ../src/crypto/aes-internal-enc.o
  823. endif
  824. endif
  825. ifdef NEED_AES
  826. OBJS += $(AESOBJS)
  827. ifdef CONFIG_INTERNAL_AES
  828. OBJS_p += $(AESOBJS)
  829. endif
  830. endif
  831. ifdef NEED_SHA1
  832. SHA1OBJS += ../src/crypto/sha1.o
  833. ifdef CONFIG_INTERNAL_SHA1
  834. SHA1OBJS += ../src/crypto/sha1-internal.o
  835. ifdef NEED_FIPS186_2_PRF
  836. SHA1OBJS += ../src/crypto/fips_prf_internal.o
  837. endif
  838. endif
  839. ifndef CONFIG_NO_WPA_PASSPHRASE
  840. SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
  841. endif
  842. ifdef NEED_T_PRF
  843. SHA1OBJS += ../src/crypto/sha1-tprf.o
  844. endif
  845. ifdef NEED_TLS_PRF
  846. SHA1OBJS += ../src/crypto/sha1-tlsprf.o
  847. endif
  848. endif
  849. MD5OBJS = ../src/crypto/md5.o
  850. ifdef NEED_MD5
  851. ifdef CONFIG_INTERNAL_MD5
  852. MD5OBJS += ../src/crypto/md5-internal.o
  853. endif
  854. ifdef CONFIG_FIPS
  855. MD5OBJS += ../src/crypto/md5-non-fips.o
  856. endif
  857. OBJS += $(MD5OBJS)
  858. OBJS_p += $(MD5OBJS)
  859. endif
  860. ifdef NEED_MD4
  861. ifdef CONFIG_INTERNAL_MD4
  862. OBJS += ../src/crypto/md4-internal.o
  863. endif
  864. endif
  865. DESOBJS = # none needed when not internal
  866. ifdef NEED_DES
  867. ifdef CONFIG_INTERNAL_DES
  868. DESOBJS += ../src/crypto/des-internal.o
  869. endif
  870. endif
  871. ifdef NEED_RC4
  872. ifdef CONFIG_INTERNAL_RC4
  873. OBJS += ../src/crypto/rc4.o
  874. endif
  875. endif
  876. SHA256OBJS = # none by default
  877. ifdef NEED_SHA256
  878. SHA256OBJS += ../src/crypto/sha256.o
  879. CFLAGS += -DNEED_SHA256
  880. ifdef CONFIG_INTERNAL_SHA256
  881. SHA256OBJS += ../src/crypto/sha256-internal.o
  882. endif
  883. OBJS += $(SHA256OBJS)
  884. endif
  885. ifdef CONFIG_INTERNAL_DH_GROUP5
  886. ifdef NEED_DH_GROUPS
  887. OBJS += ../src/crypto/dh_groups.o
  888. OBJS += ../src/crypto/dh_group5.o
  889. ifdef NEED_DH_GROUPS_ALL
  890. CFLAGS += -DALL_DH_GROUPS
  891. endif
  892. endif
  893. else
  894. ifdef NEED_DH_GROUPS_ALL
  895. OBJS += ../src/crypto/dh_groups.o
  896. CFLAGS += -DALL_DH_GROUPS
  897. endif
  898. endif
  899. ifdef CONFIG_CTRL_IFACE
  900. ifeq ($(CONFIG_CTRL_IFACE), y)
  901. ifdef CONFIG_NATIVE_WINDOWS
  902. CONFIG_CTRL_IFACE=named_pipe
  903. else
  904. CONFIG_CTRL_IFACE=unix
  905. endif
  906. endif
  907. CFLAGS += -DCONFIG_CTRL_IFACE
  908. ifeq ($(CONFIG_CTRL_IFACE), unix)
  909. CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
  910. endif
  911. ifeq ($(CONFIG_CTRL_IFACE), udp)
  912. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  913. endif
  914. ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
  915. CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
  916. endif
  917. OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o
  918. endif
  919. ifdef CONFIG_CTRL_IFACE_DBUS
  920. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
  921. DBUS_OBJS += ctrl_iface_dbus.o ctrl_iface_dbus_handlers.o
  922. DBUS_OBJS += dbus_dict_helpers.o
  923. ifndef DBUS_LIBS
  924. DBUS_LIBS := $(shell pkg-config --libs dbus-1)
  925. endif
  926. ifndef DBUS_INCLUDE
  927. DBUS_INCLUDE := $(shell pkg-config --cflags dbus-1)
  928. endif
  929. dbus_version=$(subst ., ,$(shell pkg-config --modversion dbus-1))
  930. DBUS_VERSION_MAJOR=$(word 1,$(dbus_version))
  931. DBUS_VERSION_MINOR=$(word 2,$(dbus_version))
  932. ifeq ($(DBUS_VERSION_MAJOR),)
  933. DBUS_VERSION_MAJOR=0
  934. endif
  935. ifeq ($(DBUS_VERSION_MINOR),)
  936. DBUS_VERSION_MINOR=0
  937. endif
  938. DBUS_INCLUDE += -DDBUS_VERSION_MAJOR=$(DBUS_VERSION_MAJOR)
  939. DBUS_INCLUDE += -DDBUS_VERSION_MINOR=$(DBUS_VERSION_MINOR)
  940. DBUS_CFLAGS += $(DBUS_INCLUDE)
  941. endif
  942. ifdef CONFIG_CTRL_IFACE_DBUS_NEW
  943. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
  944. DBUS_OBJS ?= dbus_dict_helpers.o
  945. DBUS_OBJS += ctrl_iface_dbus_new_helpers.o
  946. DBUS_OBJS += ctrl_iface_dbus_new.o ctrl_iface_dbus_new_handlers.o
  947. ifndef DBUS_LIBS
  948. DBUS_LIBS := $(shell pkg-config --libs dbus-1)
  949. endif
  950. ifndef DBUS_INCLUDE
  951. DBUS_INCLUDE := $(shell pkg-config --cflags dbus-1)
  952. endif
  953. ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
  954. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
  955. DBUS_INCLUDE += $(shell xml2-config --cflags)
  956. DBUS_LIBS += $(shell xml2-config --libs)
  957. endif
  958. DBUS_CFLAGS += $(DBUS_INCLUDE)
  959. endif
  960. OBJS += $(DBUS_OBJS)
  961. CFLAGS += $(DBUS_CFLAGS)
  962. LIBS += $(DBUS_LIBS)
  963. ifdef CONFIG_READLINE
  964. CFLAGS += -DCONFIG_READLINE
  965. LIBS_c += -lncurses -lreadline
  966. endif
  967. ifdef CONFIG_NATIVE_WINDOWS
  968. CFLAGS += -DCONFIG_NATIVE_WINDOWS
  969. LIBS += -lws2_32 -lgdi32 -lcrypt32
  970. LIBS_c += -lws2_32
  971. LIBS_p += -lws2_32 -lgdi32
  972. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  973. LIBS_p += -lcrypt32
  974. endif
  975. endif
  976. ifdef CONFIG_NO_STDOUT_DEBUG
  977. CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  978. ifndef CONFIG_CTRL_IFACE
  979. CFLAGS += -DCONFIG_NO_WPA_MSG
  980. endif
  981. endif
  982. ifdef CONFIG_IPV6
  983. # for eapol_test only
  984. CFLAGS += -DCONFIG_IPV6
  985. endif
  986. ifdef NEED_BASE64
  987. OBJS += ../src/utils/base64.o
  988. endif
  989. ifdef NEED_SME
  990. OBJS += sme.o
  991. CFLAGS += -DCONFIG_SME
  992. endif
  993. ifdef CONFIG_CLIENT_MLME
  994. OBJS += mlme.o
  995. CFLAGS += -DCONFIG_CLIENT_MLME
  996. NEED_80211_COMMON=y
  997. endif
  998. ifdef NEED_80211_COMMON
  999. OBJS += ../src/common/ieee802_11_common.o
  1000. endif
  1001. ifndef CONFIG_MAIN
  1002. CONFIG_MAIN=main
  1003. endif
  1004. ifdef CONFIG_DEBUG_SYSLOG
  1005. CFLAGS += -DCONFIG_DEBUG_SYSLOG
  1006. endif
  1007. ifdef CONFIG_DEBUG_FILE
  1008. CFLAGS += -DCONFIG_DEBUG_FILE
  1009. endif
  1010. ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
  1011. CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
  1012. endif
  1013. ifdef CONFIG_FIPS
  1014. CFLAGS += -DCONFIG_FIPS
  1015. endif
  1016. OBJS += ../src/drivers/scan_helpers.o
  1017. OBJS += $(SHA1OBJS) $(DESOBJS)
  1018. OBJS_p += $(SHA1OBJS) $(DESOBJS)
  1019. ifdef CONFIG_BGSCAN_SIMPLE
  1020. CFLAGS += -DCONFIG_BGSCAN_SIMPLE
  1021. OBJS += bgscan_simple.o
  1022. NEED_BGSCAN=y
  1023. endif
  1024. ifdef NEED_BGSCAN
  1025. CFLAGS += -DCONFIG_BGSCAN
  1026. OBJS += bgscan.o
  1027. endif
  1028. OBJS_wpa_rm := ctrl_iface.o mlme.o ctrl_iface_unix.o
  1029. OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.o
  1030. ifdef CONFIG_AUTHENTICATOR
  1031. OBJS_wpa += tests/link_test.o
  1032. endif
  1033. OBJS_wpa += $(OBJS_l2)
  1034. OBJS += wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o
  1035. OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o ../src/radius/radius_client.o
  1036. ifndef CONFIG_IBSS_RSN
  1037. OBJS_t += ../src/radius/radius.o
  1038. endif
  1039. OBJS_t += ../src/utils/ip_addr.o
  1040. OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o
  1041. OBJS += $(CONFIG_MAIN).o
  1042. ifdef CONFIG_PRIVSEP
  1043. OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o ../src/drivers/scan_helpers.o
  1044. OBJS_priv += $(OBJS_l2)
  1045. OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
  1046. OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
  1047. OBJS_priv += ../src/utils/common.o
  1048. OBJS_priv += ../src/utils/wpa_debug.o
  1049. OBJS_priv += ../src/utils/wpabuf.o
  1050. OBJS_priv += wpa_priv.o
  1051. ifdef CONFIG_DRIVER_TEST
  1052. OBJS_priv += $(SHA1OBJS)
  1053. OBJS_priv += $(MD5OBJS)
  1054. ifeq ($(CONFIG_TLS), openssl)
  1055. OBJS_priv += ../src/crypto/crypto_openssl.o
  1056. endif
  1057. ifeq ($(CONFIG_TLS), gnutls)
  1058. OBJS_priv += ../src/crypto/crypto_gnutls.o
  1059. endif
  1060. ifeq ($(CONFIG_TLS), nss)
  1061. OBJS_priv += ../src/crypto/crypto_nss.o
  1062. endif
  1063. ifeq ($(CONFIG_TLS), internal)
  1064. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  1065. OBJS_priv += ../src/crypto/crypto_libtomcrypt.o
  1066. else
  1067. OBJS_priv += ../src/crypto/crypto_internal.o
  1068. endif
  1069. endif
  1070. endif # CONFIG_DRIVER_TEST
  1071. OBJS += ../src/l2_packet/l2_packet_privsep.o
  1072. OBJS += ../src/drivers/driver_privsep.o
  1073. EXTRA_progs += wpa_priv
  1074. else
  1075. OBJS += $(OBJS_d) ../src/drivers/drivers.o
  1076. OBJS += $(OBJS_l2)
  1077. endif
  1078. ifdef CONFIG_NDIS_EVENTS_INTEGRATED
  1079. CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
  1080. OBJS += ../src/drivers/ndis_events.o
  1081. EXTRALIBS += -loleaut32 -lole32 -luuid
  1082. ifdef PLATFORMSDKLIB
  1083. EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
  1084. else
  1085. EXTRALIBS += WbemUuid.Lib
  1086. endif
  1087. endif
  1088. ifndef LDO
  1089. LDO=$(CC)
  1090. endif
  1091. dynamic_eap_methods: $(EAPDYN)
  1092. ../src/drivers/build.wpa_supplicant:
  1093. @if [ -e ../src/drivers/build.hostapd ]; then \
  1094. $(MAKE) -C ../src/drivers clean; \
  1095. fi
  1096. @touch ../src/drivers/build.wpa_supplicant
  1097. BCHECK=../src/drivers/build.wpa_supplicant
  1098. wpa_priv: $(BCHECK) $(OBJS_priv)
  1099. $(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
  1100. wpa_supplicant: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
  1101. $(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
  1102. eapol_test: .config $(OBJS_t)
  1103. $(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
  1104. preauth_test: .config $(OBJS_t2)
  1105. $(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
  1106. wpa_passphrase: $(OBJS_p)
  1107. $(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p)
  1108. wpa_cli: $(OBJS_c)
  1109. $(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
  1110. link_test: $(OBJS) $(OBJS_h) tests/link_test.o
  1111. $(LDO) $(LDFLAGS) -o link_test $(OBJS) $(OBJS_h) tests/link_test.o $(LIBS)
  1112. test_wpa: $(OBJS_wpa) $(OBJS_h)
  1113. $(LDO) $(LDFLAGS) -o test_wpa $(OBJS_wpa) $(LIBS)
  1114. 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 \
  1115. ../src/crypto/crypto_$(CONFIG_CRYPTO).o $(MD5OBJS) $(SHA1OBSJ) \
  1116. ../src/crypto/rc4.o $(DESOBJS) $(AESOBJS) ../src/tls/bignum.o ../src/tls/rsa.o
  1117. asn1_test: $(OBJSa)
  1118. $(LDO) $(LDFLAGS) -o asn1_test $(OBJSa)
  1119. OBJSx=tests/test_x509v3.o ../src/tls/asn1.o ../src/tls/x509v3.o \
  1120. ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_unix.o \
  1121. ../src/crypto/crypto_$(CONFIG_CRYPTO).o \
  1122. $(MD5OBJS) $(SHA1OBJS) $(AESOBJS) \
  1123. ../src/crypto/rc4.o $(DESOBJS) $(SHA256OBJS) \
  1124. ../src/tls/bignum.o ../src/tls/rsa.o
  1125. test_x509v3: $(OBJSx)
  1126. $(LDO) $(LDFLAGS) -o test_x509v3 $(OBJSx)
  1127. win_if_list: win_if_list.c
  1128. $(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
  1129. eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c
  1130. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1131. -Deap_peer_psk_register=eap_peer_method_dynamic_init
  1132. eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c
  1133. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1134. -Deap_peer_pax_register=eap_peer_method_dynamic_init
  1135. eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c
  1136. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1137. -Deap_peer_sake_register=eap_peer_method_dynamic_init
  1138. eap_wsc.so: ../src/eap_peer/eap_wsc.c ../src/eap_common/eap_wsc_common.c ../src/wps/wps.c
  1139. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1140. -Deap_peer_wsc_register=eap_peer_method_dynamic_init
  1141. 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
  1142. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1143. -Deap_peer_ikev2_register=eap_peer_method_dynamic_init
  1144. %.so: %.c
  1145. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
  1146. -D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
  1147. Q=@
  1148. E=echo
  1149. ifeq ($(V), 1)
  1150. Q=
  1151. E=true
  1152. endif
  1153. %.o: %.c
  1154. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  1155. @$(E) " CC " $<
  1156. wpa_supplicant.exe: wpa_supplicant
  1157. mv -f $< $@
  1158. wpa_cli.exe: wpa_cli
  1159. mv -f $< $@
  1160. wpa_passphrase.exe: wpa_passphrase
  1161. mv -f $< $@
  1162. win_if_list.exe: win_if_list
  1163. mv -f $< $@
  1164. eapol_test.exe: eapol_test
  1165. mv -f $< $@
  1166. WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe
  1167. windows-bin: $(WINALL)
  1168. $(STRIP) $(WINALL)
  1169. wpa_gui/Makefile:
  1170. qmake -o wpa_gui/Makefile wpa_gui/wpa_gui.pro
  1171. wpa_gui: wpa_gui/Makefile
  1172. $(MAKE) -C wpa_gui
  1173. wpa_gui-qt4/Makefile:
  1174. qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro
  1175. wpa_gui-qt4: wpa_gui-qt4/Makefile
  1176. $(MAKE) -C wpa_gui-qt4
  1177. TEST_MS_FUNCS_OBJS = ../src/crypto/crypto_openssl.o $(SHA1OBJS) $(MD5OBJS) \
  1178. ../src/utils/os_unix.o ../src/crypto/rc4.o tests/test_ms_funcs.o
  1179. test-ms_funcs: $(TEST_MS_FUNCS_OBJS)
  1180. $(LDO) $(LDFLAGS) -o $@ $(TEST_MS_FUNCS_OBJS) $(LIBS) -lcrypto
  1181. ./test-ms_funcs
  1182. rm test-ms_funcs
  1183. TEST_SHA1_OBJS = $(SHA1OBJS) $(MD5OBJS) tests/test_sha1.o #../src/crypto/crypto_openssl.o
  1184. test-sha1: $(TEST_SHA1_OBJS)
  1185. $(LDO) $(LDFLAGS) -o $@ $(TEST_SHA1_OBJS) $(LIBS)
  1186. ./test-sha1
  1187. rm test-sha1
  1188. TEST_SHA256_OBJS = $(SHA256OBJS) $(MD5OBJS) tests/test_sha256.o ../src/utils/os_unix.o ../src/crypto/crypto_openssl.o
  1189. test-sha256: $(TEST_SHA256_OBJS)
  1190. $(LDO) $(LDFLAGS) -o $@ $(TEST_SHA256_OBJS) $(LIBS)
  1191. ./test-sha256
  1192. rm test-sha256
  1193. TEST_AES_OBJS = tests/test_aes.o $(AESOBJS)
  1194. test-aes: $(TEST_AES_OBJS)
  1195. $(LDO) $(LDFLAGS) -o $@ $(TEST_AES_OBJS) $(LIBS)
  1196. ./test-aes
  1197. rm test-aes
  1198. TEST_EAP_SIM_COMMON_OBJS = $(SHA1OBJS) $(MD5OBJS) \
  1199. ../src/utils/common.o ../src/utils/os_unix.o \
  1200. ../src/utils/wpa_debug.o $(AESOBJS) \
  1201. tests/test_eap_sim_common.o
  1202. test-eap_sim_common: $(TEST_EAP_SIM_COMMON_OBJS)
  1203. $(LDO) $(LDFLAGS) -o $@ $(TEST_EAP_SIM_COMMON_OBJS) $(LIBS)
  1204. ./test-eap_sim_common
  1205. rm test-eap_sim_common
  1206. TEST_MD5_OBJS = $(MD5OBJS) tests/test_md5.o #../src/crypto/crypto_openssl.o
  1207. test-md5: $(TEST_MD5_OBJS)
  1208. $(LDO) $(LDFLAGS) -o $@ $(TEST_MD5_OBJS) $(LIBS)
  1209. ./test-md5
  1210. rm test-md5
  1211. tests: test-ms_funcs test-sha1 test-aes test-eap_sim_common test-md5
  1212. clean:
  1213. $(MAKE) -C ../src clean
  1214. rm -f core *~ *.o *.d eap_*.so $(ALL) $(WINALL) eapol_test preauth_test
  1215. rm -f wpa_priv
  1216. -include $(OBJS:%.o=%.d)