Makefile 32 KB

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