Makefile 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158
  1. ifndef CC
  2. CC=gcc
  3. endif
  4. ifndef CFLAGS
  5. CFLAGS = -MMD -O2 -Wall -g
  6. endif
  7. CFLAGS += -I../src
  8. CFLAGS += -I../src/crypto
  9. CFLAGS += -I../src/utils
  10. CFLAGS += -I../src/common
  11. CFLAGS += -I../src/rsn_supp
  12. ALL=wpa_supplicant wpa_passphrase wpa_cli
  13. all: verify_config $(ALL) dynamic_eap_methods
  14. verify_config:
  15. @if [ ! -r .config ]; then \
  16. echo 'Building wpa_supplicant requires a configuration file'; \
  17. echo '(.config). See README for more instructions. You can'; \
  18. echo 'run "cp defconfig .config" to create an example'; \
  19. echo 'configuration.'; \
  20. exit 1; \
  21. fi
  22. mkconfig:
  23. @if [ -e .config ]; then \
  24. echo '.config exists - did not replace it'; \
  25. exit 1; \
  26. fi
  27. echo CONFIG_DRIVER_HOSTAP=y >> .config
  28. echo CONFIG_DRIVER_WEXT=y >> .config
  29. echo CONFIG_WIRELESS_EXTENSION=y >> .config
  30. install: all
  31. mkdir -p $(DESTDIR)/usr/local/sbin/
  32. for i in $(ALL); do cp $$i $(DESTDIR)/usr/local/sbin/$$i; done
  33. OBJS = config.o
  34. OBJS += ../src/utils/common.o
  35. OBJS += ../src/utils/wpa_debug.o
  36. OBJS += ../src/utils/wpabuf.o
  37. OBJS += ../src/crypto/md5.o
  38. OBJS += ../src/crypto/rc4.o
  39. OBJS += ../src/crypto/md4.o
  40. OBJS += ../src/crypto/sha1.o
  41. OBJS += ../src/crypto/des.o
  42. OBJS_p = wpa_passphrase.o
  43. OBJS_p += ../src/utils/common.o
  44. OBJS_p += ../src/utils/wpa_debug.o
  45. OBJS_p += ../src/crypto/md5.o
  46. OBJS_p += ../src/crypto/md4.o
  47. OBJS_p += ../src/crypto/sha1.o
  48. OBJS_p += ../src/crypto/des.o
  49. OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
  50. -include .config
  51. ifndef CONFIG_OS
  52. ifdef CONFIG_NATIVE_WINDOWS
  53. CONFIG_OS=win32
  54. else
  55. CONFIG_OS=unix
  56. endif
  57. endif
  58. ifeq ($(CONFIG_OS), internal)
  59. CFLAGS += -DOS_NO_C_LIB_DEFINES
  60. endif
  61. OBJS += ../src/utils/os_$(CONFIG_OS).o
  62. OBJS_p += ../src/utils/os_$(CONFIG_OS).o
  63. OBJS_c += ../src/utils/os_$(CONFIG_OS).o
  64. ifndef CONFIG_ELOOP
  65. CONFIG_ELOOP=eloop
  66. endif
  67. OBJS += ../src/utils/$(CONFIG_ELOOP).o
  68. ifdef CONFIG_EAPOL_TEST
  69. CFLAGS += -Werror -DEAPOL_TEST
  70. endif
  71. ifndef CONFIG_BACKEND
  72. CONFIG_BACKEND=file
  73. endif
  74. ifeq ($(CONFIG_BACKEND), file)
  75. OBJS += config_file.o
  76. ifndef CONFIG_NO_CONFIG_BLOBS
  77. NEED_BASE64=y
  78. endif
  79. CFLAGS += -DCONFIG_BACKEND_FILE
  80. endif
  81. ifeq ($(CONFIG_BACKEND), winreg)
  82. OBJS += config_winreg.o
  83. endif
  84. ifeq ($(CONFIG_BACKEND), none)
  85. OBJS += config_none.o
  86. endif
  87. ifdef CONFIG_NO_CONFIG_WRITE
  88. CFLAGS += -DCONFIG_NO_CONFIG_WRITE
  89. endif
  90. ifdef CONFIG_NO_CONFIG_BLOBS
  91. CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
  92. endif
  93. ifdef CONFIG_NO_SCAN_PROCESSING
  94. CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
  95. endif
  96. ifdef CONFIG_DRIVER_HOSTAP
  97. CFLAGS += -DCONFIG_DRIVER_HOSTAP
  98. OBJS_d += ../src/drivers/driver_hostap.o
  99. CONFIG_WIRELESS_EXTENSION=y
  100. endif
  101. ifdef CONFIG_DRIVER_WEXT
  102. CFLAGS += -DCONFIG_DRIVER_WEXT
  103. CONFIG_WIRELESS_EXTENSION=y
  104. endif
  105. ifdef CONFIG_DRIVER_PRISM54
  106. CFLAGS += -DCONFIG_DRIVER_PRISM54
  107. OBJS_d += ../src/drivers/driver_prism54.o
  108. CONFIG_WIRELESS_EXTENSION=y
  109. endif
  110. ifdef CONFIG_DRIVER_HERMES
  111. CFLAGS += -DCONFIG_DRIVER_HERMES
  112. OBJS_d += ../src/drivers/driver_hermes.o
  113. CONFIG_WIRELESS_EXTENSION=y
  114. endif
  115. ifdef CONFIG_DRIVER_MADWIFI
  116. CFLAGS += -DCONFIG_DRIVER_MADWIFI
  117. OBJS_d += ../src/drivers/driver_madwifi.o
  118. CONFIG_WIRELESS_EXTENSION=y
  119. endif
  120. ifdef CONFIG_DRIVER_ATMEL
  121. CFLAGS += -DCONFIG_DRIVER_ATMEL
  122. OBJS_d += ../src/drivers/driver_atmel.o
  123. CONFIG_WIRELESS_EXTENSION=y
  124. endif
  125. ifdef CONFIG_DRIVER_NDISWRAPPER
  126. CFLAGS += -DCONFIG_DRIVER_NDISWRAPPER
  127. OBJS_d += ../src/drivers/driver_ndiswrapper.o
  128. CONFIG_WIRELESS_EXTENSION=y
  129. endif
  130. ifdef CONFIG_DRIVER_RALINK
  131. CFLAGS += -DCONFIG_DRIVER_RALINK
  132. OBJS_d += ../src/drivers/driver_ralink.o
  133. endif
  134. ifdef CONFIG_DRIVER_BROADCOM
  135. CFLAGS += -DCONFIG_DRIVER_BROADCOM
  136. OBJS_d += ../src/drivers/driver_broadcom.o
  137. endif
  138. ifdef CONFIG_DRIVER_IPW
  139. CFLAGS += -DCONFIG_DRIVER_IPW
  140. OBJS_d += ../src/drivers/driver_ipw.o
  141. CONFIG_WIRELESS_EXTENSION=y
  142. endif
  143. ifdef CONFIG_DRIVER_BSD
  144. CFLAGS += -DCONFIG_DRIVER_BSD
  145. OBJS_d += ../src/drivers/driver_bsd.o
  146. ifndef CONFIG_L2_PACKET
  147. CONFIG_L2_PACKET=freebsd
  148. endif
  149. endif
  150. ifdef CONFIG_DRIVER_NDIS
  151. CFLAGS += -DCONFIG_DRIVER_NDIS
  152. OBJS_d += ../src/drivers/driver_ndis.o ../src/drivers/driver_ndis_.o
  153. ifndef CONFIG_L2_PACKET
  154. CONFIG_L2_PACKET=pcap
  155. endif
  156. CONFIG_WINPCAP=y
  157. ifdef CONFIG_USE_NDISUIO
  158. CFLAGS += -DCONFIG_USE_NDISUIO
  159. endif
  160. endif
  161. ifdef CONFIG_DRIVER_WIRED
  162. CFLAGS += -DCONFIG_DRIVER_WIRED
  163. OBJS_d += ../src/drivers/driver_wired.o
  164. endif
  165. ifdef CONFIG_DRIVER_TEST
  166. CFLAGS += -DCONFIG_DRIVER_TEST
  167. OBJS_d += ../src/drivers/driver_test.o
  168. endif
  169. ifdef CONFIG_DRIVER_OSX
  170. CFLAGS += -DCONFIG_DRIVER_OSX
  171. OBJS_d += ../src/drivers/driver_osx.o
  172. LDFLAGS += -framework CoreFoundation
  173. LDFLAGS += -F/System/Library/PrivateFrameworks -framework Apple80211
  174. endif
  175. ifdef CONFIG_DRIVER_PS3
  176. CFLAGS += -DCONFIG_DRIVER_PS3 -m64
  177. OBJS_d += ../src/drivers/driver_ps3.o
  178. LDFLAGS += -m64
  179. endif
  180. ifdef CONFIG_DRIVER_IPHONE
  181. CFLAGS += -DCONFIG_DRIVER_IPHONE
  182. OBJS_d += ../src/drivers/driver_iphone.o
  183. OBJS_d += ../src/drivers/MobileApple80211.o
  184. LIBS += -framework CoreFoundation
  185. endif
  186. ifndef CONFIG_L2_PACKET
  187. CONFIG_L2_PACKET=linux
  188. endif
  189. OBJS_l2 += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o
  190. ifeq ($(CONFIG_L2_PACKET), pcap)
  191. ifdef CONFIG_WINPCAP
  192. CFLAGS += -DCONFIG_WINPCAP
  193. LIBS += -lwpcap -lpacket
  194. LIBS_w += -lwpcap
  195. else
  196. LIBS += -ldnet -lpcap
  197. endif
  198. endif
  199. ifeq ($(CONFIG_L2_PACKET), winpcap)
  200. LIBS += -lwpcap -lpacket
  201. LIBS_w += -lwpcap
  202. endif
  203. ifeq ($(CONFIG_L2_PACKET), freebsd)
  204. LIBS += -lpcap
  205. endif
  206. ifdef CONFIG_EAP_TLS
  207. # EAP-TLS
  208. ifeq ($(CONFIG_EAP_TLS), dyn)
  209. CFLAGS += -DEAP_TLS_DYNAMIC
  210. EAPDYN += ../src/eap_peer/eap_tls.so
  211. else
  212. CFLAGS += -DEAP_TLS
  213. OBJS += ../src/eap_peer/eap_tls.o
  214. OBJS_h += ../src/eap_server/eap_tls.o
  215. endif
  216. TLS_FUNCS=y
  217. CONFIG_IEEE8021X_EAPOL=y
  218. endif
  219. ifdef CONFIG_EAP_PEAP
  220. # EAP-PEAP
  221. ifeq ($(CONFIG_EAP_PEAP), dyn)
  222. CFLAGS += -DEAP_PEAP_DYNAMIC
  223. EAPDYN += ../src/eap_peer/eap_peap.so
  224. else
  225. CFLAGS += -DEAP_PEAP
  226. OBJS += ../src/eap_peer/eap_peap.o
  227. OBJS_h += ../src/eap_server/eap_peap.o
  228. endif
  229. TLS_FUNCS=y
  230. CONFIG_IEEE8021X_EAPOL=y
  231. endif
  232. ifdef CONFIG_EAP_TTLS
  233. # EAP-TTLS
  234. ifeq ($(CONFIG_EAP_TTLS), dyn)
  235. CFLAGS += -DEAP_TTLS_DYNAMIC
  236. EAPDYN += ../src/eap_peer/eap_ttls.so
  237. else
  238. CFLAGS += -DEAP_TTLS
  239. OBJS += ../src/eap_peer/eap_ttls.o
  240. OBJS_h += ../src/eap_server/eap_ttls.o
  241. endif
  242. MS_FUNCS=y
  243. TLS_FUNCS=y
  244. CHAP=y
  245. CONFIG_IEEE8021X_EAPOL=y
  246. endif
  247. ifdef CONFIG_EAP_MD5
  248. # EAP-MD5
  249. ifeq ($(CONFIG_EAP_MD5), dyn)
  250. CFLAGS += -DEAP_MD5_DYNAMIC
  251. EAPDYN += ../src/eap_peer/eap_md5.so
  252. else
  253. CFLAGS += -DEAP_MD5
  254. OBJS += ../src/eap_peer/eap_md5.o
  255. OBJS_h += ../src/eap_server/eap_md5.o
  256. endif
  257. CHAP=y
  258. CONFIG_IEEE8021X_EAPOL=y
  259. endif
  260. # backwards compatibility for old spelling
  261. ifdef CONFIG_MSCHAPV2
  262. ifndef CONFIG_EAP_MSCHAPV2
  263. CONFIG_EAP_MSCHAPV2=y
  264. endif
  265. endif
  266. ifdef CONFIG_EAP_MSCHAPV2
  267. # EAP-MSCHAPv2
  268. ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
  269. CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
  270. EAPDYN += ../src/eap_peer/eap_mschapv2.so
  271. EAPDYN += ../src/eap_peer/mschapv2.so
  272. else
  273. CFLAGS += -DEAP_MSCHAPv2
  274. OBJS += ../src/eap_peer/eap_mschapv2.o
  275. OBJS += ../src/eap_peer/mschapv2.o
  276. OBJS_h += ../src/eap_server/eap_mschapv2.o
  277. endif
  278. MS_FUNCS=y
  279. CONFIG_IEEE8021X_EAPOL=y
  280. endif
  281. ifdef CONFIG_EAP_GTC
  282. # EAP-GTC
  283. ifeq ($(CONFIG_EAP_GTC), dyn)
  284. CFLAGS += -DEAP_GTC_DYNAMIC
  285. EAPDYN += ../src/eap_peer/eap_gtc.so
  286. else
  287. CFLAGS += -DEAP_GTC
  288. OBJS += ../src/eap_peer/eap_gtc.o
  289. OBJS_h += ../src/eap_server/eap_gtc.o
  290. endif
  291. CONFIG_IEEE8021X_EAPOL=y
  292. endif
  293. ifdef CONFIG_EAP_OTP
  294. # EAP-OTP
  295. ifeq ($(CONFIG_EAP_OTP), dyn)
  296. CFLAGS += -DEAP_OTP_DYNAMIC
  297. EAPDYN += ../src/eap_peer/eap_otp.so
  298. else
  299. CFLAGS += -DEAP_OTP
  300. OBJS += ../src/eap_peer/eap_otp.o
  301. endif
  302. CONFIG_IEEE8021X_EAPOL=y
  303. endif
  304. ifdef CONFIG_EAP_SIM
  305. # EAP-SIM
  306. ifeq ($(CONFIG_EAP_SIM), dyn)
  307. CFLAGS += -DEAP_SIM_DYNAMIC
  308. EAPDYN += ../src/eap_peer/eap_sim.so
  309. else
  310. CFLAGS += -DEAP_SIM
  311. OBJS += ../src/eap_peer/eap_sim.o
  312. OBJS_h += ../src/eap_server/eap_sim.o
  313. endif
  314. CONFIG_IEEE8021X_EAPOL=y
  315. CONFIG_EAP_SIM_COMMON=y
  316. endif
  317. ifdef CONFIG_EAP_LEAP
  318. # EAP-LEAP
  319. ifeq ($(CONFIG_EAP_LEAP), dyn)
  320. CFLAGS += -DEAP_LEAP_DYNAMIC
  321. EAPDYN += ../src/eap_peer/eap_leap.so
  322. else
  323. CFLAGS += -DEAP_LEAP
  324. OBJS += ../src/eap_peer/eap_leap.o
  325. endif
  326. MS_FUNCS=y
  327. CONFIG_IEEE8021X_EAPOL=y
  328. endif
  329. ifdef CONFIG_EAP_PSK
  330. # EAP-PSK
  331. ifeq ($(CONFIG_EAP_PSK), dyn)
  332. CFLAGS += -DEAP_PSK_DYNAMIC
  333. EAPDYN += ../src/eap_peer/eap_psk.so
  334. else
  335. CFLAGS += -DEAP_PSK
  336. OBJS += ../src/eap_peer/eap_psk.o ../src/eap_common/eap_psk_common.o
  337. OBJS_h += ../src/eap_server/eap_psk.o
  338. endif
  339. CONFIG_IEEE8021X_EAPOL=y
  340. NEED_AES=y
  341. endif
  342. ifdef CONFIG_EAP_AKA
  343. # EAP-AKA
  344. ifeq ($(CONFIG_EAP_AKA), dyn)
  345. CFLAGS += -DEAP_AKA_DYNAMIC
  346. EAPDYN += ../src/eap_peer/eap_aka.so
  347. else
  348. CFLAGS += -DEAP_AKA
  349. OBJS += ../src/eap_peer/eap_aka.o
  350. OBJS_h += ../src/eap_server/eap_aka.o
  351. endif
  352. CONFIG_IEEE8021X_EAPOL=y
  353. CONFIG_EAP_SIM_COMMON=y
  354. endif
  355. ifdef CONFIG_EAP_SIM_COMMON
  356. OBJS += ../src/eap_common/eap_sim_common.o
  357. OBJS_h += ../src/eap_server/eap_sim_db.o
  358. NEED_AES=y
  359. NEED_FIPS186_2_PRF=y
  360. endif
  361. ifdef CONFIG_EAP_FAST
  362. # EAP-FAST
  363. ifeq ($(CONFIG_EAP_FAST), dyn)
  364. CFLAGS += -DEAP_FAST_DYNAMIC
  365. EAPDYN += ../src/eap_peer/eap_fast.so
  366. EAPDYN += ../src/eap_common/eap_fast_common.o
  367. else
  368. CFLAGS += -DEAP_FAST
  369. OBJS += ../src/eap_peer/eap_fast.o ../src/eap_peer/eap_fast_pac.o
  370. OBJS += ../src/eap_common/eap_fast_common.o
  371. OBJS_h += ../src/eap_server/eap_fast.o
  372. endif
  373. TLS_FUNCS=y
  374. NEED_T_PRF=y
  375. endif
  376. ifdef CONFIG_EAP_PAX
  377. # EAP-PAX
  378. ifeq ($(CONFIG_EAP_PAX), dyn)
  379. CFLAGS += -DEAP_PAX_DYNAMIC
  380. EAPDYN += ../src/eap_peer/eap_pax.so
  381. else
  382. CFLAGS += -DEAP_PAX
  383. OBJS += ../src/eap_peer/eap_pax.o ../src/eap_common/eap_pax_common.o
  384. OBJS_h += ../src/eap_server/eap_pax.o
  385. endif
  386. CONFIG_IEEE8021X_EAPOL=y
  387. endif
  388. ifdef CONFIG_EAP_SAKE
  389. # EAP-SAKE
  390. ifeq ($(CONFIG_EAP_SAKE), dyn)
  391. CFLAGS += -DEAP_SAKE_DYNAMIC
  392. EAPDYN += ../src/eap_peer/eap_sake.so
  393. else
  394. CFLAGS += -DEAP_SAKE
  395. OBJS += ../src/eap_peer/eap_sake.o ../src/eap_common/eap_sake_common.o
  396. OBJS_h += ../src/eap_server/eap_sake.o
  397. endif
  398. CONFIG_IEEE8021X_EAPOL=y
  399. endif
  400. ifdef CONFIG_EAP_GPSK
  401. # EAP-GPSK
  402. ifeq ($(CONFIG_EAP_GPSK), dyn)
  403. CFLAGS += -DEAP_GPSK_DYNAMIC
  404. EAPDYN += ../src/eap_peer/eap_gpsk.so
  405. else
  406. CFLAGS += -DEAP_GPSK
  407. OBJS += ../src/eap_peer/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o
  408. OBJS_h += ../src/eap_server/eap_gpsk.o
  409. endif
  410. CONFIG_IEEE8021X_EAPOL=y
  411. ifdef CONFIG_EAP_GPSK_SHA256
  412. CFLAGS += -DEAP_GPSK_SHA256
  413. endif
  414. NEED_SHA256=y
  415. endif
  416. ifdef CONFIG_EAP_IKEV2
  417. # EAP-IKEv2
  418. ifeq ($(CONFIG_EAP_IKEV2), dyn)
  419. CFLAGS += -DEAP_IKEV2_DYNAMIC
  420. EAPDYN += ../src/eap_peer/eap_ikev2.so ../src/eap_peer/ikev2.o
  421. EAPDYN += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  422. else
  423. CFLAGS += -DEAP_IKEV2
  424. OBJS += ../src/eap_peer/eap_ikev2.o ../src/eap_peer/ikev2.o
  425. OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  426. OBJS_h += ../src/eap_server/eap_ikev2.o
  427. OBJS_h += ../src/eap_server/ikev2.o
  428. endif
  429. CONFIG_IEEE8021X_EAPOL=y
  430. NEED_DH_GROUPS=y
  431. endif
  432. ifdef CONFIG_EAP_VENDOR_TEST
  433. ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
  434. CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
  435. EAPDYN += ../src/eap_peer/eap_vendor_test.so
  436. else
  437. CFLAGS += -DEAP_VENDOR_TEST
  438. OBJS += ../src/eap_peer/eap_vendor_test.o
  439. OBJS_h += ../src/eap_server/eap_vendor_test.o
  440. endif
  441. CONFIG_IEEE8021X_EAPOL=y
  442. endif
  443. ifdef CONFIG_EAP_TNC
  444. # EAP-TNC
  445. CFLAGS += -DEAP_TNC
  446. OBJS += ../src/eap_peer/eap_tnc.o
  447. OBJS += ../src/eap_peer/tncc.o
  448. NEED_BASE64=y
  449. endif
  450. ifdef CONFIG_IEEE8021X_EAPOL
  451. # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
  452. CFLAGS += -DIEEE8021X_EAPOL
  453. OBJS += ../src/eapol_supp/eapol_supp_sm.o ../src/eap_peer/eap.o ../src/eap_common/eap_common.o ../src/eap_peer/eap_methods.o
  454. ifdef CONFIG_DYNAMIC_EAP_METHODS
  455. CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  456. LIBS += -ldl -rdynamic
  457. endif
  458. endif
  459. ifdef CONFIG_EAP_SERVER
  460. CFLAGS += -DEAP_SERVER
  461. OBJS_h += ../src/eap_server/eap.o
  462. OBJS_h += ../src/eap_server/eap_identity.o
  463. OBJS_h += ../src/eap_server/eap_methods.o
  464. endif
  465. ifdef CONFIG_RADIUS_CLIENT
  466. OBJS_h += ../src/utils/ip_addr.o
  467. OBJS_h += ../src/radius/radius.o
  468. OBJS_h += ../src/radius/radius_client.o
  469. endif
  470. ifdef CONFIG_AUTHENTICATOR
  471. OBJS_h += ../hostapd/eapol_sm.o
  472. OBJS_h += ../hostapd/ieee802_1x.o
  473. endif
  474. ifdef CONFIG_WPA_AUTHENTICATOR
  475. OBJS_h += ../hostapd/wpa.o
  476. OBJS_h += ../hostapd/wpa_auth_ie.o
  477. ifdef CONFIG_IEEE80211R
  478. OBJS_h += ../hostapd/wpa_ft.o
  479. endif
  480. ifdef CONFIG_PEERKEY
  481. OBJS_h += ../hostapd/peerkey.o
  482. endif
  483. endif
  484. ifdef CONFIG_PCSC
  485. # PC/SC interface for smartcards (USIM, GSM SIM)
  486. CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
  487. OBJS += ../src/utils/pcsc_funcs.o
  488. # -lpthread may not be needed depending on how pcsc-lite was configured
  489. ifdef CONFIG_NATIVE_WINDOWS
  490. #Once MinGW gets support for WinScard, -lwinscard could be used instead of the
  491. #dynamic symbol loading that is now used in pcsc_funcs.c
  492. #LIBS += -lwinscard
  493. else
  494. LIBS += -lpcsclite -lpthread
  495. endif
  496. endif
  497. ifndef CONFIG_TLS
  498. CONFIG_TLS=openssl
  499. endif
  500. ifeq ($(CONFIG_TLS), internal)
  501. ifndef CONFIG_CRYPTO
  502. CONFIG_CRYPTO=internal
  503. endif
  504. endif
  505. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  506. CFLAGS += -DCONFIG_INTERNAL_X509
  507. endif
  508. ifeq ($(CONFIG_CRYPTO), internal)
  509. CFLAGS += -DCONFIG_INTERNAL_X509
  510. endif
  511. ifdef TLS_FUNCS
  512. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
  513. CFLAGS += -DEAP_TLS_FUNCS
  514. OBJS += ../src/eap_peer/eap_tls_common.o
  515. OBJS_h += ../src/eap_server/eap_tls_common.o
  516. NEED_TLS_PRF=y
  517. ifeq ($(CONFIG_TLS), openssl)
  518. CFLAGS += -DEAP_TLS_OPENSSL
  519. OBJS += ../src/crypto/tls_openssl.o
  520. LIBS += -lssl -lcrypto
  521. LIBS_p += -lcrypto
  522. endif
  523. ifeq ($(CONFIG_TLS), gnutls)
  524. OBJS += ../src/crypto/tls_gnutls.o
  525. LIBS += -lgnutls -lgcrypt -lgpg-error
  526. LIBS_p += -lgcrypt
  527. ifdef CONFIG_GNUTLS_EXTRA
  528. CFLAGS += -DCONFIG_GNUTLS_EXTRA
  529. LIBS += -lgnutls-extra
  530. endif
  531. endif
  532. ifeq ($(CONFIG_TLS), schannel)
  533. OBJS += ../src/crypto/tls_schannel.o
  534. endif
  535. ifeq ($(CONFIG_TLS), internal)
  536. OBJS += ../src/crypto/tls_internal.o
  537. OBJS += ../src/tls/tlsv1_common.o ../src/tls/tlsv1_record.o
  538. OBJS += ../src/tls/tlsv1_cred.o ../src/tls/tlsv1_client.o
  539. OBJS += ../src/tls/tlsv1_client_write.o ../src/tls/tlsv1_client_read.o
  540. OBJS += ../src/tls/asn1.o ../src/tls/x509v3.o
  541. OBJS_p += ../src/tls/asn1.o
  542. OBJS_p += ../src/crypto/rc4.o ../src/crypto/aes_wrap.o ../src/crypto/aes.o
  543. NEED_BASE64=y
  544. NEED_TLS_PRF=y
  545. CFLAGS += -DCONFIG_TLS_INTERNAL
  546. CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
  547. ifeq ($(CONFIG_CRYPTO), internal)
  548. ifdef CONFIG_INTERNAL_LIBTOMMATH
  549. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  550. else
  551. LIBS += -ltommath
  552. LIBS_p += -ltommath
  553. endif
  554. endif
  555. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  556. LIBS += -ltomcrypt -ltfm
  557. LIBS_p += -ltomcrypt -ltfm
  558. endif
  559. endif
  560. ifeq ($(CONFIG_TLS), none)
  561. OBJS += ../src/crypto/tls_none.o
  562. CFLAGS += -DEAP_TLS_NONE
  563. CONFIG_INTERNAL_AES=y
  564. CONFIG_INTERNAL_SHA1=y
  565. CONFIG_INTERNAL_MD5=y
  566. CONFIG_INTERNAL_SHA256=y
  567. endif
  568. ifdef CONFIG_SMARTCARD
  569. ifndef CONFIG_NATIVE_WINDOWS
  570. ifneq ($(CONFIG_L2_PACKET), freebsd)
  571. LIBS += -ldl
  572. endif
  573. endif
  574. endif
  575. NEED_CRYPTO=y
  576. else
  577. OBJS += ../src/crypto/tls_none.o
  578. endif
  579. ifdef CONFIG_PKCS12
  580. CFLAGS += -DPKCS12_FUNCS
  581. endif
  582. ifdef CONFIG_SMARTCARD
  583. CFLAGS += -DCONFIG_SMARTCARD
  584. endif
  585. ifdef MS_FUNCS
  586. OBJS += ../src/crypto/ms_funcs.o
  587. NEED_CRYPTO=y
  588. endif
  589. ifdef CHAP
  590. OBJS += ../src/eap_common/chap.o
  591. endif
  592. ifdef NEED_CRYPTO
  593. ifndef TLS_FUNCS
  594. ifeq ($(CONFIG_TLS), openssl)
  595. LIBS += -lcrypto
  596. LIBS_p += -lcrypto
  597. endif
  598. ifeq ($(CONFIG_TLS), gnutls)
  599. LIBS += -lgcrypt
  600. LIBS_p += -lgcrypt
  601. endif
  602. ifeq ($(CONFIG_TLS), schannel)
  603. endif
  604. ifeq ($(CONFIG_TLS), internal)
  605. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  606. LIBS += -ltomcrypt -ltfm
  607. LIBS_p += -ltomcrypt -ltfm
  608. endif
  609. endif
  610. endif
  611. ifeq ($(CONFIG_TLS), openssl)
  612. OBJS += ../src/crypto/crypto_openssl.o
  613. OBJS_p += ../src/crypto/crypto_openssl.o
  614. CONFIG_INTERNAL_SHA256=y
  615. endif
  616. ifeq ($(CONFIG_TLS), gnutls)
  617. OBJS += ../src/crypto/crypto_gnutls.o
  618. OBJS_p += ../src/crypto/crypto_gnutls.o
  619. CONFIG_INTERNAL_SHA256=y
  620. endif
  621. ifeq ($(CONFIG_TLS), schannel)
  622. OBJS += ../src/crypto/crypto_cryptoapi.o
  623. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  624. CONFIG_INTERNAL_SHA256=y
  625. endif
  626. ifeq ($(CONFIG_TLS), internal)
  627. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  628. OBJS += ../src/crypto/crypto_libtomcrypt.o
  629. OBJS_p += ../src/crypto/crypto_libtomcrypt.o
  630. CONFIG_INTERNAL_SHA256=y
  631. endif
  632. ifeq ($(CONFIG_CRYPTO), internal)
  633. OBJS += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o
  634. OBJS_p += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o
  635. CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  636. CONFIG_INTERNAL_AES=y
  637. CONFIG_INTERNAL_DES=y
  638. CONFIG_INTERNAL_SHA1=y
  639. CONFIG_INTERNAL_MD4=y
  640. CONFIG_INTERNAL_MD5=y
  641. CONFIG_INTERNAL_SHA256=y
  642. endif
  643. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  644. OBJS += ../src/crypto/crypto_cryptoapi.o
  645. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  646. CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  647. CONFIG_INTERNAL_SHA256=y
  648. endif
  649. endif
  650. ifeq ($(CONFIG_TLS), none)
  651. OBJS += ../src/crypto/crypto_none.o
  652. OBJS_p += ../src/crypto/crypto_none.o
  653. CONFIG_INTERNAL_SHA256=y
  654. endif
  655. else
  656. CONFIG_INTERNAL_AES=y
  657. CONFIG_INTERNAL_SHA1=y
  658. CONFIG_INTERNAL_MD5=y
  659. endif
  660. ifdef CONFIG_INTERNAL_AES
  661. CFLAGS += -DINTERNAL_AES
  662. endif
  663. ifdef CONFIG_INTERNAL_SHA1
  664. CFLAGS += -DINTERNAL_SHA1
  665. endif
  666. ifdef CONFIG_INTERNAL_SHA256
  667. CFLAGS += -DINTERNAL_SHA256
  668. endif
  669. ifdef CONFIG_INTERNAL_MD5
  670. CFLAGS += -DINTERNAL_MD5
  671. endif
  672. ifdef CONFIG_INTERNAL_MD4
  673. CFLAGS += -DINTERNAL_MD4
  674. endif
  675. ifdef CONFIG_INTERNAL_DES
  676. CFLAGS += -DINTERNAL_DES
  677. endif
  678. ifdef CONFIG_IEEE80211R
  679. NEED_SHA256=y
  680. endif
  681. ifdef NEED_SHA256
  682. OBJS += ../src/crypto/sha256.o
  683. endif
  684. ifdef CONFIG_WIRELESS_EXTENSION
  685. CFLAGS += -DCONFIG_WIRELESS_EXTENSION
  686. OBJS_d += ../src/drivers/driver_wext.o
  687. endif
  688. ifdef CONFIG_CTRL_IFACE
  689. ifeq ($(CONFIG_CTRL_IFACE), y)
  690. ifdef CONFIG_NATIVE_WINDOWS
  691. CONFIG_CTRL_IFACE=named_pipe
  692. else
  693. CONFIG_CTRL_IFACE=unix
  694. endif
  695. endif
  696. CFLAGS += -DCONFIG_CTRL_IFACE
  697. ifeq ($(CONFIG_CTRL_IFACE), unix)
  698. CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
  699. endif
  700. ifeq ($(CONFIG_CTRL_IFACE), udp)
  701. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  702. endif
  703. ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
  704. CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
  705. endif
  706. OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o
  707. endif
  708. ifdef CONFIG_CTRL_IFACE_DBUS
  709. CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
  710. OBJS += ctrl_iface_dbus.o ctrl_iface_dbus_handlers.o dbus_dict_helpers.o
  711. ifndef DBUS_LIBS
  712. DBUS_LIBS := $(shell pkg-config --libs dbus-1)
  713. endif
  714. LIBS += $(DBUS_LIBS)
  715. ifndef DBUS_INCLUDE
  716. DBUS_INCLUDE := $(shell pkg-config --cflags dbus-1)
  717. endif
  718. dbus_version=$(subst ., ,$(shell pkg-config --modversion dbus-1))
  719. DBUS_VERSION_MAJOR=$(word 1,$(dbus_version))
  720. DBUS_VERSION_MINOR=$(word 2,$(dbus_version))
  721. ifeq ($(DBUS_VERSION_MAJOR),)
  722. DBUS_VERSION_MAJOR=0
  723. endif
  724. ifeq ($(DBUS_VERSION_MINOR),)
  725. DBUS_VERSION_MINOR=0
  726. endif
  727. DBUS_INCLUDE += -DDBUS_VERSION_MAJOR=$(DBUS_VERSION_MAJOR)
  728. DBUS_INCLUDE += -DDBUS_VERSION_MINOR=$(DBUS_VERSION_MINOR)
  729. CFLAGS += $(DBUS_INCLUDE)
  730. endif
  731. ifdef CONFIG_READLINE
  732. CFLAGS += -DCONFIG_READLINE
  733. LIBS_c += -lncurses -lreadline
  734. endif
  735. ifdef CONFIG_NATIVE_WINDOWS
  736. CFLAGS += -DCONFIG_NATIVE_WINDOWS
  737. LIBS += -lws2_32 -lgdi32 -lcrypt32
  738. LIBS_c += -lws2_32
  739. LIBS_p += -lws2_32 -lgdi32
  740. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  741. LIBS_p += -lcrypt32
  742. endif
  743. endif
  744. ifdef CONFIG_NO_STDOUT_DEBUG
  745. CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  746. ifndef CONFIG_CTRL_IFACE
  747. CFLAGS += -DCONFIG_NO_WPA_MSG
  748. endif
  749. endif
  750. ifdef CONFIG_IPV6
  751. # for eapol_test only
  752. CFLAGS += -DCONFIG_IPV6
  753. endif
  754. ifdef CONFIG_PEERKEY
  755. CFLAGS += -DCONFIG_PEERKEY
  756. endif
  757. ifdef CONFIG_IEEE80211W
  758. CFLAGS += -DCONFIG_IEEE80211W
  759. NEED_SHA256=y
  760. endif
  761. ifdef CONFIG_IEEE80211R
  762. CFLAGS += -DCONFIG_IEEE80211R
  763. OBJS += ../src/rsn_supp/wpa_ft.o
  764. endif
  765. ifndef CONFIG_NO_WPA
  766. OBJS += ../src/rsn_supp/wpa.o
  767. OBJS += ../src/rsn_supp/preauth.o
  768. OBJS += ../src/rsn_supp/pmksa_cache.o
  769. OBJS += ../src/rsn_supp/peerkey.o
  770. OBJS += ../src/rsn_supp/wpa_ie.o
  771. OBJS += ../src/common/wpa_common.o
  772. NEED_AES=y
  773. else
  774. CFLAGS += -DCONFIG_NO_WPA -DCONFIG_NO_WPA2
  775. endif
  776. ifdef CONFIG_NO_WPA2
  777. CFLAGS += -DCONFIG_NO_WPA2
  778. endif
  779. ifdef CONFIG_NO_WPA_PASSPHRASE
  780. CFLAGS += -DCONFIG_NO_PBKDF2
  781. endif
  782. ifdef CONFIG_NO_AES_EXTRAS
  783. CFLAGS += -DCONFIG_NO_AES_WRAP
  784. CFLAGS += -DCONFIG_NO_AES_CTR -DCONFIG_NO_AES_OMAC1
  785. CFLAGS += -DCONFIG_NO_AES_EAX -DCONFIG_NO_AES_CBC
  786. CFLAGS += -DCONFIG_NO_AES_ENCRYPT
  787. CFLAGS += -DCONFIG_NO_AES_ENCRYPT_BLOCK
  788. endif
  789. ifdef NEED_AES
  790. OBJS += ../src/crypto/aes_wrap.o ../src/crypto/aes.o
  791. endif
  792. ifdef NEED_DH_GROUPS
  793. OBJS += ../src/crypto/dh_groups.o
  794. endif
  795. ifndef NEED_FIPS186_2_PRF
  796. CFLAGS += -DCONFIG_NO_FIPS186_2_PRF
  797. endif
  798. ifndef NEED_T_PRF
  799. CFLAGS += -DCONFIG_NO_T_PRF
  800. endif
  801. ifndef NEED_TLS_PRF
  802. CFLAGS += -DCONFIG_NO_TLS_PRF
  803. endif
  804. ifdef NEED_BASE64
  805. OBJS += ../src/utils/base64.o
  806. endif
  807. ifdef CONFIG_CLIENT_MLME
  808. OBJS += mlme.o
  809. CFLAGS += -DCONFIG_CLIENT_MLME
  810. endif
  811. ifndef CONFIG_MAIN
  812. CONFIG_MAIN=main
  813. endif
  814. ifdef CONFIG_DEBUG_FILE
  815. CFLAGS += -DCONFIG_DEBUG_FILE
  816. endif
  817. OBJS += ../src/drivers/scan_helpers.o
  818. OBJS_wpa_rm := ctrl_iface.o mlme.o ctrl_iface_unix.o
  819. OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.o
  820. ifdef CONFIG_AUTHENTICATOR
  821. OBJS_wpa += tests/link_test.o
  822. endif
  823. OBJS_wpa += $(OBJS_l2)
  824. OBJS += wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o
  825. OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o ../src/radius/radius.o ../src/radius/radius_client.o
  826. OBJS_t += ../src/utils/ip_addr.o
  827. OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o
  828. OBJS += $(CONFIG_MAIN).o
  829. ifdef CONFIG_PRIVSEP
  830. OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o ../src/drivers/scan_helpers.o
  831. OBJS_priv += $(OBJS_l2)
  832. OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
  833. OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
  834. OBJS_priv += ../src/utils/common.o
  835. OBJS_priv += ../src/utils/wpa_debug.o
  836. OBJS_priv += wpa_priv.o
  837. ifdef CONFIG_DRIVER_TEST
  838. OBJS_priv += ../src/crypto/sha1.o
  839. OBJS_priv += ../src/crypto/md5.o
  840. ifeq ($(CONFIG_TLS), openssl)
  841. OBJS_priv += ../src/crypto/crypto_openssl.o
  842. endif
  843. ifeq ($(CONFIG_TLS), gnutls)
  844. OBJS_priv += ../src/crypto/crypto_gnutls.o
  845. endif
  846. ifeq ($(CONFIG_TLS), internal)
  847. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  848. OBJS_priv += ../src/crypto/crypto_libtomcrypt.o
  849. else
  850. OBJS_priv += ../src/crypto/crypto_internal.o
  851. endif
  852. endif
  853. endif # CONFIG_DRIVER_TEST
  854. OBJS += ../src/l2_packet/l2_packet_privsep.o
  855. OBJS += ../src/drivers/driver_privsep.o
  856. EXTRA_progs += wpa_priv
  857. else
  858. OBJS += $(OBJS_d) ../src/drivers/drivers.o
  859. OBJS += $(OBJS_l2)
  860. endif
  861. ifdef CONFIG_NDIS_EVENTS_INTEGRATED
  862. CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
  863. OBJS += ../src/drivers/ndis_events.o
  864. EXTRALIBS += -loleaut32 -lole32 -luuid
  865. ifdef PLATFORMSDKLIB
  866. EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
  867. else
  868. EXTRALIBS += WbemUuid.Lib
  869. endif
  870. endif
  871. ifndef LDO
  872. LDO=$(CC)
  873. endif
  874. dynamic_eap_methods: $(EAPDYN)
  875. wpa_priv: $(OBJS_priv)
  876. $(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
  877. wpa_supplicant: .config $(OBJS) $(EXTRA_progs)
  878. $(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
  879. eapol_test: .config $(OBJS_t)
  880. $(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
  881. preauth_test: .config $(OBJS_t2)
  882. $(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
  883. wpa_passphrase: $(OBJS_p)
  884. $(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p)
  885. wpa_cli: $(OBJS_c)
  886. $(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
  887. link_test: $(OBJS) $(OBJS_h) tests/link_test.o
  888. $(LDO) $(LDFLAGS) -o link_test $(OBJS) $(OBJS_h) tests/link_test.o $(LIBS)
  889. test_wpa: $(OBJS_wpa) $(OBJS_h)
  890. $(LDO) $(LDFLAGS) -o test_wpa $(OBJS_wpa) $(LIBS)
  891. OBJSa=../src/tls/asn1_test.o ../src/tls/asn1.o ../src/tls/x509v3.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_unix.o \
  892. ../src/crypto/crypto_$(CONFIG_CRYPTO).o ../src/crypto/md5.o ../src/crypto/sha1.o \
  893. ../src/crypto/rc4.o ../src/crypto/des.o ../src/crypto/aes_wrap.o \
  894. ../src/crypto/aes.o ../src/tls/bignum.o ../src/tls/rsa.o
  895. asn1_test: $(OBJSa)
  896. $(LDO) $(LDFLAGS) -o asn1_test $(OBJSa)
  897. OBJSx=tests/test_x509v3.o ../src/tls/asn1.o ../src/tls/x509v3.o \
  898. ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_unix.o \
  899. ../src/crypto/crypto_$(CONFIG_CRYPTO).o \
  900. ../src/crypto/md5.o ../src/crypto/sha1.o ../src/crypto/aes.o \
  901. ../src/crypto/rc4.o ../src/crypto/des.o ../src/crypto/aes_wrap.o \
  902. ../src/tls/bignum.o ../src/tls/rsa.o
  903. test_x509v3: $(OBJSx)
  904. $(LDO) $(LDFLAGS) -o test_x509v3 $(OBJSx)
  905. win_if_list: win_if_list.c
  906. $(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
  907. eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c
  908. $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  909. -Deap_peer_psk_register=eap_peer_method_dynamic_init
  910. eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c
  911. $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  912. -Deap_peer_pax_register=eap_peer_method_dynamic_init
  913. eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c
  914. $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  915. -Deap_peer_sake_register=eap_peer_method_dynamic_init
  916. 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
  917. $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  918. -Deap_peer_ikev2_register=eap_peer_method_dynamic_init
  919. %.so: %.c
  920. $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
  921. -D$(*:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
  922. wpa_supplicant.exe: wpa_supplicant
  923. mv -f $< $@
  924. wpa_cli.exe: wpa_cli
  925. mv -f $< $@
  926. wpa_passphrase.exe: wpa_passphrase
  927. mv -f $< $@
  928. win_if_list.exe: win_if_list
  929. mv -f $< $@
  930. eapol_test.exe: eapol_test
  931. mv -f $< $@
  932. WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe
  933. windows-bin: $(WINALL)
  934. $(STRIP) $(WINALL)
  935. wpa_gui/Makefile:
  936. qmake -o wpa_gui/Makefile wpa_gui/wpa_gui.pro
  937. wpa_gui: wpa_gui/Makefile
  938. $(MAKE) -C wpa_gui
  939. wpa_gui-qt4/Makefile:
  940. qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro
  941. wpa_gui-qt4: wpa_gui-qt4/Makefile
  942. $(MAKE) -C wpa_gui-qt4
  943. TEST_MS_FUNCS_OBJS = ../src/crypto/crypto_openssl.o ../src/crypto/sha1.o ../src/crypto/md5.o \
  944. ../src/utils/os_unix.o ../src/crypto/rc4.o tests/test_ms_funcs.o
  945. test-ms_funcs: $(TEST_MS_FUNCS_OBJS)
  946. $(LDO) $(LDFLAGS) -o $@ $(TEST_MS_FUNCS_OBJS) $(LIBS) -lcrypto
  947. ./test-ms_funcs
  948. rm test-ms_funcs
  949. TEST_SHA1_OBJS = ../src/crypto/sha1.o ../src/crypto/md5.o tests/test_sha1.o #../src/crypto/crypto_openssl.o
  950. test-sha1: $(TEST_SHA1_OBJS)
  951. $(LDO) $(LDFLAGS) -o $@ $(TEST_SHA1_OBJS) $(LIBS)
  952. ./test-sha1
  953. rm test-sha1
  954. TEST_SHA256_OBJS = ../src/crypto/sha256.o ../src/crypto/md5.o tests/test_sha256.o ../src/crypto/crypto_openssl.o
  955. test-sha256: $(TEST_SHA256_OBJS)
  956. $(LDO) $(LDFLAGS) -o $@ $(TEST_SHA256_OBJS) $(LIBS)
  957. ./test-sha256
  958. rm test-sha256
  959. TEST_AES_OBJS = ../src/crypto/aes_wrap.o ../src/crypto/aes.o tests/test_aes.o
  960. test-aes: $(TEST_AES_OBJS)
  961. $(LDO) $(LDFLAGS) -o $@ $(TEST_AES_OBJS) $(LIBS)
  962. ./test-aes
  963. rm test-aes
  964. TEST_EAP_SIM_COMMON_OBJS = ../src/crypto/sha1.o ../src/crypto/md5.o \
  965. ../src/crypto/aes_wrap.o ../src/utils/common.o ../src/utils/os_unix.o \
  966. ../src/utils/wpa_debug.o ../src/crypto/aes.o \
  967. tests/test_eap_sim_common.o
  968. test-eap_sim_common: $(TEST_EAP_SIM_COMMON_OBJS)
  969. $(LDO) $(LDFLAGS) -o $@ $(TEST_AES_OBJS) $(LIBS)
  970. ./test-eap_sim_common
  971. rm test-eap_sim_common
  972. TEST_MD4_OBJS = ../src/crypto/md4.o tests/test_md4.o #../src/crypto/crypto_openssl.o
  973. test-md4: $(TEST_MD4_OBJS)
  974. $(LDO) $(LDFLAGS) -o $@ $(TEST_MD4_OBJS) $(LIBS)
  975. ./test-md4
  976. rm test-md4
  977. TEST_MD5_OBJS = ../src/crypto/md5.o tests/test_md5.o #../src/crypto/crypto_openssl.o
  978. test-md5: $(TEST_MD5_OBJS)
  979. $(LDO) $(LDFLAGS) -o $@ $(TEST_MD5_OBJS) $(LIBS)
  980. ./test-md5
  981. rm test-md5
  982. tests: test-ms_funcs test-sha1 test-aes test-eap_sim_common test-md4 test-md5
  983. clean:
  984. $(MAKE) -C ../src clean
  985. rm -f core *~ *.o *.d eap_*.so $(ALL) $(WINALL)
  986. %.eps: %.fig
  987. fig2dev -L eps $*.fig $*.eps
  988. %.png: %.fig
  989. fig2dev -L png -m 3 $*.fig | pngtopnm | pnmscale 0.4 | pnmtopng \
  990. > $*.png
  991. docs-pics: doc/wpa_supplicant.png doc/wpa_supplicant.eps
  992. docs: docs-pics
  993. (cd ..; doxygen wpa_supplicant/doc/doxygen.full; cd wpa_supplicant)
  994. $(MAKE) -C doc/latex
  995. cp doc/latex/refman.pdf wpa_supplicant-devel.pdf
  996. docs-fast: docs-pics
  997. doxygen doc/doxygen.fast
  998. clean-docs:
  999. rm -rf doc/latex doc/html
  1000. rm -f doc/wpa_supplicant.{eps,png} wpa_supplicant-devel.pdf
  1001. wpa_supplicant-sparse: .config $(OBJS)
  1002. @echo Sparse run completed
  1003. run-sparse:
  1004. CC="sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -D__INT_MAX__=2147483647 -D__SHRT_MAX__=32767 -D__LONG_MAX__=2147483647 -D__SCHAR_MAX__=127 -Wbitwise" $(MAKE) wpa_supplicant-sparse
  1005. -include $(OBJS:%.o=%.d)