Makefile 30 KB

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