Makefile 37 KB

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