Makefile 32 KB

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