Makefile 29 KB

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