Makefile 39 KB

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