Makefile 39 KB

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