Makefile 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161
  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. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  551. CFLAGS += -DLTM_FAST
  552. endif
  553. else
  554. LIBS += -ltommath
  555. LIBS_p += -ltommath
  556. endif
  557. endif
  558. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  559. LIBS += -ltomcrypt -ltfm
  560. LIBS_p += -ltomcrypt -ltfm
  561. endif
  562. endif
  563. ifeq ($(CONFIG_TLS), none)
  564. OBJS += ../src/crypto/tls_none.o
  565. CFLAGS += -DEAP_TLS_NONE
  566. CONFIG_INTERNAL_AES=y
  567. CONFIG_INTERNAL_SHA1=y
  568. CONFIG_INTERNAL_MD5=y
  569. CONFIG_INTERNAL_SHA256=y
  570. endif
  571. ifdef CONFIG_SMARTCARD
  572. ifndef CONFIG_NATIVE_WINDOWS
  573. ifneq ($(CONFIG_L2_PACKET), freebsd)
  574. LIBS += -ldl
  575. endif
  576. endif
  577. endif
  578. NEED_CRYPTO=y
  579. else
  580. OBJS += ../src/crypto/tls_none.o
  581. endif
  582. ifdef CONFIG_PKCS12
  583. CFLAGS += -DPKCS12_FUNCS
  584. endif
  585. ifdef CONFIG_SMARTCARD
  586. CFLAGS += -DCONFIG_SMARTCARD
  587. endif
  588. ifdef MS_FUNCS
  589. OBJS += ../src/crypto/ms_funcs.o
  590. NEED_CRYPTO=y
  591. endif
  592. ifdef CHAP
  593. OBJS += ../src/eap_common/chap.o
  594. endif
  595. ifdef NEED_CRYPTO
  596. ifndef TLS_FUNCS
  597. ifeq ($(CONFIG_TLS), openssl)
  598. LIBS += -lcrypto
  599. LIBS_p += -lcrypto
  600. endif
  601. ifeq ($(CONFIG_TLS), gnutls)
  602. LIBS += -lgcrypt
  603. LIBS_p += -lgcrypt
  604. endif
  605. ifeq ($(CONFIG_TLS), schannel)
  606. endif
  607. ifeq ($(CONFIG_TLS), internal)
  608. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  609. LIBS += -ltomcrypt -ltfm
  610. LIBS_p += -ltomcrypt -ltfm
  611. endif
  612. endif
  613. endif
  614. ifeq ($(CONFIG_TLS), openssl)
  615. OBJS += ../src/crypto/crypto_openssl.o
  616. OBJS_p += ../src/crypto/crypto_openssl.o
  617. CONFIG_INTERNAL_SHA256=y
  618. endif
  619. ifeq ($(CONFIG_TLS), gnutls)
  620. OBJS += ../src/crypto/crypto_gnutls.o
  621. OBJS_p += ../src/crypto/crypto_gnutls.o
  622. CONFIG_INTERNAL_SHA256=y
  623. endif
  624. ifeq ($(CONFIG_TLS), schannel)
  625. OBJS += ../src/crypto/crypto_cryptoapi.o
  626. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  627. CONFIG_INTERNAL_SHA256=y
  628. endif
  629. ifeq ($(CONFIG_TLS), internal)
  630. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  631. OBJS += ../src/crypto/crypto_libtomcrypt.o
  632. OBJS_p += ../src/crypto/crypto_libtomcrypt.o
  633. CONFIG_INTERNAL_SHA256=y
  634. endif
  635. ifeq ($(CONFIG_CRYPTO), internal)
  636. OBJS += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o
  637. OBJS_p += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o
  638. CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  639. CONFIG_INTERNAL_AES=y
  640. CONFIG_INTERNAL_DES=y
  641. CONFIG_INTERNAL_SHA1=y
  642. CONFIG_INTERNAL_MD4=y
  643. CONFIG_INTERNAL_MD5=y
  644. CONFIG_INTERNAL_SHA256=y
  645. endif
  646. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  647. OBJS += ../src/crypto/crypto_cryptoapi.o
  648. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  649. CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  650. CONFIG_INTERNAL_SHA256=y
  651. endif
  652. endif
  653. ifeq ($(CONFIG_TLS), none)
  654. OBJS += ../src/crypto/crypto_none.o
  655. OBJS_p += ../src/crypto/crypto_none.o
  656. CONFIG_INTERNAL_SHA256=y
  657. endif
  658. else
  659. CONFIG_INTERNAL_AES=y
  660. CONFIG_INTERNAL_SHA1=y
  661. CONFIG_INTERNAL_MD5=y
  662. endif
  663. ifdef CONFIG_INTERNAL_AES
  664. CFLAGS += -DINTERNAL_AES
  665. endif
  666. ifdef CONFIG_INTERNAL_SHA1
  667. CFLAGS += -DINTERNAL_SHA1
  668. endif
  669. ifdef CONFIG_INTERNAL_SHA256
  670. CFLAGS += -DINTERNAL_SHA256
  671. endif
  672. ifdef CONFIG_INTERNAL_MD5
  673. CFLAGS += -DINTERNAL_MD5
  674. endif
  675. ifdef CONFIG_INTERNAL_MD4
  676. CFLAGS += -DINTERNAL_MD4
  677. endif
  678. ifdef CONFIG_INTERNAL_DES
  679. CFLAGS += -DINTERNAL_DES
  680. endif
  681. ifdef CONFIG_IEEE80211R
  682. NEED_SHA256=y
  683. endif
  684. ifdef NEED_SHA256
  685. OBJS += ../src/crypto/sha256.o
  686. endif
  687. ifdef CONFIG_WIRELESS_EXTENSION
  688. CFLAGS += -DCONFIG_WIRELESS_EXTENSION
  689. OBJS_d += ../src/drivers/driver_wext.o
  690. endif
  691. ifdef CONFIG_CTRL_IFACE
  692. ifeq ($(CONFIG_CTRL_IFACE), y)
  693. ifdef CONFIG_NATIVE_WINDOWS
  694. CONFIG_CTRL_IFACE=named_pipe
  695. else
  696. CONFIG_CTRL_IFACE=unix
  697. endif
  698. endif
  699. CFLAGS += -DCONFIG_CTRL_IFACE
  700. ifeq ($(CONFIG_CTRL_IFACE), unix)
  701. CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
  702. endif
  703. ifeq ($(CONFIG_CTRL_IFACE), udp)
  704. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  705. endif
  706. ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
  707. CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
  708. endif
  709. OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o
  710. endif
  711. ifdef CONFIG_CTRL_IFACE_DBUS
  712. CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
  713. OBJS += ctrl_iface_dbus.o ctrl_iface_dbus_handlers.o dbus_dict_helpers.o
  714. ifndef DBUS_LIBS
  715. DBUS_LIBS := $(shell pkg-config --libs dbus-1)
  716. endif
  717. LIBS += $(DBUS_LIBS)
  718. ifndef DBUS_INCLUDE
  719. DBUS_INCLUDE := $(shell pkg-config --cflags dbus-1)
  720. endif
  721. dbus_version=$(subst ., ,$(shell pkg-config --modversion dbus-1))
  722. DBUS_VERSION_MAJOR=$(word 1,$(dbus_version))
  723. DBUS_VERSION_MINOR=$(word 2,$(dbus_version))
  724. ifeq ($(DBUS_VERSION_MAJOR),)
  725. DBUS_VERSION_MAJOR=0
  726. endif
  727. ifeq ($(DBUS_VERSION_MINOR),)
  728. DBUS_VERSION_MINOR=0
  729. endif
  730. DBUS_INCLUDE += -DDBUS_VERSION_MAJOR=$(DBUS_VERSION_MAJOR)
  731. DBUS_INCLUDE += -DDBUS_VERSION_MINOR=$(DBUS_VERSION_MINOR)
  732. CFLAGS += $(DBUS_INCLUDE)
  733. endif
  734. ifdef CONFIG_READLINE
  735. CFLAGS += -DCONFIG_READLINE
  736. LIBS_c += -lncurses -lreadline
  737. endif
  738. ifdef CONFIG_NATIVE_WINDOWS
  739. CFLAGS += -DCONFIG_NATIVE_WINDOWS
  740. LIBS += -lws2_32 -lgdi32 -lcrypt32
  741. LIBS_c += -lws2_32
  742. LIBS_p += -lws2_32 -lgdi32
  743. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  744. LIBS_p += -lcrypt32
  745. endif
  746. endif
  747. ifdef CONFIG_NO_STDOUT_DEBUG
  748. CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  749. ifndef CONFIG_CTRL_IFACE
  750. CFLAGS += -DCONFIG_NO_WPA_MSG
  751. endif
  752. endif
  753. ifdef CONFIG_IPV6
  754. # for eapol_test only
  755. CFLAGS += -DCONFIG_IPV6
  756. endif
  757. ifdef CONFIG_PEERKEY
  758. CFLAGS += -DCONFIG_PEERKEY
  759. endif
  760. ifdef CONFIG_IEEE80211W
  761. CFLAGS += -DCONFIG_IEEE80211W
  762. NEED_SHA256=y
  763. endif
  764. ifdef CONFIG_IEEE80211R
  765. CFLAGS += -DCONFIG_IEEE80211R
  766. OBJS += ../src/rsn_supp/wpa_ft.o
  767. endif
  768. ifndef CONFIG_NO_WPA
  769. OBJS += ../src/rsn_supp/wpa.o
  770. OBJS += ../src/rsn_supp/preauth.o
  771. OBJS += ../src/rsn_supp/pmksa_cache.o
  772. OBJS += ../src/rsn_supp/peerkey.o
  773. OBJS += ../src/rsn_supp/wpa_ie.o
  774. OBJS += ../src/common/wpa_common.o
  775. NEED_AES=y
  776. else
  777. CFLAGS += -DCONFIG_NO_WPA -DCONFIG_NO_WPA2
  778. endif
  779. ifdef CONFIG_NO_WPA2
  780. CFLAGS += -DCONFIG_NO_WPA2
  781. endif
  782. ifdef CONFIG_NO_WPA_PASSPHRASE
  783. CFLAGS += -DCONFIG_NO_PBKDF2
  784. endif
  785. ifdef CONFIG_NO_AES_EXTRAS
  786. CFLAGS += -DCONFIG_NO_AES_WRAP
  787. CFLAGS += -DCONFIG_NO_AES_CTR -DCONFIG_NO_AES_OMAC1
  788. CFLAGS += -DCONFIG_NO_AES_EAX -DCONFIG_NO_AES_CBC
  789. CFLAGS += -DCONFIG_NO_AES_ENCRYPT
  790. CFLAGS += -DCONFIG_NO_AES_ENCRYPT_BLOCK
  791. endif
  792. ifdef NEED_AES
  793. OBJS += ../src/crypto/aes_wrap.o ../src/crypto/aes.o
  794. endif
  795. ifdef NEED_DH_GROUPS
  796. OBJS += ../src/crypto/dh_groups.o
  797. endif
  798. ifndef NEED_FIPS186_2_PRF
  799. CFLAGS += -DCONFIG_NO_FIPS186_2_PRF
  800. endif
  801. ifndef NEED_T_PRF
  802. CFLAGS += -DCONFIG_NO_T_PRF
  803. endif
  804. ifndef NEED_TLS_PRF
  805. CFLAGS += -DCONFIG_NO_TLS_PRF
  806. endif
  807. ifdef NEED_BASE64
  808. OBJS += ../src/utils/base64.o
  809. endif
  810. ifdef CONFIG_CLIENT_MLME
  811. OBJS += mlme.o
  812. CFLAGS += -DCONFIG_CLIENT_MLME
  813. endif
  814. ifndef CONFIG_MAIN
  815. CONFIG_MAIN=main
  816. endif
  817. ifdef CONFIG_DEBUG_FILE
  818. CFLAGS += -DCONFIG_DEBUG_FILE
  819. endif
  820. OBJS += ../src/drivers/scan_helpers.o
  821. OBJS_wpa_rm := ctrl_iface.o mlme.o ctrl_iface_unix.o
  822. OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.o
  823. ifdef CONFIG_AUTHENTICATOR
  824. OBJS_wpa += tests/link_test.o
  825. endif
  826. OBJS_wpa += $(OBJS_l2)
  827. OBJS += wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o
  828. OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o ../src/radius/radius.o ../src/radius/radius_client.o
  829. OBJS_t += ../src/utils/ip_addr.o
  830. OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o
  831. OBJS += $(CONFIG_MAIN).o
  832. ifdef CONFIG_PRIVSEP
  833. OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o ../src/drivers/scan_helpers.o
  834. OBJS_priv += $(OBJS_l2)
  835. OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
  836. OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
  837. OBJS_priv += ../src/utils/common.o
  838. OBJS_priv += ../src/utils/wpa_debug.o
  839. OBJS_priv += wpa_priv.o
  840. ifdef CONFIG_DRIVER_TEST
  841. OBJS_priv += ../src/crypto/sha1.o
  842. OBJS_priv += ../src/crypto/md5.o
  843. ifeq ($(CONFIG_TLS), openssl)
  844. OBJS_priv += ../src/crypto/crypto_openssl.o
  845. endif
  846. ifeq ($(CONFIG_TLS), gnutls)
  847. OBJS_priv += ../src/crypto/crypto_gnutls.o
  848. endif
  849. ifeq ($(CONFIG_TLS), internal)
  850. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  851. OBJS_priv += ../src/crypto/crypto_libtomcrypt.o
  852. else
  853. OBJS_priv += ../src/crypto/crypto_internal.o
  854. endif
  855. endif
  856. endif # CONFIG_DRIVER_TEST
  857. OBJS += ../src/l2_packet/l2_packet_privsep.o
  858. OBJS += ../src/drivers/driver_privsep.o
  859. EXTRA_progs += wpa_priv
  860. else
  861. OBJS += $(OBJS_d) ../src/drivers/drivers.o
  862. OBJS += $(OBJS_l2)
  863. endif
  864. ifdef CONFIG_NDIS_EVENTS_INTEGRATED
  865. CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
  866. OBJS += ../src/drivers/ndis_events.o
  867. EXTRALIBS += -loleaut32 -lole32 -luuid
  868. ifdef PLATFORMSDKLIB
  869. EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
  870. else
  871. EXTRALIBS += WbemUuid.Lib
  872. endif
  873. endif
  874. ifndef LDO
  875. LDO=$(CC)
  876. endif
  877. dynamic_eap_methods: $(EAPDYN)
  878. wpa_priv: $(OBJS_priv)
  879. $(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
  880. wpa_supplicant: .config $(OBJS) $(EXTRA_progs)
  881. $(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
  882. eapol_test: .config $(OBJS_t)
  883. $(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
  884. preauth_test: .config $(OBJS_t2)
  885. $(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
  886. wpa_passphrase: $(OBJS_p)
  887. $(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p)
  888. wpa_cli: $(OBJS_c)
  889. $(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
  890. link_test: $(OBJS) $(OBJS_h) tests/link_test.o
  891. $(LDO) $(LDFLAGS) -o link_test $(OBJS) $(OBJS_h) tests/link_test.o $(LIBS)
  892. test_wpa: $(OBJS_wpa) $(OBJS_h)
  893. $(LDO) $(LDFLAGS) -o test_wpa $(OBJS_wpa) $(LIBS)
  894. 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 \
  895. ../src/crypto/crypto_$(CONFIG_CRYPTO).o ../src/crypto/md5.o ../src/crypto/sha1.o \
  896. ../src/crypto/rc4.o ../src/crypto/des.o ../src/crypto/aes_wrap.o \
  897. ../src/crypto/aes.o ../src/tls/bignum.o ../src/tls/rsa.o
  898. asn1_test: $(OBJSa)
  899. $(LDO) $(LDFLAGS) -o asn1_test $(OBJSa)
  900. OBJSx=tests/test_x509v3.o ../src/tls/asn1.o ../src/tls/x509v3.o \
  901. ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_unix.o \
  902. ../src/crypto/crypto_$(CONFIG_CRYPTO).o \
  903. ../src/crypto/md5.o ../src/crypto/sha1.o ../src/crypto/aes.o \
  904. ../src/crypto/rc4.o ../src/crypto/des.o ../src/crypto/aes_wrap.o \
  905. ../src/tls/bignum.o ../src/tls/rsa.o
  906. test_x509v3: $(OBJSx)
  907. $(LDO) $(LDFLAGS) -o test_x509v3 $(OBJSx)
  908. win_if_list: win_if_list.c
  909. $(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
  910. eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c
  911. $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  912. -Deap_peer_psk_register=eap_peer_method_dynamic_init
  913. eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c
  914. $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  915. -Deap_peer_pax_register=eap_peer_method_dynamic_init
  916. eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c
  917. $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  918. -Deap_peer_sake_register=eap_peer_method_dynamic_init
  919. 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
  920. $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  921. -Deap_peer_ikev2_register=eap_peer_method_dynamic_init
  922. %.so: %.c
  923. $(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
  924. -D$(*:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
  925. wpa_supplicant.exe: wpa_supplicant
  926. mv -f $< $@
  927. wpa_cli.exe: wpa_cli
  928. mv -f $< $@
  929. wpa_passphrase.exe: wpa_passphrase
  930. mv -f $< $@
  931. win_if_list.exe: win_if_list
  932. mv -f $< $@
  933. eapol_test.exe: eapol_test
  934. mv -f $< $@
  935. WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe
  936. windows-bin: $(WINALL)
  937. $(STRIP) $(WINALL)
  938. wpa_gui/Makefile:
  939. qmake -o wpa_gui/Makefile wpa_gui/wpa_gui.pro
  940. wpa_gui: wpa_gui/Makefile
  941. $(MAKE) -C wpa_gui
  942. wpa_gui-qt4/Makefile:
  943. qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro
  944. wpa_gui-qt4: wpa_gui-qt4/Makefile
  945. $(MAKE) -C wpa_gui-qt4
  946. TEST_MS_FUNCS_OBJS = ../src/crypto/crypto_openssl.o ../src/crypto/sha1.o ../src/crypto/md5.o \
  947. ../src/utils/os_unix.o ../src/crypto/rc4.o tests/test_ms_funcs.o
  948. test-ms_funcs: $(TEST_MS_FUNCS_OBJS)
  949. $(LDO) $(LDFLAGS) -o $@ $(TEST_MS_FUNCS_OBJS) $(LIBS) -lcrypto
  950. ./test-ms_funcs
  951. rm test-ms_funcs
  952. TEST_SHA1_OBJS = ../src/crypto/sha1.o ../src/crypto/md5.o tests/test_sha1.o #../src/crypto/crypto_openssl.o
  953. test-sha1: $(TEST_SHA1_OBJS)
  954. $(LDO) $(LDFLAGS) -o $@ $(TEST_SHA1_OBJS) $(LIBS)
  955. ./test-sha1
  956. rm test-sha1
  957. TEST_SHA256_OBJS = ../src/crypto/sha256.o ../src/crypto/md5.o tests/test_sha256.o ../src/crypto/crypto_openssl.o
  958. test-sha256: $(TEST_SHA256_OBJS)
  959. $(LDO) $(LDFLAGS) -o $@ $(TEST_SHA256_OBJS) $(LIBS)
  960. ./test-sha256
  961. rm test-sha256
  962. TEST_AES_OBJS = ../src/crypto/aes_wrap.o ../src/crypto/aes.o tests/test_aes.o
  963. test-aes: $(TEST_AES_OBJS)
  964. $(LDO) $(LDFLAGS) -o $@ $(TEST_AES_OBJS) $(LIBS)
  965. ./test-aes
  966. rm test-aes
  967. TEST_EAP_SIM_COMMON_OBJS = ../src/crypto/sha1.o ../src/crypto/md5.o \
  968. ../src/crypto/aes_wrap.o ../src/utils/common.o ../src/utils/os_unix.o \
  969. ../src/utils/wpa_debug.o ../src/crypto/aes.o \
  970. tests/test_eap_sim_common.o
  971. test-eap_sim_common: $(TEST_EAP_SIM_COMMON_OBJS)
  972. $(LDO) $(LDFLAGS) -o $@ $(TEST_AES_OBJS) $(LIBS)
  973. ./test-eap_sim_common
  974. rm test-eap_sim_common
  975. TEST_MD4_OBJS = ../src/crypto/md4.o tests/test_md4.o #../src/crypto/crypto_openssl.o
  976. test-md4: $(TEST_MD4_OBJS)
  977. $(LDO) $(LDFLAGS) -o $@ $(TEST_MD4_OBJS) $(LIBS)
  978. ./test-md4
  979. rm test-md4
  980. TEST_MD5_OBJS = ../src/crypto/md5.o tests/test_md5.o #../src/crypto/crypto_openssl.o
  981. test-md5: $(TEST_MD5_OBJS)
  982. $(LDO) $(LDFLAGS) -o $@ $(TEST_MD5_OBJS) $(LIBS)
  983. ./test-md5
  984. rm test-md5
  985. tests: test-ms_funcs test-sha1 test-aes test-eap_sim_common test-md4 test-md5
  986. clean:
  987. $(MAKE) -C ../src clean
  988. rm -f core *~ *.o *.d eap_*.so $(ALL) $(WINALL)
  989. %.eps: %.fig
  990. fig2dev -L eps $*.fig $*.eps
  991. %.png: %.fig
  992. fig2dev -L png -m 3 $*.fig | pngtopnm | pnmscale 0.4 | pnmtopng \
  993. > $*.png
  994. docs-pics: doc/wpa_supplicant.png doc/wpa_supplicant.eps
  995. docs: docs-pics
  996. (cd ..; doxygen wpa_supplicant/doc/doxygen.full; cd wpa_supplicant)
  997. $(MAKE) -C doc/latex
  998. cp doc/latex/refman.pdf wpa_supplicant-devel.pdf
  999. docs-fast: docs-pics
  1000. doxygen doc/doxygen.fast
  1001. clean-docs:
  1002. rm -rf doc/latex doc/html
  1003. rm -f doc/wpa_supplicant.{eps,png} wpa_supplicant-devel.pdf
  1004. wpa_supplicant-sparse: .config $(OBJS)
  1005. @echo Sparse run completed
  1006. run-sparse:
  1007. 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
  1008. -include $(OBJS:%.o=%.d)