Makefile 33 KB

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