Makefile 38 KB

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