Makefile 31 KB

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