Makefile 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831
  1. ifndef CC
  2. CC=gcc
  3. endif
  4. ifndef CFLAGS
  5. CFLAGS = -MMD -O2 -Wall -g
  6. endif
  7. ifdef LIBS
  8. # If LIBS is set with some global build system defaults, clone those for
  9. # LIBS_c and LIBS_p to cover wpa_passphrase and wpa_cli as well.
  10. ifndef LIBS_c
  11. LIBS_c := $(LIBS)
  12. endif
  13. ifndef LIBS_p
  14. LIBS_p := $(LIBS)
  15. endif
  16. endif
  17. export LIBDIR ?= /usr/local/lib/
  18. export INCDIR ?= /usr/local/include/
  19. export BINDIR ?= /usr/local/sbin/
  20. PKG_CONFIG ?= pkg-config
  21. CFLAGS += $(EXTRA_CFLAGS)
  22. CFLAGS += -I$(abspath ../src)
  23. CFLAGS += -I$(abspath ../src/utils)
  24. -include .config
  25. ifndef CONFIG_NO_GITVER
  26. # Add VERSION_STR postfix for builds from a git repository
  27. ifeq ($(wildcard ../.git),../.git)
  28. GITVER := $(shell git describe --dirty=+)
  29. ifneq ($(GITVER),)
  30. CFLAGS += -DGIT_VERSION_STR_POSTFIX=\"-$(GITVER)\"
  31. endif
  32. endif
  33. endif
  34. ifdef CONFIG_TESTING_OPTIONS
  35. CFLAGS += -DCONFIG_TESTING_OPTIONS
  36. CONFIG_WPS_TESTING=y
  37. CONFIG_TDLS_TESTING=y
  38. endif
  39. BINALL=wpa_supplicant wpa_cli
  40. ifndef CONFIG_NO_WPA_PASSPHRASE
  41. BINALL += wpa_passphrase
  42. endif
  43. ALL = $(BINALL)
  44. ALL += systemd/wpa_supplicant.service
  45. ALL += systemd/wpa_supplicant@.service
  46. ALL += systemd/wpa_supplicant-nl80211@.service
  47. ALL += systemd/wpa_supplicant-wired@.service
  48. ALL += dbus/fi.epitest.hostap.WPASupplicant.service
  49. ALL += dbus/fi.w1.wpa_supplicant1.service
  50. ifdef CONFIG_BUILD_WPA_CLIENT_SO
  51. ALL += libwpa_client.so
  52. endif
  53. all: verify_config $(ALL) dynamic_eap_methods
  54. verify_config:
  55. @if [ ! -r .config ]; then \
  56. echo 'Building wpa_supplicant requires a configuration file'; \
  57. echo '(.config). See README for more instructions. You can'; \
  58. echo 'run "cp defconfig .config" to create an example'; \
  59. echo 'configuration.'; \
  60. exit 1; \
  61. fi
  62. mkconfig:
  63. @if [ -f .config ]; then \
  64. echo '.config exists - did not replace it'; \
  65. exit 1; \
  66. fi
  67. echo CONFIG_DRIVER_HOSTAP=y >> .config
  68. echo CONFIG_DRIVER_WEXT=y >> .config
  69. $(DESTDIR)$(BINDIR)/%: %
  70. install -D $(<) $(@)
  71. install: $(addprefix $(DESTDIR)$(BINDIR)/,$(BINALL))
  72. $(MAKE) -C ../src install
  73. ifdef CONFIG_BUILD_WPA_CLIENT_SO
  74. install -m 0644 -D libwpa_client.so $(DESTDIR)/$(LIBDIR)/libwpa_client.so
  75. install -m 0644 -D ../src/common/wpa_ctrl.h $(DESTDIR)/$(INCDIR)/wpa_ctrl.h
  76. endif
  77. ifdef CONFIG_FIPS
  78. CONFIG_NO_RANDOM_POOL=
  79. CONFIG_OPENSSL_CMAC=y
  80. endif
  81. OBJS = config.o
  82. OBJS += notify.o
  83. OBJS += bss.o
  84. OBJS += eap_register.o
  85. OBJS += ../src/utils/common.o
  86. OBJS += ../src/utils/wpa_debug.o
  87. OBJS += ../src/utils/wpabuf.o
  88. OBJS_p = wpa_passphrase.o
  89. OBJS_p += ../src/utils/common.o
  90. OBJS_p += ../src/utils/wpa_debug.o
  91. OBJS_p += ../src/utils/wpabuf.o
  92. OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
  93. OBJS_c += ../src/utils/wpa_debug.o
  94. OBJS_c += ../src/utils/common.o
  95. OBJS += wmm_ac.o
  96. ifndef CONFIG_OS
  97. ifdef CONFIG_NATIVE_WINDOWS
  98. CONFIG_OS=win32
  99. else
  100. CONFIG_OS=unix
  101. endif
  102. endif
  103. ifeq ($(CONFIG_OS), internal)
  104. CFLAGS += -DOS_NO_C_LIB_DEFINES
  105. endif
  106. OBJS += ../src/utils/os_$(CONFIG_OS).o
  107. OBJS_p += ../src/utils/os_$(CONFIG_OS).o
  108. OBJS_c += ../src/utils/os_$(CONFIG_OS).o
  109. ifdef CONFIG_WPA_TRACE
  110. CFLAGS += -DWPA_TRACE
  111. OBJS += ../src/utils/trace.o
  112. OBJS_p += ../src/utils/trace.o
  113. OBJS_c += ../src/utils/trace.o
  114. OBJS_priv += ../src/utils/trace.o
  115. LIBCTRL += ../src/utils/trace.o
  116. LIBCTRLSO += ../src/utils/trace.c
  117. LDFLAGS += -rdynamic
  118. CFLAGS += -funwind-tables
  119. ifdef CONFIG_WPA_TRACE_BFD
  120. CFLAGS += -DPACKAGE="wpa_supplicant" -DWPA_TRACE_BFD
  121. LIBS += -lbfd -ldl -liberty -lz
  122. LIBS_p += -lbfd -ldl -liberty -lz
  123. LIBS_c += -lbfd -ldl -liberty -lz
  124. endif
  125. endif
  126. ifndef CONFIG_ELOOP
  127. CONFIG_ELOOP=eloop
  128. endif
  129. OBJS += ../src/utils/$(CONFIG_ELOOP).o
  130. OBJS_c += ../src/utils/$(CONFIG_ELOOP).o
  131. ifndef CONFIG_OSX
  132. ifeq ($(CONFIG_ELOOP), eloop)
  133. # Using glibc < 2.17 requires -lrt for clock_gettime()
  134. # OS X has an alternate implementation
  135. LIBS += -lrt
  136. LIBS_c += -lrt
  137. LIBS_p += -lrt
  138. endif
  139. endif
  140. ifdef CONFIG_ELOOP_POLL
  141. CFLAGS += -DCONFIG_ELOOP_POLL
  142. endif
  143. ifdef CONFIG_ELOOP_EPOLL
  144. CFLAGS += -DCONFIG_ELOOP_EPOLL
  145. endif
  146. ifdef CONFIG_ELOOP_KQUEUE
  147. CFLAGS += -DCONFIG_ELOOP_KQUEUE
  148. endif
  149. ifdef CONFIG_EAPOL_TEST
  150. CFLAGS += -Werror -DEAPOL_TEST
  151. endif
  152. ifdef CONFIG_CODE_COVERAGE
  153. CFLAGS += -O0 -fprofile-arcs -ftest-coverage
  154. LIBS += -lgcov
  155. LIBS_c += -lgcov
  156. LIBS_p += -lgcov
  157. endif
  158. ifdef CONFIG_HT_OVERRIDES
  159. CFLAGS += -DCONFIG_HT_OVERRIDES
  160. endif
  161. ifdef CONFIG_VHT_OVERRIDES
  162. CFLAGS += -DCONFIG_VHT_OVERRIDES
  163. endif
  164. ifndef CONFIG_BACKEND
  165. CONFIG_BACKEND=file
  166. endif
  167. ifeq ($(CONFIG_BACKEND), file)
  168. OBJS += config_file.o
  169. ifndef CONFIG_NO_CONFIG_BLOBS
  170. NEED_BASE64=y
  171. endif
  172. CFLAGS += -DCONFIG_BACKEND_FILE
  173. endif
  174. ifeq ($(CONFIG_BACKEND), winreg)
  175. OBJS += config_winreg.o
  176. endif
  177. ifeq ($(CONFIG_BACKEND), none)
  178. OBJS += config_none.o
  179. endif
  180. ifdef CONFIG_NO_CONFIG_WRITE
  181. CFLAGS += -DCONFIG_NO_CONFIG_WRITE
  182. endif
  183. ifdef CONFIG_NO_CONFIG_BLOBS
  184. CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
  185. endif
  186. ifdef CONFIG_NO_SCAN_PROCESSING
  187. CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
  188. endif
  189. ifdef CONFIG_SUITEB
  190. CFLAGS += -DCONFIG_SUITEB
  191. NEED_SHA256=y
  192. NEED_AES_OMAC1=y
  193. endif
  194. ifdef CONFIG_SUITEB192
  195. CFLAGS += -DCONFIG_SUITEB192
  196. NEED_SHA384=y
  197. endif
  198. ifdef CONFIG_IEEE80211W
  199. CFLAGS += -DCONFIG_IEEE80211W
  200. NEED_SHA256=y
  201. NEED_AES_OMAC1=y
  202. endif
  203. ifdef CONFIG_IEEE80211R
  204. CFLAGS += -DCONFIG_IEEE80211R
  205. OBJS += ../src/rsn_supp/wpa_ft.o
  206. NEED_SHA256=y
  207. NEED_AES_OMAC1=y
  208. endif
  209. ifdef CONFIG_MESH
  210. NEED_80211_COMMON=y
  211. NEED_SHA256=y
  212. NEED_AES_SIV=y
  213. NEED_AES_OMAC1=y
  214. NEED_AES_CTR=y
  215. CONFIG_SAE=y
  216. CONFIG_AP=y
  217. CFLAGS += -DCONFIG_MESH
  218. OBJS += mesh.o
  219. OBJS += mesh_mpm.o
  220. OBJS += mesh_rsn.o
  221. endif
  222. ifdef CONFIG_SAE
  223. CFLAGS += -DCONFIG_SAE
  224. OBJS += ../src/common/sae.o
  225. NEED_ECC=y
  226. NEED_DH_GROUPS=y
  227. endif
  228. ifdef CONFIG_WNM
  229. CFLAGS += -DCONFIG_WNM
  230. OBJS += wnm_sta.o
  231. endif
  232. ifdef CONFIG_TDLS
  233. CFLAGS += -DCONFIG_TDLS
  234. OBJS += ../src/rsn_supp/tdls.o
  235. NEED_SHA256=y
  236. NEED_AES_OMAC1=y
  237. endif
  238. ifdef CONFIG_TDLS_TESTING
  239. CFLAGS += -DCONFIG_TDLS_TESTING
  240. endif
  241. ifdef CONFIG_PEERKEY
  242. CFLAGS += -DCONFIG_PEERKEY
  243. endif
  244. ifndef CONFIG_NO_WPA
  245. OBJS += ../src/rsn_supp/wpa.o
  246. OBJS += ../src/rsn_supp/preauth.o
  247. OBJS += ../src/rsn_supp/pmksa_cache.o
  248. OBJS += ../src/rsn_supp/peerkey.o
  249. OBJS += ../src/rsn_supp/wpa_ie.o
  250. OBJS += ../src/common/wpa_common.o
  251. NEED_AES=y
  252. NEED_SHA1=y
  253. NEED_MD5=y
  254. NEED_RC4=y
  255. else
  256. CFLAGS += -DCONFIG_NO_WPA
  257. ifeq ($(CONFIG_TLS), internal)
  258. NEED_SHA1=y
  259. NEED_MD5=y
  260. endif
  261. endif
  262. ifdef CONFIG_IBSS_RSN
  263. NEED_RSN_AUTHENTICATOR=y
  264. CFLAGS += -DCONFIG_IBSS_RSN
  265. CFLAGS += -DCONFIG_NO_VLAN
  266. OBJS += ibss_rsn.o
  267. endif
  268. ifdef CONFIG_MATCH_IFACE
  269. CFLAGS += -DCONFIG_MATCH_IFACE
  270. endif
  271. ifdef CONFIG_P2P
  272. OBJS += p2p_supplicant.o
  273. OBJS += p2p_supplicant_sd.o
  274. OBJS += ../src/p2p/p2p.o
  275. OBJS += ../src/p2p/p2p_utils.o
  276. OBJS += ../src/p2p/p2p_parse.o
  277. OBJS += ../src/p2p/p2p_build.o
  278. OBJS += ../src/p2p/p2p_go_neg.o
  279. OBJS += ../src/p2p/p2p_sd.o
  280. OBJS += ../src/p2p/p2p_pd.o
  281. OBJS += ../src/p2p/p2p_invitation.o
  282. OBJS += ../src/p2p/p2p_dev_disc.o
  283. OBJS += ../src/p2p/p2p_group.o
  284. OBJS += ../src/ap/p2p_hostapd.o
  285. OBJS += ../src/utils/bitfield.o
  286. CFLAGS += -DCONFIG_P2P
  287. NEED_GAS=y
  288. NEED_OFFCHANNEL=y
  289. CONFIG_WPS=y
  290. CONFIG_AP=y
  291. ifdef CONFIG_P2P_STRICT
  292. CFLAGS += -DCONFIG_P2P_STRICT
  293. endif
  294. endif
  295. ifdef CONFIG_WIFI_DISPLAY
  296. CFLAGS += -DCONFIG_WIFI_DISPLAY
  297. OBJS += wifi_display.o
  298. endif
  299. ifdef CONFIG_HS20
  300. OBJS += hs20_supplicant.o
  301. CFLAGS += -DCONFIG_HS20
  302. CONFIG_INTERWORKING=y
  303. NEED_AES_OMAC1=y
  304. endif
  305. ifdef CONFIG_INTERWORKING
  306. OBJS += interworking.o
  307. CFLAGS += -DCONFIG_INTERWORKING
  308. NEED_GAS=y
  309. endif
  310. ifdef CONFIG_NO_ROAMING
  311. CFLAGS += -DCONFIG_NO_ROAMING
  312. endif
  313. include ../src/drivers/drivers.mak
  314. ifdef CONFIG_AP
  315. OBJS_d += $(DRV_BOTH_OBJS)
  316. CFLAGS += $(DRV_BOTH_CFLAGS)
  317. LDFLAGS += $(DRV_BOTH_LDFLAGS)
  318. LIBS += $(DRV_BOTH_LIBS)
  319. else
  320. NEED_AP_MLME=
  321. OBJS_d += $(DRV_WPA_OBJS)
  322. CFLAGS += $(DRV_WPA_CFLAGS)
  323. LDFLAGS += $(DRV_WPA_LDFLAGS)
  324. LIBS += $(DRV_WPA_LIBS)
  325. endif
  326. ifndef CONFIG_L2_PACKET
  327. CONFIG_L2_PACKET=linux
  328. endif
  329. OBJS_l2 += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o
  330. ifeq ($(CONFIG_L2_PACKET), pcap)
  331. ifdef CONFIG_WINPCAP
  332. CFLAGS += -DCONFIG_WINPCAP
  333. LIBS += -lwpcap -lpacket
  334. LIBS_w += -lwpcap
  335. else
  336. LIBS += -ldnet -lpcap
  337. endif
  338. endif
  339. ifeq ($(CONFIG_L2_PACKET), winpcap)
  340. LIBS += -lwpcap -lpacket
  341. LIBS_w += -lwpcap
  342. endif
  343. ifeq ($(CONFIG_L2_PACKET), freebsd)
  344. LIBS += -lpcap
  345. endif
  346. ifdef CONFIG_ERP
  347. CFLAGS += -DCONFIG_ERP
  348. NEED_SHA256=y
  349. NEED_HMAC_SHA256_KDF=y
  350. endif
  351. ifdef CONFIG_EAP_TLS
  352. # EAP-TLS
  353. ifeq ($(CONFIG_EAP_TLS), dyn)
  354. CFLAGS += -DEAP_TLS_DYNAMIC
  355. EAPDYN += ../src/eap_peer/eap_tls.so
  356. else
  357. CFLAGS += -DEAP_TLS
  358. OBJS += ../src/eap_peer/eap_tls.o
  359. endif
  360. TLS_FUNCS=y
  361. CONFIG_IEEE8021X_EAPOL=y
  362. endif
  363. ifdef CONFIG_EAP_UNAUTH_TLS
  364. # EAP-UNAUTH-TLS
  365. CFLAGS += -DEAP_UNAUTH_TLS
  366. ifndef CONFIG_EAP_TLS
  367. OBJS += ../src/eap_peer/eap_tls.o
  368. TLS_FUNCS=y
  369. endif
  370. CONFIG_IEEE8021X_EAPOL=y
  371. endif
  372. ifdef CONFIG_EAP_PEAP
  373. # EAP-PEAP
  374. ifeq ($(CONFIG_EAP_PEAP), dyn)
  375. CFLAGS += -DEAP_PEAP_DYNAMIC
  376. EAPDYN += ../src/eap_peer/eap_peap.so
  377. else
  378. CFLAGS += -DEAP_PEAP
  379. OBJS += ../src/eap_peer/eap_peap.o
  380. OBJS += ../src/eap_common/eap_peap_common.o
  381. endif
  382. TLS_FUNCS=y
  383. CONFIG_IEEE8021X_EAPOL=y
  384. endif
  385. ifdef CONFIG_EAP_TTLS
  386. # EAP-TTLS
  387. ifeq ($(CONFIG_EAP_TTLS), dyn)
  388. CFLAGS += -DEAP_TTLS_DYNAMIC
  389. EAPDYN += ../src/eap_peer/eap_ttls.so
  390. else
  391. CFLAGS += -DEAP_TTLS
  392. OBJS += ../src/eap_peer/eap_ttls.o
  393. endif
  394. TLS_FUNCS=y
  395. ifndef CONFIG_FIPS
  396. MS_FUNCS=y
  397. CHAP=y
  398. endif
  399. CONFIG_IEEE8021X_EAPOL=y
  400. endif
  401. ifdef CONFIG_EAP_MD5
  402. # EAP-MD5
  403. ifeq ($(CONFIG_EAP_MD5), dyn)
  404. CFLAGS += -DEAP_MD5_DYNAMIC
  405. EAPDYN += ../src/eap_peer/eap_md5.so
  406. else
  407. CFLAGS += -DEAP_MD5
  408. OBJS += ../src/eap_peer/eap_md5.o
  409. endif
  410. CHAP=y
  411. CONFIG_IEEE8021X_EAPOL=y
  412. endif
  413. # backwards compatibility for old spelling
  414. ifdef CONFIG_MSCHAPV2
  415. ifndef CONFIG_EAP_MSCHAPV2
  416. CONFIG_EAP_MSCHAPV2=y
  417. endif
  418. endif
  419. ifdef CONFIG_EAP_MSCHAPV2
  420. # EAP-MSCHAPv2
  421. ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
  422. CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
  423. EAPDYN += ../src/eap_peer/eap_mschapv2.so
  424. EAPDYN += ../src/eap_peer/mschapv2.so
  425. else
  426. CFLAGS += -DEAP_MSCHAPv2
  427. OBJS += ../src/eap_peer/eap_mschapv2.o
  428. OBJS += ../src/eap_peer/mschapv2.o
  429. endif
  430. MS_FUNCS=y
  431. CONFIG_IEEE8021X_EAPOL=y
  432. endif
  433. ifdef CONFIG_EAP_GTC
  434. # EAP-GTC
  435. ifeq ($(CONFIG_EAP_GTC), dyn)
  436. CFLAGS += -DEAP_GTC_DYNAMIC
  437. EAPDYN += ../src/eap_peer/eap_gtc.so
  438. else
  439. CFLAGS += -DEAP_GTC
  440. OBJS += ../src/eap_peer/eap_gtc.o
  441. endif
  442. CONFIG_IEEE8021X_EAPOL=y
  443. endif
  444. ifdef CONFIG_EAP_OTP
  445. # EAP-OTP
  446. ifeq ($(CONFIG_EAP_OTP), dyn)
  447. CFLAGS += -DEAP_OTP_DYNAMIC
  448. EAPDYN += ../src/eap_peer/eap_otp.so
  449. else
  450. CFLAGS += -DEAP_OTP
  451. OBJS += ../src/eap_peer/eap_otp.o
  452. endif
  453. CONFIG_IEEE8021X_EAPOL=y
  454. endif
  455. ifdef CONFIG_EAP_SIM
  456. # EAP-SIM
  457. ifeq ($(CONFIG_EAP_SIM), dyn)
  458. CFLAGS += -DEAP_SIM_DYNAMIC
  459. EAPDYN += ../src/eap_peer/eap_sim.so
  460. else
  461. CFLAGS += -DEAP_SIM
  462. OBJS += ../src/eap_peer/eap_sim.o
  463. endif
  464. CONFIG_IEEE8021X_EAPOL=y
  465. CONFIG_EAP_SIM_COMMON=y
  466. NEED_AES_CBC=y
  467. endif
  468. ifdef CONFIG_EAP_LEAP
  469. # EAP-LEAP
  470. ifeq ($(CONFIG_EAP_LEAP), dyn)
  471. CFLAGS += -DEAP_LEAP_DYNAMIC
  472. EAPDYN += ../src/eap_peer/eap_leap.so
  473. else
  474. CFLAGS += -DEAP_LEAP
  475. OBJS += ../src/eap_peer/eap_leap.o
  476. endif
  477. MS_FUNCS=y
  478. CONFIG_IEEE8021X_EAPOL=y
  479. endif
  480. ifdef CONFIG_EAP_PSK
  481. # EAP-PSK
  482. ifeq ($(CONFIG_EAP_PSK), dyn)
  483. CFLAGS += -DEAP_PSK_DYNAMIC
  484. EAPDYN += ../src/eap_peer/eap_psk.so
  485. else
  486. CFLAGS += -DEAP_PSK
  487. OBJS += ../src/eap_peer/eap_psk.o ../src/eap_common/eap_psk_common.o
  488. endif
  489. CONFIG_IEEE8021X_EAPOL=y
  490. NEED_AES=y
  491. NEED_AES_OMAC1=y
  492. NEED_AES_ENCBLOCK=y
  493. NEED_AES_EAX=y
  494. endif
  495. ifdef CONFIG_EAP_AKA
  496. # EAP-AKA
  497. ifeq ($(CONFIG_EAP_AKA), dyn)
  498. CFLAGS += -DEAP_AKA_DYNAMIC
  499. EAPDYN += ../src/eap_peer/eap_aka.so
  500. else
  501. CFLAGS += -DEAP_AKA
  502. OBJS += ../src/eap_peer/eap_aka.o
  503. endif
  504. CONFIG_IEEE8021X_EAPOL=y
  505. CONFIG_EAP_SIM_COMMON=y
  506. NEED_AES_CBC=y
  507. endif
  508. ifdef CONFIG_EAP_PROXY
  509. CFLAGS += -DCONFIG_EAP_PROXY
  510. OBJS += ../src/eap_peer/eap_proxy_$(CONFIG_EAP_PROXY).o
  511. include eap_proxy_$(CONFIG_EAP_PROXY).mak
  512. CONFIG_IEEE8021X_EAPOL=y
  513. endif
  514. ifdef CONFIG_EAP_AKA_PRIME
  515. # EAP-AKA'
  516. ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
  517. CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
  518. else
  519. CFLAGS += -DEAP_AKA_PRIME
  520. endif
  521. NEED_SHA256=y
  522. endif
  523. ifdef CONFIG_EAP_SIM_COMMON
  524. OBJS += ../src/eap_common/eap_sim_common.o
  525. NEED_AES=y
  526. NEED_FIPS186_2_PRF=y
  527. endif
  528. ifdef CONFIG_EAP_FAST
  529. # EAP-FAST
  530. ifeq ($(CONFIG_EAP_FAST), dyn)
  531. CFLAGS += -DEAP_FAST_DYNAMIC
  532. EAPDYN += ../src/eap_peer/eap_fast.so
  533. EAPDYN += ../src/eap_common/eap_fast_common.o
  534. else
  535. CFLAGS += -DEAP_FAST
  536. OBJS += ../src/eap_peer/eap_fast.o ../src/eap_peer/eap_fast_pac.o
  537. OBJS += ../src/eap_common/eap_fast_common.o
  538. endif
  539. TLS_FUNCS=y
  540. CONFIG_IEEE8021X_EAPOL=y
  541. NEED_T_PRF=y
  542. endif
  543. ifdef CONFIG_EAP_PAX
  544. # EAP-PAX
  545. ifeq ($(CONFIG_EAP_PAX), dyn)
  546. CFLAGS += -DEAP_PAX_DYNAMIC
  547. EAPDYN += ../src/eap_peer/eap_pax.so
  548. else
  549. CFLAGS += -DEAP_PAX
  550. OBJS += ../src/eap_peer/eap_pax.o ../src/eap_common/eap_pax_common.o
  551. endif
  552. CONFIG_IEEE8021X_EAPOL=y
  553. endif
  554. ifdef CONFIG_EAP_SAKE
  555. # EAP-SAKE
  556. ifeq ($(CONFIG_EAP_SAKE), dyn)
  557. CFLAGS += -DEAP_SAKE_DYNAMIC
  558. EAPDYN += ../src/eap_peer/eap_sake.so
  559. else
  560. CFLAGS += -DEAP_SAKE
  561. OBJS += ../src/eap_peer/eap_sake.o ../src/eap_common/eap_sake_common.o
  562. endif
  563. CONFIG_IEEE8021X_EAPOL=y
  564. endif
  565. ifdef CONFIG_EAP_GPSK
  566. # EAP-GPSK
  567. ifeq ($(CONFIG_EAP_GPSK), dyn)
  568. CFLAGS += -DEAP_GPSK_DYNAMIC
  569. EAPDYN += ../src/eap_peer/eap_gpsk.so
  570. else
  571. CFLAGS += -DEAP_GPSK
  572. OBJS += ../src/eap_peer/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o
  573. endif
  574. CONFIG_IEEE8021X_EAPOL=y
  575. ifdef CONFIG_EAP_GPSK_SHA256
  576. CFLAGS += -DEAP_GPSK_SHA256
  577. endif
  578. NEED_SHA256=y
  579. NEED_AES_OMAC1=y
  580. endif
  581. ifdef CONFIG_EAP_PWD
  582. CFLAGS += -DEAP_PWD
  583. OBJS += ../src/eap_peer/eap_pwd.o ../src/eap_common/eap_pwd_common.o
  584. CONFIG_IEEE8021X_EAPOL=y
  585. NEED_SHA256=y
  586. endif
  587. ifdef CONFIG_EAP_EKE
  588. # EAP-EKE
  589. ifeq ($(CONFIG_EAP_EKE), dyn)
  590. CFLAGS += -DEAP_EKE_DYNAMIC
  591. EAPDYN += ../src/eap_peer/eap_eke.so
  592. else
  593. CFLAGS += -DEAP_EKE
  594. OBJS += ../src/eap_peer/eap_eke.o ../src/eap_common/eap_eke_common.o
  595. endif
  596. CONFIG_IEEE8021X_EAPOL=y
  597. NEED_DH_GROUPS=y
  598. NEED_DH_GROUPS_ALL=y
  599. NEED_SHA256=y
  600. NEED_AES_CBC=y
  601. endif
  602. ifdef CONFIG_WPS
  603. # EAP-WSC
  604. CFLAGS += -DCONFIG_WPS -DEAP_WSC
  605. OBJS += wps_supplicant.o
  606. OBJS += ../src/utils/uuid.o
  607. OBJS += ../src/eap_peer/eap_wsc.o ../src/eap_common/eap_wsc_common.o
  608. OBJS += ../src/wps/wps.o
  609. OBJS += ../src/wps/wps_common.o
  610. OBJS += ../src/wps/wps_attr_parse.o
  611. OBJS += ../src/wps/wps_attr_build.o
  612. OBJS += ../src/wps/wps_attr_process.o
  613. OBJS += ../src/wps/wps_dev_attr.o
  614. OBJS += ../src/wps/wps_enrollee.o
  615. OBJS += ../src/wps/wps_registrar.o
  616. CONFIG_IEEE8021X_EAPOL=y
  617. NEED_DH_GROUPS=y
  618. NEED_SHA256=y
  619. NEED_BASE64=y
  620. NEED_AES_CBC=y
  621. NEED_MODEXP=y
  622. ifdef CONFIG_WPS_NFC
  623. CFLAGS += -DCONFIG_WPS_NFC
  624. OBJS += ../src/wps/ndef.o
  625. NEED_WPS_OOB=y
  626. endif
  627. ifdef NEED_WPS_OOB
  628. CFLAGS += -DCONFIG_WPS_OOB
  629. endif
  630. ifdef CONFIG_WPS_ER
  631. CONFIG_WPS_UPNP=y
  632. CFLAGS += -DCONFIG_WPS_ER
  633. OBJS += ../src/wps/wps_er.o
  634. OBJS += ../src/wps/wps_er_ssdp.o
  635. endif
  636. ifdef CONFIG_WPS_UPNP
  637. CFLAGS += -DCONFIG_WPS_UPNP
  638. OBJS += ../src/wps/wps_upnp.o
  639. OBJS += ../src/wps/wps_upnp_ssdp.o
  640. OBJS += ../src/wps/wps_upnp_web.o
  641. OBJS += ../src/wps/wps_upnp_event.o
  642. OBJS += ../src/wps/wps_upnp_ap.o
  643. OBJS += ../src/wps/upnp_xml.o
  644. OBJS += ../src/wps/httpread.o
  645. OBJS += ../src/wps/http_client.o
  646. OBJS += ../src/wps/http_server.o
  647. endif
  648. ifdef CONFIG_WPS_STRICT
  649. CFLAGS += -DCONFIG_WPS_STRICT
  650. OBJS += ../src/wps/wps_validate.o
  651. endif
  652. ifdef CONFIG_WPS_TESTING
  653. CFLAGS += -DCONFIG_WPS_TESTING
  654. endif
  655. ifdef CONFIG_WPS_REG_DISABLE_OPEN
  656. CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
  657. endif
  658. endif
  659. ifdef CONFIG_EAP_IKEV2
  660. # EAP-IKEv2
  661. ifeq ($(CONFIG_EAP_IKEV2), dyn)
  662. CFLAGS += -DEAP_IKEV2_DYNAMIC
  663. EAPDYN += ../src/eap_peer/eap_ikev2.so ../src/eap_peer/ikev2.o
  664. EAPDYN += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  665. else
  666. CFLAGS += -DEAP_IKEV2
  667. OBJS += ../src/eap_peer/eap_ikev2.o ../src/eap_peer/ikev2.o
  668. OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  669. endif
  670. CONFIG_IEEE8021X_EAPOL=y
  671. NEED_DH_GROUPS=y
  672. NEED_DH_GROUPS_ALL=y
  673. NEED_MODEXP=y
  674. NEED_CIPHER=y
  675. endif
  676. ifdef CONFIG_EAP_VENDOR_TEST
  677. ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
  678. CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
  679. EAPDYN += ../src/eap_peer/eap_vendor_test.so
  680. else
  681. CFLAGS += -DEAP_VENDOR_TEST
  682. OBJS += ../src/eap_peer/eap_vendor_test.o
  683. endif
  684. CONFIG_IEEE8021X_EAPOL=y
  685. endif
  686. ifdef CONFIG_EAP_TNC
  687. # EAP-TNC
  688. CFLAGS += -DEAP_TNC
  689. OBJS += ../src/eap_peer/eap_tnc.o
  690. OBJS += ../src/eap_peer/tncc.o
  691. NEED_BASE64=y
  692. ifndef CONFIG_NATIVE_WINDOWS
  693. ifndef CONFIG_DRIVER_BSD
  694. LIBS += -ldl
  695. endif
  696. endif
  697. endif
  698. ifdef CONFIG_IEEE8021X_EAPOL
  699. # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
  700. CFLAGS += -DIEEE8021X_EAPOL
  701. OBJS += ../src/eapol_supp/eapol_supp_sm.o
  702. OBJS += ../src/eap_peer/eap.o ../src/eap_peer/eap_methods.o
  703. NEED_EAP_COMMON=y
  704. ifdef CONFIG_DYNAMIC_EAP_METHODS
  705. CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  706. LIBS += -ldl -rdynamic
  707. endif
  708. endif
  709. ifdef CONFIG_MACSEC
  710. CFLAGS += -DCONFIG_MACSEC
  711. NEED_AES_ENCBLOCK=y
  712. NEED_AES_UNWRAP=y
  713. NEED_AES_WRAP=y
  714. NEED_AES_OMAC1=y
  715. OBJS += wpas_kay.o
  716. OBJS += ../src/pae/ieee802_1x_cp.o
  717. OBJS += ../src/pae/ieee802_1x_kay.o
  718. OBJS += ../src/pae/ieee802_1x_key.o
  719. OBJS += ../src/pae/ieee802_1x_secy_ops.o
  720. endif
  721. ifdef CONFIG_AP
  722. NEED_EAP_COMMON=y
  723. NEED_RSN_AUTHENTICATOR=y
  724. CFLAGS += -DCONFIG_AP
  725. OBJS += ap.o
  726. CFLAGS += -DCONFIG_NO_RADIUS
  727. CFLAGS += -DCONFIG_NO_ACCOUNTING
  728. CFLAGS += -DCONFIG_NO_VLAN
  729. OBJS += ../src/ap/hostapd.o
  730. OBJS += ../src/ap/wpa_auth_glue.o
  731. OBJS += ../src/ap/utils.o
  732. OBJS += ../src/ap/authsrv.o
  733. OBJS += ../src/ap/ap_config.o
  734. OBJS += ../src/utils/ip_addr.o
  735. OBJS += ../src/ap/sta_info.o
  736. OBJS += ../src/ap/tkip_countermeasures.o
  737. OBJS += ../src/ap/ap_mlme.o
  738. OBJS += ../src/ap/ieee802_1x.o
  739. OBJS += ../src/eapol_auth/eapol_auth_sm.o
  740. OBJS += ../src/ap/ieee802_11_auth.o
  741. OBJS += ../src/ap/ieee802_11_shared.o
  742. OBJS += ../src/ap/drv_callbacks.o
  743. OBJS += ../src/ap/ap_drv_ops.o
  744. OBJS += ../src/ap/beacon.o
  745. OBJS += ../src/ap/bss_load.o
  746. OBJS += ../src/ap/eap_user_db.o
  747. OBJS += ../src/ap/neighbor_db.o
  748. OBJS += ../src/ap/rrm.o
  749. ifdef CONFIG_IEEE80211N
  750. OBJS += ../src/ap/ieee802_11_ht.o
  751. ifdef CONFIG_IEEE80211AC
  752. OBJS += ../src/ap/ieee802_11_vht.o
  753. endif
  754. endif
  755. ifdef CONFIG_WNM
  756. OBJS += ../src/ap/wnm_ap.o
  757. endif
  758. ifdef CONFIG_MBO
  759. OBJS += ../src/ap/mbo_ap.o
  760. endif
  761. ifdef CONFIG_CTRL_IFACE
  762. OBJS += ../src/ap/ctrl_iface_ap.o
  763. endif
  764. CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
  765. OBJS += ../src/eap_server/eap_server.o
  766. OBJS += ../src/eap_server/eap_server_identity.o
  767. OBJS += ../src/eap_server/eap_server_methods.o
  768. ifdef CONFIG_IEEE80211N
  769. CFLAGS += -DCONFIG_IEEE80211N
  770. ifdef CONFIG_IEEE80211AC
  771. CFLAGS += -DCONFIG_IEEE80211AC
  772. endif
  773. endif
  774. ifdef CONFIG_MBO
  775. OBJS += mbo.o
  776. CFLAGS += -DCONFIG_MBO
  777. endif
  778. ifdef NEED_AP_MLME
  779. OBJS += ../src/ap/wmm.o
  780. OBJS += ../src/ap/ap_list.o
  781. OBJS += ../src/ap/ieee802_11.o
  782. OBJS += ../src/ap/hw_features.o
  783. OBJS += ../src/ap/dfs.o
  784. CFLAGS += -DNEED_AP_MLME
  785. endif
  786. ifdef CONFIG_WPS
  787. CFLAGS += -DEAP_SERVER_WSC
  788. OBJS += ../src/ap/wps_hostapd.o
  789. OBJS += ../src/eap_server/eap_server_wsc.o
  790. endif
  791. ifdef CONFIG_INTERWORKING
  792. OBJS += ../src/ap/gas_serv.o
  793. endif
  794. ifdef CONFIG_HS20
  795. OBJS += ../src/ap/hs20.o
  796. endif
  797. endif
  798. ifdef NEED_RSN_AUTHENTICATOR
  799. CFLAGS += -DCONFIG_NO_RADIUS
  800. NEED_AES_WRAP=y
  801. OBJS += ../src/ap/wpa_auth.o
  802. OBJS += ../src/ap/wpa_auth_ie.o
  803. OBJS += ../src/ap/pmksa_cache_auth.o
  804. ifdef CONFIG_IEEE80211R
  805. OBJS += ../src/ap/wpa_auth_ft.o
  806. endif
  807. ifdef CONFIG_PEERKEY
  808. OBJS += ../src/ap/peerkey_auth.o
  809. endif
  810. endif
  811. ifdef CONFIG_ACS
  812. CFLAGS += -DCONFIG_ACS
  813. OBJS += ../src/ap/acs.o
  814. LIBS += -lm
  815. endif
  816. ifdef CONFIG_PCSC
  817. # PC/SC interface for smartcards (USIM, GSM SIM)
  818. CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
  819. OBJS += ../src/utils/pcsc_funcs.o
  820. # -lpthread may not be needed depending on how pcsc-lite was configured
  821. ifdef CONFIG_NATIVE_WINDOWS
  822. #Once MinGW gets support for WinScard, -lwinscard could be used instead of the
  823. #dynamic symbol loading that is now used in pcsc_funcs.c
  824. #LIBS += -lwinscard
  825. else
  826. LIBS += -lpcsclite -lpthread
  827. endif
  828. endif
  829. ifdef CONFIG_SIM_SIMULATOR
  830. CFLAGS += -DCONFIG_SIM_SIMULATOR
  831. NEED_MILENAGE=y
  832. endif
  833. ifdef CONFIG_USIM_SIMULATOR
  834. CFLAGS += -DCONFIG_USIM_SIMULATOR
  835. NEED_MILENAGE=y
  836. endif
  837. ifdef NEED_MILENAGE
  838. OBJS += ../src/crypto/milenage.o
  839. NEED_AES_ENCBLOCK=y
  840. endif
  841. ifdef CONFIG_PKCS12
  842. CFLAGS += -DPKCS12_FUNCS
  843. endif
  844. ifdef CONFIG_SMARTCARD
  845. CFLAGS += -DCONFIG_SMARTCARD
  846. endif
  847. ifdef MS_FUNCS
  848. OBJS += ../src/crypto/ms_funcs.o
  849. NEED_DES=y
  850. NEED_MD4=y
  851. endif
  852. ifdef CHAP
  853. OBJS += ../src/eap_common/chap.o
  854. endif
  855. ifdef TLS_FUNCS
  856. NEED_DES=y
  857. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
  858. OBJS += ../src/eap_peer/eap_tls_common.o
  859. ifndef CONFIG_FIPS
  860. NEED_TLS_PRF=y
  861. NEED_SHA1=y
  862. NEED_MD5=y
  863. endif
  864. endif
  865. ifndef CONFIG_TLS
  866. CONFIG_TLS=openssl
  867. endif
  868. ifdef CONFIG_TLSV11
  869. CFLAGS += -DCONFIG_TLSV11
  870. endif
  871. ifdef CONFIG_TLSV12
  872. CFLAGS += -DCONFIG_TLSV12
  873. NEED_SHA256=y
  874. endif
  875. ifeq ($(CONFIG_TLS), openssl)
  876. ifdef TLS_FUNCS
  877. CFLAGS += -DEAP_TLS_OPENSSL
  878. OBJS += ../src/crypto/tls_openssl.o
  879. OBJS += ../src/crypto/tls_openssl_ocsp.o
  880. LIBS += -lssl
  881. endif
  882. OBJS += ../src/crypto/crypto_openssl.o
  883. OBJS_p += ../src/crypto/crypto_openssl.o
  884. OBJS_priv += ../src/crypto/crypto_openssl.o
  885. ifdef NEED_FIPS186_2_PRF
  886. OBJS += ../src/crypto/fips_prf_openssl.o
  887. endif
  888. NEED_SHA256=y
  889. NEED_TLS_PRF_SHA256=y
  890. LIBS += -lcrypto
  891. LIBS_p += -lcrypto
  892. ifdef CONFIG_TLS_ADD_DL
  893. LIBS += -ldl
  894. LIBS_p += -ldl
  895. endif
  896. endif
  897. ifeq ($(CONFIG_TLS), gnutls)
  898. ifdef TLS_FUNCS
  899. OBJS += ../src/crypto/tls_gnutls.o
  900. LIBS += -lgnutls -lgpg-error
  901. endif
  902. OBJS += ../src/crypto/crypto_gnutls.o
  903. OBJS_p += ../src/crypto/crypto_gnutls.o
  904. OBJS_priv += ../src/crypto/crypto_gnutls.o
  905. ifdef NEED_FIPS186_2_PRF
  906. OBJS += ../src/crypto/fips_prf_internal.o
  907. SHA1OBJS += ../src/crypto/sha1-internal.o
  908. endif
  909. LIBS += -lgcrypt
  910. LIBS_p += -lgcrypt
  911. CONFIG_INTERNAL_SHA256=y
  912. CONFIG_INTERNAL_RC4=y
  913. CONFIG_INTERNAL_DH_GROUP5=y
  914. endif
  915. ifeq ($(CONFIG_TLS), internal)
  916. ifndef CONFIG_CRYPTO
  917. CONFIG_CRYPTO=internal
  918. endif
  919. ifdef TLS_FUNCS
  920. OBJS += ../src/crypto/crypto_internal-rsa.o
  921. OBJS += ../src/crypto/tls_internal.o
  922. OBJS += ../src/tls/tlsv1_common.o
  923. OBJS += ../src/tls/tlsv1_record.o
  924. OBJS += ../src/tls/tlsv1_cred.o
  925. OBJS += ../src/tls/tlsv1_client.o
  926. OBJS += ../src/tls/tlsv1_client_write.o
  927. OBJS += ../src/tls/tlsv1_client_read.o
  928. OBJS += ../src/tls/tlsv1_client_ocsp.o
  929. OBJS += ../src/tls/asn1.o
  930. OBJS += ../src/tls/rsa.o
  931. OBJS += ../src/tls/x509v3.o
  932. OBJS += ../src/tls/pkcs1.o
  933. OBJS += ../src/tls/pkcs5.o
  934. OBJS += ../src/tls/pkcs8.o
  935. NEED_SHA256=y
  936. NEED_BASE64=y
  937. NEED_TLS_PRF=y
  938. ifdef CONFIG_TLSV12
  939. NEED_TLS_PRF_SHA256=y
  940. endif
  941. NEED_MODEXP=y
  942. NEED_CIPHER=y
  943. CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
  944. endif
  945. ifdef NEED_CIPHER
  946. NEED_DES=y
  947. OBJS += ../src/crypto/crypto_internal-cipher.o
  948. endif
  949. ifdef NEED_MODEXP
  950. OBJS += ../src/crypto/crypto_internal-modexp.o
  951. OBJS += ../src/tls/bignum.o
  952. endif
  953. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  954. OBJS += ../src/crypto/crypto_libtomcrypt.o
  955. OBJS_p += ../src/crypto/crypto_libtomcrypt.o
  956. LIBS += -ltomcrypt -ltfm
  957. LIBS_p += -ltomcrypt -ltfm
  958. CONFIG_INTERNAL_SHA256=y
  959. CONFIG_INTERNAL_RC4=y
  960. CONFIG_INTERNAL_DH_GROUP5=y
  961. endif
  962. ifeq ($(CONFIG_CRYPTO), internal)
  963. OBJS += ../src/crypto/crypto_internal.o
  964. OBJS_p += ../src/crypto/crypto_internal.o
  965. NEED_AES_ENC=y
  966. CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  967. ifdef CONFIG_INTERNAL_LIBTOMMATH
  968. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  969. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  970. CFLAGS += -DLTM_FAST
  971. endif
  972. else
  973. LIBS += -ltommath
  974. LIBS_p += -ltommath
  975. endif
  976. CONFIG_INTERNAL_AES=y
  977. CONFIG_INTERNAL_DES=y
  978. CONFIG_INTERNAL_SHA1=y
  979. CONFIG_INTERNAL_MD4=y
  980. CONFIG_INTERNAL_MD5=y
  981. CONFIG_INTERNAL_SHA256=y
  982. CONFIG_INTERNAL_SHA384=y
  983. CONFIG_INTERNAL_SHA512=y
  984. CONFIG_INTERNAL_RC4=y
  985. CONFIG_INTERNAL_DH_GROUP5=y
  986. endif
  987. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  988. OBJS += ../src/crypto/crypto_cryptoapi.o
  989. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  990. CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  991. CONFIG_INTERNAL_SHA256=y
  992. CONFIG_INTERNAL_RC4=y
  993. endif
  994. endif
  995. ifeq ($(CONFIG_TLS), none)
  996. ifdef TLS_FUNCS
  997. OBJS += ../src/crypto/tls_none.o
  998. CFLAGS += -DEAP_TLS_NONE
  999. CONFIG_INTERNAL_AES=y
  1000. CONFIG_INTERNAL_SHA1=y
  1001. CONFIG_INTERNAL_MD5=y
  1002. endif
  1003. OBJS += ../src/crypto/crypto_none.o
  1004. OBJS_p += ../src/crypto/crypto_none.o
  1005. CONFIG_INTERNAL_SHA256=y
  1006. CONFIG_INTERNAL_RC4=y
  1007. endif
  1008. ifdef TLS_FUNCS
  1009. ifdef CONFIG_SMARTCARD
  1010. ifndef CONFIG_NATIVE_WINDOWS
  1011. ifneq ($(CONFIG_L2_PACKET), freebsd)
  1012. LIBS += -ldl
  1013. endif
  1014. endif
  1015. endif
  1016. endif
  1017. ifndef TLS_FUNCS
  1018. OBJS += ../src/crypto/tls_none.o
  1019. ifeq ($(CONFIG_TLS), internal)
  1020. CONFIG_INTERNAL_AES=y
  1021. CONFIG_INTERNAL_SHA1=y
  1022. CONFIG_INTERNAL_MD5=y
  1023. CONFIG_INTERNAL_RC4=y
  1024. endif
  1025. endif
  1026. AESOBJS = # none so far (see below)
  1027. ifdef CONFIG_INTERNAL_AES
  1028. AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-dec.o
  1029. endif
  1030. ifneq ($(CONFIG_TLS), openssl)
  1031. NEED_INTERNAL_AES_WRAP=y
  1032. endif
  1033. ifdef CONFIG_OPENSSL_INTERNAL_AES_WRAP
  1034. # Seems to be needed at least with BoringSSL
  1035. NEED_INTERNAL_AES_WRAP=y
  1036. CFLAGS += -DCONFIG_OPENSSL_INTERNAL_AES_WRAP
  1037. endif
  1038. ifdef CONFIG_FIPS
  1039. # Have to use internal AES key wrap routines to use OpenSSL EVP since the
  1040. # OpenSSL AES_wrap_key()/AES_unwrap_key() API is not available in FIPS mode.
  1041. NEED_INTERNAL_AES_WRAP=y
  1042. endif
  1043. ifdef NEED_INTERNAL_AES_WRAP
  1044. AESOBJS += ../src/crypto/aes-unwrap.o
  1045. endif
  1046. ifdef NEED_AES_EAX
  1047. AESOBJS += ../src/crypto/aes-eax.o
  1048. NEED_AES_CTR=y
  1049. endif
  1050. ifdef NEED_AES_CTR
  1051. AESOBJS += ../src/crypto/aes-ctr.o
  1052. endif
  1053. ifdef NEED_AES_ENCBLOCK
  1054. AESOBJS += ../src/crypto/aes-encblock.o
  1055. endif
  1056. ifdef NEED_AES_OMAC1
  1057. NEED_AES_ENC=y
  1058. ifdef CONFIG_OPENSSL_CMAC
  1059. CFLAGS += -DCONFIG_OPENSSL_CMAC
  1060. else
  1061. AESOBJS += ../src/crypto/aes-omac1.o
  1062. endif
  1063. endif
  1064. ifdef NEED_AES_SIV
  1065. AESOBJS += ../src/crypto/aes-siv.o
  1066. endif
  1067. ifdef NEED_AES_WRAP
  1068. NEED_AES_ENC=y
  1069. ifdef NEED_INTERNAL_AES_WRAP
  1070. AESOBJS += ../src/crypto/aes-wrap.o
  1071. endif
  1072. endif
  1073. ifdef NEED_AES_CBC
  1074. NEED_AES_ENC=y
  1075. ifneq ($(CONFIG_TLS), openssl)
  1076. AESOBJS += ../src/crypto/aes-cbc.o
  1077. endif
  1078. endif
  1079. ifdef NEED_AES_ENC
  1080. ifdef CONFIG_INTERNAL_AES
  1081. AESOBJS += ../src/crypto/aes-internal-enc.o
  1082. endif
  1083. endif
  1084. ifdef NEED_AES
  1085. OBJS += $(AESOBJS)
  1086. endif
  1087. ifdef NEED_SHA1
  1088. ifneq ($(CONFIG_TLS), openssl)
  1089. SHA1OBJS += ../src/crypto/sha1.o
  1090. endif
  1091. SHA1OBJS += ../src/crypto/sha1-prf.o
  1092. ifdef CONFIG_INTERNAL_SHA1
  1093. SHA1OBJS += ../src/crypto/sha1-internal.o
  1094. ifdef NEED_FIPS186_2_PRF
  1095. SHA1OBJS += ../src/crypto/fips_prf_internal.o
  1096. endif
  1097. endif
  1098. ifdef CONFIG_NO_WPA_PASSPHRASE
  1099. CFLAGS += -DCONFIG_NO_PBKDF2
  1100. else
  1101. ifneq ($(CONFIG_TLS), openssl)
  1102. SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
  1103. endif
  1104. endif
  1105. ifdef NEED_T_PRF
  1106. SHA1OBJS += ../src/crypto/sha1-tprf.o
  1107. endif
  1108. ifdef NEED_TLS_PRF
  1109. SHA1OBJS += ../src/crypto/sha1-tlsprf.o
  1110. endif
  1111. endif
  1112. ifndef CONFIG_FIPS
  1113. ifneq ($(CONFIG_TLS), openssl)
  1114. MD5OBJS += ../src/crypto/md5.o
  1115. endif
  1116. endif
  1117. ifdef NEED_MD5
  1118. ifdef CONFIG_INTERNAL_MD5
  1119. MD5OBJS += ../src/crypto/md5-internal.o
  1120. endif
  1121. OBJS += $(MD5OBJS)
  1122. OBJS_p += $(MD5OBJS)
  1123. OBJS_priv += $(MD5OBJS)
  1124. endif
  1125. ifdef NEED_MD4
  1126. ifdef CONFIG_INTERNAL_MD4
  1127. OBJS += ../src/crypto/md4-internal.o
  1128. endif
  1129. endif
  1130. DESOBJS = # none needed when not internal
  1131. ifdef NEED_DES
  1132. ifdef CONFIG_INTERNAL_DES
  1133. DESOBJS += ../src/crypto/des-internal.o
  1134. endif
  1135. endif
  1136. ifdef CONFIG_NO_RC4
  1137. CFLAGS += -DCONFIG_NO_RC4
  1138. endif
  1139. ifdef NEED_RC4
  1140. ifdef CONFIG_INTERNAL_RC4
  1141. ifndef CONFIG_NO_RC4
  1142. OBJS += ../src/crypto/rc4.o
  1143. endif
  1144. endif
  1145. endif
  1146. SHA256OBJS = # none by default
  1147. ifdef NEED_SHA256
  1148. CFLAGS += -DCONFIG_SHA256
  1149. ifneq ($(CONFIG_TLS), openssl)
  1150. SHA256OBJS += ../src/crypto/sha256.o
  1151. endif
  1152. SHA256OBJS += ../src/crypto/sha256-prf.o
  1153. ifdef CONFIG_INTERNAL_SHA256
  1154. SHA256OBJS += ../src/crypto/sha256-internal.o
  1155. endif
  1156. ifdef CONFIG_INTERNAL_SHA384
  1157. CFLAGS += -DCONFIG_INTERNAL_SHA384
  1158. SHA256OBJS += ../src/crypto/sha384-internal.o
  1159. endif
  1160. ifdef CONFIG_INTERNAL_SHA512
  1161. CFLAGS += -DCONFIG_INTERNAL_SHA512
  1162. SHA256OBJS += ../src/crypto/sha512-internal.o
  1163. endif
  1164. ifdef NEED_TLS_PRF_SHA256
  1165. SHA256OBJS += ../src/crypto/sha256-tlsprf.o
  1166. endif
  1167. ifdef NEED_HMAC_SHA256_KDF
  1168. CFLAGS += -DCONFIG_HMAC_SHA256_KDF
  1169. OBJS += ../src/crypto/sha256-kdf.o
  1170. endif
  1171. OBJS += $(SHA256OBJS)
  1172. endif
  1173. ifdef NEED_SHA384
  1174. CFLAGS += -DCONFIG_SHA384
  1175. OBJS += ../src/crypto/sha384-prf.o
  1176. endif
  1177. ifdef NEED_DH_GROUPS
  1178. OBJS += ../src/crypto/dh_groups.o
  1179. endif
  1180. ifdef NEED_DH_GROUPS_ALL
  1181. CFLAGS += -DALL_DH_GROUPS
  1182. endif
  1183. ifdef CONFIG_INTERNAL_DH_GROUP5
  1184. ifdef NEED_DH_GROUPS
  1185. OBJS += ../src/crypto/dh_group5.o
  1186. endif
  1187. endif
  1188. ifdef NEED_ECC
  1189. CFLAGS += -DCONFIG_ECC
  1190. endif
  1191. ifdef CONFIG_NO_RANDOM_POOL
  1192. CFLAGS += -DCONFIG_NO_RANDOM_POOL
  1193. else
  1194. OBJS += ../src/crypto/random.o
  1195. endif
  1196. ifdef CONFIG_CTRL_IFACE
  1197. ifeq ($(CONFIG_CTRL_IFACE), y)
  1198. ifdef CONFIG_NATIVE_WINDOWS
  1199. CONFIG_CTRL_IFACE=named_pipe
  1200. else
  1201. CONFIG_CTRL_IFACE=unix
  1202. endif
  1203. endif
  1204. CFLAGS += -DCONFIG_CTRL_IFACE
  1205. ifeq ($(CONFIG_CTRL_IFACE), unix)
  1206. CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
  1207. OBJS += ../src/common/ctrl_iface_common.o
  1208. endif
  1209. ifeq ($(CONFIG_CTRL_IFACE), udp)
  1210. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1211. endif
  1212. ifeq ($(CONFIG_CTRL_IFACE), udp6)
  1213. CONFIG_CTRL_IFACE=udp
  1214. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1215. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
  1216. endif
  1217. ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
  1218. CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
  1219. endif
  1220. ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
  1221. CONFIG_CTRL_IFACE=udp
  1222. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1223. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  1224. endif
  1225. ifeq ($(CONFIG_CTRL_IFACE), udp6-remote)
  1226. CONFIG_CTRL_IFACE=udp
  1227. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1228. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  1229. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
  1230. endif
  1231. OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o
  1232. endif
  1233. ifdef CONFIG_CTRL_IFACE_DBUS
  1234. DBUS=y
  1235. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
  1236. DBUS_OBJS += dbus/dbus_old.o dbus/dbus_old_handlers.o
  1237. ifdef CONFIG_WPS
  1238. DBUS_OBJS += dbus/dbus_old_handlers_wps.o
  1239. endif
  1240. DBUS_OBJS += dbus/dbus_dict_helpers.o
  1241. ifndef DBUS_LIBS
  1242. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1243. endif
  1244. ifndef DBUS_INCLUDE
  1245. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1246. endif
  1247. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1248. endif
  1249. ifdef CONFIG_CTRL_IFACE_DBUS_NEW
  1250. DBUS=y
  1251. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
  1252. DBUS_OBJS ?= dbus/dbus_dict_helpers.o
  1253. DBUS_OBJS += dbus/dbus_new_helpers.o
  1254. DBUS_OBJS += dbus/dbus_new.o dbus/dbus_new_handlers.o
  1255. ifdef CONFIG_WPS
  1256. DBUS_OBJS += dbus/dbus_new_handlers_wps.o
  1257. endif
  1258. ifdef CONFIG_P2P
  1259. DBUS_OBJS += dbus/dbus_new_handlers_p2p.o
  1260. endif
  1261. ifndef DBUS_LIBS
  1262. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1263. endif
  1264. ifndef DBUS_INCLUDE
  1265. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1266. endif
  1267. ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
  1268. DBUS_OBJS += dbus/dbus_new_introspect.o
  1269. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
  1270. endif
  1271. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1272. endif
  1273. ifdef DBUS
  1274. DBUS_CFLAGS += -DCONFIG_DBUS
  1275. DBUS_OBJS += dbus/dbus_common.o
  1276. endif
  1277. OBJS += $(DBUS_OBJS)
  1278. CFLAGS += $(DBUS_CFLAGS)
  1279. LIBS += $(DBUS_LIBS)
  1280. ifdef CONFIG_READLINE
  1281. OBJS_c += ../src/utils/edit_readline.o
  1282. LIBS_c += -lreadline -lncurses
  1283. else
  1284. ifdef CONFIG_WPA_CLI_EDIT
  1285. OBJS_c += ../src/utils/edit.o
  1286. else
  1287. OBJS_c += ../src/utils/edit_simple.o
  1288. endif
  1289. endif
  1290. ifdef CONFIG_NATIVE_WINDOWS
  1291. CFLAGS += -DCONFIG_NATIVE_WINDOWS
  1292. LIBS += -lws2_32 -lgdi32 -lcrypt32
  1293. LIBS_c += -lws2_32
  1294. LIBS_p += -lws2_32 -lgdi32
  1295. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  1296. LIBS_p += -lcrypt32
  1297. endif
  1298. endif
  1299. ifdef CONFIG_NO_STDOUT_DEBUG
  1300. CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  1301. ifndef CONFIG_CTRL_IFACE
  1302. CFLAGS += -DCONFIG_NO_WPA_MSG
  1303. endif
  1304. endif
  1305. ifdef CONFIG_IPV6
  1306. # for eapol_test only
  1307. CFLAGS += -DCONFIG_IPV6
  1308. endif
  1309. ifdef CONFIG_NO_LINUX_PACKET_SOCKET_WAR
  1310. CFLAGS += -DCONFIG_NO_LINUX_PACKET_SOCKET_WAR
  1311. endif
  1312. ifdef NEED_BASE64
  1313. OBJS += ../src/utils/base64.o
  1314. endif
  1315. ifdef NEED_SME
  1316. OBJS += sme.o
  1317. CFLAGS += -DCONFIG_SME
  1318. endif
  1319. OBJS += ../src/common/ieee802_11_common.o
  1320. OBJS += ../src/common/hw_features_common.o
  1321. ifdef NEED_EAP_COMMON
  1322. OBJS += ../src/eap_common/eap_common.o
  1323. endif
  1324. ifndef CONFIG_MAIN
  1325. CONFIG_MAIN=main
  1326. endif
  1327. ifdef CONFIG_DEBUG_SYSLOG
  1328. CFLAGS += -DCONFIG_DEBUG_SYSLOG
  1329. ifdef CONFIG_DEBUG_SYSLOG_FACILITY
  1330. CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
  1331. endif
  1332. endif
  1333. ifdef CONFIG_DEBUG_LINUX_TRACING
  1334. CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
  1335. endif
  1336. ifdef CONFIG_DEBUG_FILE
  1337. CFLAGS += -DCONFIG_DEBUG_FILE
  1338. endif
  1339. ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
  1340. CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
  1341. endif
  1342. ifdef CONFIG_FIPS
  1343. CFLAGS += -DCONFIG_FIPS
  1344. ifneq ($(CONFIG_TLS), openssl)
  1345. $(error CONFIG_FIPS=y requires CONFIG_TLS=openssl)
  1346. endif
  1347. endif
  1348. OBJS += $(SHA1OBJS) $(DESOBJS)
  1349. OBJS_p += $(SHA1OBJS)
  1350. OBJS_p += $(SHA256OBJS)
  1351. OBJS_priv += $(SHA1OBJS)
  1352. ifdef CONFIG_BGSCAN_SIMPLE
  1353. CFLAGS += -DCONFIG_BGSCAN_SIMPLE
  1354. OBJS += bgscan_simple.o
  1355. NEED_BGSCAN=y
  1356. endif
  1357. ifdef CONFIG_BGSCAN_LEARN
  1358. CFLAGS += -DCONFIG_BGSCAN_LEARN
  1359. OBJS += bgscan_learn.o
  1360. NEED_BGSCAN=y
  1361. endif
  1362. ifdef NEED_BGSCAN
  1363. CFLAGS += -DCONFIG_BGSCAN
  1364. OBJS += bgscan.o
  1365. endif
  1366. ifdef CONFIG_AUTOSCAN_EXPONENTIAL
  1367. CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL
  1368. OBJS += autoscan_exponential.o
  1369. NEED_AUTOSCAN=y
  1370. endif
  1371. ifdef CONFIG_AUTOSCAN_PERIODIC
  1372. CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC
  1373. OBJS += autoscan_periodic.o
  1374. NEED_AUTOSCAN=y
  1375. endif
  1376. ifdef NEED_AUTOSCAN
  1377. CFLAGS += -DCONFIG_AUTOSCAN
  1378. OBJS += autoscan.o
  1379. endif
  1380. ifdef CONFIG_EXT_PASSWORD_TEST
  1381. OBJS += ../src/utils/ext_password_test.o
  1382. CFLAGS += -DCONFIG_EXT_PASSWORD_TEST
  1383. NEED_EXT_PASSWORD=y
  1384. endif
  1385. ifdef NEED_EXT_PASSWORD
  1386. OBJS += ../src/utils/ext_password.o
  1387. CFLAGS += -DCONFIG_EXT_PASSWORD
  1388. endif
  1389. ifdef NEED_GAS
  1390. OBJS += ../src/common/gas.o
  1391. OBJS += gas_query.o
  1392. CFLAGS += -DCONFIG_GAS
  1393. NEED_OFFCHANNEL=y
  1394. endif
  1395. ifdef NEED_OFFCHANNEL
  1396. OBJS += offchannel.o
  1397. CFLAGS += -DCONFIG_OFFCHANNEL
  1398. endif
  1399. ifdef CONFIG_MODULE_TESTS
  1400. CFLAGS += -DCONFIG_MODULE_TESTS
  1401. OBJS += wpas_module_tests.o
  1402. OBJS += ../src/utils/utils_module_tests.o
  1403. OBJS += ../src/common/common_module_tests.o
  1404. OBJS += ../src/crypto/crypto_module_tests.o
  1405. ifdef CONFIG_WPS
  1406. OBJS += ../src/wps/wps_module_tests.o
  1407. endif
  1408. ifndef CONFIG_P2P
  1409. OBJS += ../src/utils/bitfield.o
  1410. endif
  1411. endif
  1412. OBJS += ../src/drivers/driver_common.o
  1413. OBJS_priv += ../src/drivers/driver_common.o
  1414. OBJS += wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o
  1415. OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o
  1416. OBJS_t += ../src/radius/radius_client.o
  1417. OBJS_t += ../src/radius/radius.o
  1418. ifndef CONFIG_AP
  1419. OBJS_t += ../src/utils/ip_addr.o
  1420. endif
  1421. OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o
  1422. OBJS_nfc := $(OBJS) $(OBJS_l2) nfc_pw_token.o
  1423. OBJS_nfc += $(OBJS_d) ../src/drivers/drivers.o
  1424. OBJS += $(CONFIG_MAIN).o
  1425. ifdef CONFIG_PRIVSEP
  1426. OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o
  1427. OBJS_priv += $(OBJS_l2)
  1428. OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
  1429. OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
  1430. OBJS_priv += ../src/utils/common.o
  1431. OBJS_priv += ../src/utils/wpa_debug.o
  1432. OBJS_priv += ../src/utils/wpabuf.o
  1433. OBJS_priv += wpa_priv.o
  1434. ifdef CONFIG_DRIVER_NL80211
  1435. OBJS_priv += ../src/common/ieee802_11_common.o
  1436. endif
  1437. OBJS += ../src/l2_packet/l2_packet_privsep.o
  1438. OBJS += ../src/drivers/driver_privsep.o
  1439. EXTRA_progs += wpa_priv
  1440. else
  1441. OBJS += $(OBJS_d) ../src/drivers/drivers.o
  1442. OBJS += $(OBJS_l2)
  1443. endif
  1444. ifdef CONFIG_NDIS_EVENTS_INTEGRATED
  1445. CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
  1446. OBJS += ../src/drivers/ndis_events.o
  1447. EXTRALIBS += -loleaut32 -lole32 -luuid
  1448. ifdef PLATFORMSDKLIB
  1449. EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
  1450. else
  1451. EXTRALIBS += WbemUuid.Lib
  1452. endif
  1453. endif
  1454. ifdef CONFIG_FST
  1455. CFLAGS += -DCONFIG_FST
  1456. ifdef CONFIG_FST_TEST
  1457. CFLAGS += -DCONFIG_FST_TEST
  1458. endif
  1459. FST_OBJS += ../src/fst/fst.o
  1460. FST_OBJS += ../src/fst/fst_session.o
  1461. FST_OBJS += ../src/fst/fst_iface.o
  1462. FST_OBJS += ../src/fst/fst_group.o
  1463. FST_OBJS += ../src/fst/fst_ctrl_aux.o
  1464. ifdef CONFIG_CTRL_IFACE
  1465. FST_OBJS += ../src/fst/fst_ctrl_iface.o
  1466. endif
  1467. OBJS += $(FST_OBJS)
  1468. OBJS_t += $(FST_OBJS)
  1469. OBJS_t2 += $(FST_OBJS)
  1470. OBJS_nfc += $(FST_OBJS)
  1471. endif
  1472. ifndef LDO
  1473. LDO=$(CC)
  1474. endif
  1475. Q=@
  1476. E=echo
  1477. ifeq ($(V), 1)
  1478. Q=
  1479. E=true
  1480. endif
  1481. ifeq ($(QUIET), 1)
  1482. Q=@
  1483. E=true
  1484. endif
  1485. dynamic_eap_methods: $(EAPDYN)
  1486. ../src/drivers/build.wpa_supplicant:
  1487. @if [ -f ../src/drivers/build.hostapd ]; then \
  1488. $(MAKE) -C ../src/drivers clean; \
  1489. fi
  1490. @touch ../src/drivers/build.wpa_supplicant
  1491. BCHECK=../src/drivers/build.wpa_supplicant
  1492. wpa_priv: $(BCHECK) $(OBJS_priv)
  1493. $(Q)$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
  1494. @$(E) " LD " $@
  1495. $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
  1496. wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
  1497. $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
  1498. @$(E) " LD " $@
  1499. eapol_test: $(OBJS_t)
  1500. $(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
  1501. @$(E) " LD " $@
  1502. preauth_test: $(OBJS_t2)
  1503. $(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
  1504. @$(E) " LD " $@
  1505. wpa_passphrase: $(OBJS_p)
  1506. $(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p)
  1507. @$(E) " LD " $@
  1508. wpa_cli: $(OBJS_c)
  1509. $(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
  1510. @$(E) " LD " $@
  1511. LIBCTRL += ../src/common/wpa_ctrl.o
  1512. LIBCTRL += ../src/utils/os_$(CONFIG_OS).o
  1513. LIBCTRL += ../src/utils/common.o
  1514. LIBCTRL += ../src/utils/wpa_debug.o
  1515. LIBCTRLSO += ../src/common/wpa_ctrl.c
  1516. LIBCTRLSO += ../src/utils/os_$(CONFIG_OS).c
  1517. LIBCTRLSO += ../src/utils/common.c
  1518. LIBCTRLSO += ../src/utils/wpa_debug.c
  1519. libwpa_client.a: $(LIBCTRL)
  1520. $(Q)rm -f $@
  1521. $(Q)$(AR) crs $@ $?
  1522. @$(E) " AR " $@
  1523. libwpa_client.so: $(LIBCTRLSO)
  1524. @$(E) " CC $@ ($^)"
  1525. $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -fPIC $^
  1526. libwpa_test1: libwpa_test.o libwpa_client.a
  1527. $(Q)$(LDO) $(LDFLAGS) -o libwpa_test1 libwpa_test.o libwpa_client.a $(LIBS_c)
  1528. @$(E) " LD " $@
  1529. libwpa_test2: libwpa_test.o libwpa_client.so
  1530. $(Q)$(LDO) $(LDFLAGS) -o libwpa_test2 libwpa_test.o -L. -lwpa_client $(LIBS_c)
  1531. @$(E) " LD " $@
  1532. nfc_pw_token: $(OBJS_nfc)
  1533. $(Q)$(LDO) $(LDFLAGS) -o nfc_pw_token $(OBJS_nfc) $(LIBS)
  1534. @$(E) " LD " $@
  1535. win_if_list: win_if_list.c
  1536. $(Q)$(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
  1537. @$(E) " LD " $@
  1538. eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c
  1539. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1540. -Deap_peer_psk_register=eap_peer_method_dynamic_init
  1541. eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c
  1542. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1543. -Deap_peer_pax_register=eap_peer_method_dynamic_init
  1544. eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c
  1545. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1546. -Deap_peer_sake_register=eap_peer_method_dynamic_init
  1547. eap_wsc.so: ../src/eap_peer/eap_wsc.c ../src/eap_common/eap_wsc_common.c ../src/wps/wps.c
  1548. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1549. -Deap_peer_wsc_register=eap_peer_method_dynamic_init
  1550. 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
  1551. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1552. -Deap_peer_ikev2_register=eap_peer_method_dynamic_init
  1553. eap_eke.so: ../src/eap_peer/eap_eke.c ../src/eap_common/eap_eke_common.c
  1554. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1555. -Deap_peer_eke_register=eap_peer_method_dynamic_init
  1556. %.so: %.c
  1557. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
  1558. -D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
  1559. ifdef CONFIG_CODE_COVERAGE
  1560. %.o: %.c
  1561. @$(E) " CC " $<
  1562. $(Q)cd $(dir $@); $(CC) -c -o $(notdir $@) $(CFLAGS) $(notdir $<)
  1563. else
  1564. %.o: %.c
  1565. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  1566. @$(E) " CC " $<
  1567. endif
  1568. %.service: %.service.in
  1569. $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
  1570. @$(E) " sed" $<
  1571. %@.service: %.service.arg.in
  1572. $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
  1573. @$(E) " sed" $<
  1574. wpa_supplicant.exe: wpa_supplicant
  1575. mv -f $< $@
  1576. wpa_cli.exe: wpa_cli
  1577. mv -f $< $@
  1578. wpa_passphrase.exe: wpa_passphrase
  1579. mv -f $< $@
  1580. win_if_list.exe: win_if_list
  1581. mv -f $< $@
  1582. eapol_test.exe: eapol_test
  1583. mv -f $< $@
  1584. WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe
  1585. windows-bin: $(WINALL)
  1586. $(STRIP) $(WINALL)
  1587. wpa_gui:
  1588. @echo "wpa_gui has been removed - see wpa_gui-qt4 for replacement"
  1589. wpa_gui-qt4/Makefile:
  1590. qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro
  1591. wpa_gui-qt4/lang/wpa_gui_de.qm: wpa_gui-qt4/lang/wpa_gui_de.ts
  1592. lrelease wpa_gui-qt4/wpa_gui.pro
  1593. wpa_gui-qt4: wpa_gui-qt4/Makefile wpa_gui-qt4/lang/wpa_gui_de.qm
  1594. $(MAKE) -C wpa_gui-qt4
  1595. FIPSDIR=/usr/local/ssl/fips-2.0
  1596. FIPSLD=$(FIPSDIR)/bin/fipsld
  1597. fips:
  1598. $(MAKE) CC=$(FIPSLD) FIPSLD_CC="$(CC)"
  1599. lcov-html: wpa_supplicant.gcda
  1600. lcov -c -d .. > lcov.info
  1601. genhtml lcov.info --output-directory lcov-html
  1602. clean:
  1603. $(MAKE) -C ../src clean
  1604. $(MAKE) -C dbus clean
  1605. rm -f core *~ *.o *.d *.gcno *.gcda *.gcov
  1606. rm -f eap_*.so $(ALL) $(WINALL) eapol_test preauth_test
  1607. rm -f wpa_priv
  1608. rm -f nfc_pw_token
  1609. rm -f lcov.info
  1610. rm -rf lcov-html
  1611. rm -f libwpa_client.a
  1612. rm -f libwpa_client.so
  1613. rm -f libwpa_test1 libwpa_test2
  1614. -include $(OBJS:%.o=%.d)