Makefile 39 KB

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