Makefile 39 KB

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