Makefile 31 KB

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