Makefile 37 KB

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