Makefile 30 KB

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