Makefile 31 KB

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