Makefile 30 KB

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