Makefile 29 KB

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