Makefile 29 KB

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