Makefile 31 KB

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