Makefile 38 KB

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