Makefile 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270
  1. ifndef CC
  2. CC=gcc
  3. endif
  4. ifndef CFLAGS
  5. CFLAGS = -MMD -O2 -Wall -g
  6. endif
  7. ifdef LIBS
  8. # If LIBS is set with some global build system defaults, clone those for
  9. # LIBS_c, LIBS_h, and LIBS_n to cover hostapd_cli, hlr_auc_gw, and
  10. # nt_password_hash as well.
  11. ifndef LIBS_c
  12. LIBS_c := $(LIBS)
  13. endif
  14. ifndef LIBS_h
  15. LIBS_h := $(LIBS)
  16. endif
  17. ifndef LIBS_n
  18. LIBS_n := $(LIBS)
  19. endif
  20. endif
  21. CFLAGS += $(EXTRA_CFLAGS)
  22. CFLAGS += -I$(abspath ../src)
  23. CFLAGS += -I$(abspath ../src/utils)
  24. export BINDIR ?= /usr/local/bin/
  25. -include .config
  26. ifndef CONFIG_NO_GITVER
  27. # Add VERSION_STR postfix for builds from a git repository
  28. ifeq ($(wildcard ../.git),../.git)
  29. GITVER := $(shell git describe --dirty=+)
  30. ifneq ($(GITVER),)
  31. CFLAGS += -DGIT_VERSION_STR_POSTFIX=\"-$(GITVER)\"
  32. endif
  33. endif
  34. endif
  35. ifdef CONFIG_TESTING_OPTIONS
  36. CFLAGS += -DCONFIG_TESTING_OPTIONS
  37. CONFIG_WPS_TESTING=y
  38. endif
  39. ifndef CONFIG_OS
  40. ifdef CONFIG_NATIVE_WINDOWS
  41. CONFIG_OS=win32
  42. else
  43. CONFIG_OS=unix
  44. endif
  45. endif
  46. ifeq ($(CONFIG_OS), internal)
  47. CFLAGS += -DOS_NO_C_LIB_DEFINES
  48. endif
  49. ifdef CONFIG_NATIVE_WINDOWS
  50. CFLAGS += -DCONFIG_NATIVE_WINDOWS
  51. LIBS += -lws2_32
  52. endif
  53. OBJS += main.o
  54. OBJS += config_file.o
  55. OBJS += ../src/ap/hostapd.o
  56. OBJS += ../src/ap/wpa_auth_glue.o
  57. OBJS += ../src/ap/drv_callbacks.o
  58. OBJS += ../src/ap/ap_drv_ops.o
  59. OBJS += ../src/ap/utils.o
  60. OBJS += ../src/ap/authsrv.o
  61. OBJS += ../src/ap/ieee802_1x.o
  62. OBJS += ../src/ap/ap_config.o
  63. OBJS += ../src/ap/eap_user_db.o
  64. OBJS += ../src/ap/ieee802_11_auth.o
  65. OBJS += ../src/ap/sta_info.o
  66. OBJS += ../src/ap/wpa_auth.o
  67. OBJS += ../src/ap/tkip_countermeasures.o
  68. OBJS += ../src/ap/ap_mlme.o
  69. OBJS += ../src/ap/wpa_auth_ie.o
  70. OBJS += ../src/ap/preauth_auth.o
  71. OBJS += ../src/ap/pmksa_cache_auth.o
  72. OBJS += ../src/ap/ieee802_11_shared.o
  73. OBJS += ../src/ap/beacon.o
  74. OBJS += ../src/ap/bss_load.o
  75. OBJS += ../src/ap/neighbor_db.o
  76. OBJS += ../src/ap/rrm.o
  77. OBJS_c = hostapd_cli.o
  78. OBJS_c += ../src/common/wpa_ctrl.o
  79. OBJS_c += ../src/utils/os_$(CONFIG_OS).o
  80. OBJS_c += ../src/common/cli.o
  81. NEED_RC4=y
  82. NEED_AES=y
  83. NEED_MD5=y
  84. NEED_SHA1=y
  85. OBJS += ../src/drivers/drivers.o
  86. CFLAGS += -DHOSTAPD
  87. ifdef CONFIG_TAXONOMY
  88. CFLAGS += -DCONFIG_TAXONOMY
  89. OBJS += ../src/ap/taxonomy.o
  90. endif
  91. ifdef CONFIG_MODULE_TESTS
  92. CFLAGS += -DCONFIG_MODULE_TESTS
  93. OBJS += hapd_module_tests.o
  94. endif
  95. ifdef CONFIG_WPA_TRACE
  96. CFLAGS += -DWPA_TRACE
  97. OBJS += ../src/utils/trace.o
  98. HOBJS += ../src/utils/trace.o
  99. LDFLAGS += -rdynamic
  100. CFLAGS += -funwind-tables
  101. ifdef CONFIG_WPA_TRACE_BFD
  102. CFLAGS += -DPACKAGE="hostapd" -DWPA_TRACE_BFD
  103. LIBS += -lbfd -ldl -liberty -lz
  104. LIBS_c += -lbfd -ldl -liberty -lz
  105. LIBS_h += -lbfd -ldl -liberty -lz
  106. endif
  107. endif
  108. ifndef CONFIG_ELOOP
  109. CONFIG_ELOOP=eloop
  110. endif
  111. OBJS += ../src/utils/$(CONFIG_ELOOP).o
  112. OBJS_c += ../src/utils/$(CONFIG_ELOOP).o
  113. ifeq ($(CONFIG_ELOOP), eloop)
  114. # Using glibc < 2.17 requires -lrt for clock_gettime()
  115. LIBS += -lrt
  116. LIBS_c += -lrt
  117. LIBS_h += -lrt
  118. LIBS_n += -lrt
  119. endif
  120. ifdef CONFIG_ELOOP_POLL
  121. CFLAGS += -DCONFIG_ELOOP_POLL
  122. endif
  123. ifdef CONFIG_ELOOP_EPOLL
  124. CFLAGS += -DCONFIG_ELOOP_EPOLL
  125. endif
  126. ifdef CONFIG_ELOOP_KQUEUE
  127. CFLAGS += -DCONFIG_ELOOP_KQUEUE
  128. endif
  129. OBJS += ../src/utils/common.o
  130. OBJS_c += ../src/utils/common.o
  131. OBJS += ../src/utils/wpa_debug.o
  132. OBJS_c += ../src/utils/wpa_debug.o
  133. OBJS += ../src/utils/wpabuf.o
  134. OBJS += ../src/utils/os_$(CONFIG_OS).o
  135. OBJS += ../src/utils/ip_addr.o
  136. OBJS += ../src/common/ieee802_11_common.o
  137. OBJS += ../src/common/wpa_common.o
  138. OBJS += ../src/common/hw_features_common.o
  139. OBJS += ../src/eapol_auth/eapol_auth_sm.o
  140. ifdef CONFIG_CODE_COVERAGE
  141. CFLAGS += -O0 -fprofile-arcs -ftest-coverage
  142. LIBS += -lgcov
  143. LIBS_c += -lgcov
  144. LIBS_h += -lgcov
  145. LIBS_n += -lgcov
  146. endif
  147. ifndef CONFIG_NO_DUMP_STATE
  148. # define HOSTAPD_DUMP_STATE to include support for dumping internal state
  149. # through control interface commands (undefine it, if you want to save in
  150. # binary size)
  151. CFLAGS += -DHOSTAPD_DUMP_STATE
  152. OBJS += ../src/eapol_auth/eapol_auth_dump.o
  153. endif
  154. ifdef CONFIG_NO_RADIUS
  155. CFLAGS += -DCONFIG_NO_RADIUS
  156. CONFIG_NO_ACCOUNTING=y
  157. else
  158. OBJS += ../src/radius/radius.o
  159. OBJS += ../src/radius/radius_client.o
  160. OBJS += ../src/radius/radius_das.o
  161. endif
  162. ifdef CONFIG_NO_ACCOUNTING
  163. CFLAGS += -DCONFIG_NO_ACCOUNTING
  164. else
  165. OBJS += ../src/ap/accounting.o
  166. endif
  167. ifdef CONFIG_NO_VLAN
  168. CFLAGS += -DCONFIG_NO_VLAN
  169. else
  170. OBJS += ../src/ap/vlan_init.o
  171. OBJS += ../src/ap/vlan_ifconfig.o
  172. OBJS += ../src/ap/vlan.o
  173. ifdef CONFIG_FULL_DYNAMIC_VLAN
  174. # Define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
  175. # and VLAN interfaces for the VLAN feature.
  176. CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
  177. OBJS += ../src/ap/vlan_full.o
  178. ifdef CONFIG_VLAN_NETLINK
  179. OBJS += ../src/ap/vlan_util.o
  180. else
  181. OBJS += ../src/ap/vlan_ioctl.o
  182. endif
  183. endif
  184. endif
  185. ifdef CONFIG_NO_CTRL_IFACE
  186. CFLAGS += -DCONFIG_NO_CTRL_IFACE
  187. else
  188. ifeq ($(CONFIG_CTRL_IFACE), udp)
  189. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  190. else
  191. ifeq ($(CONFIG_CTRL_IFACE), udp6)
  192. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  193. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
  194. else
  195. ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
  196. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  197. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  198. else
  199. ifeq ($(CONFIG_CTRL_IFACE), udp6-remote)
  200. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  201. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  202. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
  203. else
  204. CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
  205. endif
  206. endif
  207. endif
  208. endif
  209. OBJS += ../src/common/ctrl_iface_common.o
  210. OBJS += ctrl_iface.o
  211. OBJS += ../src/ap/ctrl_iface_ap.o
  212. endif
  213. ifndef CONFIG_NO_CTRL_IFACE
  214. CFLAGS += -DCONFIG_CTRL_IFACE
  215. endif
  216. ifdef CONFIG_IAPP
  217. CFLAGS += -DCONFIG_IAPP
  218. OBJS += ../src/ap/iapp.o
  219. endif
  220. ifdef CONFIG_RSN_PREAUTH
  221. CFLAGS += -DCONFIG_RSN_PREAUTH
  222. CONFIG_L2_PACKET=y
  223. endif
  224. ifdef CONFIG_PEERKEY
  225. CFLAGS += -DCONFIG_PEERKEY
  226. OBJS += ../src/ap/peerkey_auth.o
  227. endif
  228. ifdef CONFIG_HS20
  229. NEED_AES_OMAC1=y
  230. CONFIG_PROXYARP=y
  231. endif
  232. ifdef CONFIG_PROXYARP
  233. CONFIG_L2_PACKET=y
  234. endif
  235. ifdef CONFIG_SUITEB
  236. CFLAGS += -DCONFIG_SUITEB
  237. NEED_SHA256=y
  238. NEED_AES_OMAC1=y
  239. endif
  240. ifdef CONFIG_SUITEB192
  241. CFLAGS += -DCONFIG_SUITEB192
  242. NEED_SHA384=y
  243. endif
  244. ifdef CONFIG_IEEE80211W
  245. CFLAGS += -DCONFIG_IEEE80211W
  246. NEED_SHA256=y
  247. NEED_AES_OMAC1=y
  248. endif
  249. ifdef CONFIG_IEEE80211R
  250. CFLAGS += -DCONFIG_IEEE80211R -DCONFIG_IEEE80211R_AP
  251. OBJS += ../src/ap/wpa_auth_ft.o
  252. NEED_SHA256=y
  253. NEED_AES_OMAC1=y
  254. NEED_AES_UNWRAP=y
  255. NEED_AES_SIV=y
  256. NEED_ETH_P_OUI=y
  257. NEED_SHA256=y
  258. NEED_HMAC_SHA256_KDF=y
  259. endif
  260. ifdef NEED_ETH_P_OUI
  261. CFLAGS += -DCONFIG_ETH_P_OUI
  262. OBJS += ../src/ap/eth_p_oui.o
  263. endif
  264. ifdef CONFIG_SAE
  265. CFLAGS += -DCONFIG_SAE
  266. OBJS += ../src/common/sae.o
  267. NEED_ECC=y
  268. NEED_DH_GROUPS=y
  269. NEED_AP_MLME=y
  270. endif
  271. ifdef CONFIG_OWE
  272. CFLAGS += -DCONFIG_OWE
  273. NEED_ECC=y
  274. NEED_HMAC_SHA256_KDF=y
  275. endif
  276. ifdef CONFIG_FILS
  277. CFLAGS += -DCONFIG_FILS
  278. OBJS += ../src/ap/fils_hlp.o
  279. NEED_SHA384=y
  280. NEED_AES_SIV=y
  281. ifdef CONFIG_FILS_SK_PFS
  282. CFLAGS += -DCONFIG_FILS_SK_PFS
  283. NEED_ECC=y
  284. endif
  285. endif
  286. ifdef CONFIG_WNM
  287. CFLAGS += -DCONFIG_WNM
  288. OBJS += ../src/ap/wnm_ap.o
  289. endif
  290. ifdef CONFIG_IEEE80211N
  291. CFLAGS += -DCONFIG_IEEE80211N
  292. endif
  293. ifdef CONFIG_IEEE80211AC
  294. CFLAGS += -DCONFIG_IEEE80211AC
  295. endif
  296. ifdef CONFIG_IEEE80211AX
  297. CFLAGS += -DCONFIG_IEEE80211AX
  298. OBJS += ../src/ap/ieee802_11_he.o
  299. endif
  300. ifdef CONFIG_MBO
  301. CFLAGS += -DCONFIG_MBO
  302. OBJS += ../src/ap/mbo_ap.o
  303. endif
  304. include ../src/drivers/drivers.mak
  305. OBJS += $(DRV_AP_OBJS)
  306. CFLAGS += $(DRV_AP_CFLAGS)
  307. LDFLAGS += $(DRV_AP_LDFLAGS)
  308. LIBS += $(DRV_AP_LIBS)
  309. ifdef CONFIG_L2_PACKET
  310. ifdef CONFIG_DNET_PCAP
  311. ifdef CONFIG_L2_FREEBSD
  312. LIBS += -lpcap
  313. OBJS += ../src/l2_packet/l2_packet_freebsd.o
  314. else
  315. LIBS += -ldnet -lpcap
  316. OBJS += ../src/l2_packet/l2_packet_pcap.o
  317. endif
  318. else
  319. OBJS += ../src/l2_packet/l2_packet_linux.o
  320. endif
  321. else
  322. OBJS += ../src/l2_packet/l2_packet_none.o
  323. endif
  324. ifdef CONFIG_ERP
  325. CFLAGS += -DCONFIG_ERP
  326. NEED_SHA256=y
  327. NEED_HMAC_SHA256_KDF=y
  328. endif
  329. ifdef CONFIG_EAP_MD5
  330. CFLAGS += -DEAP_SERVER_MD5
  331. OBJS += ../src/eap_server/eap_server_md5.o
  332. CHAP=y
  333. endif
  334. ifdef CONFIG_EAP_TLS
  335. CFLAGS += -DEAP_SERVER_TLS
  336. OBJS += ../src/eap_server/eap_server_tls.o
  337. TLS_FUNCS=y
  338. endif
  339. ifdef CONFIG_EAP_UNAUTH_TLS
  340. CFLAGS += -DEAP_SERVER_UNAUTH_TLS
  341. ifndef CONFIG_EAP_TLS
  342. OBJS += ../src/eap_server/eap_server_tls.o
  343. TLS_FUNCS=y
  344. endif
  345. endif
  346. ifdef CONFIG_EAP_PEAP
  347. CFLAGS += -DEAP_SERVER_PEAP
  348. OBJS += ../src/eap_server/eap_server_peap.o
  349. OBJS += ../src/eap_common/eap_peap_common.o
  350. TLS_FUNCS=y
  351. CONFIG_EAP_MSCHAPV2=y
  352. endif
  353. ifdef CONFIG_EAP_TTLS
  354. CFLAGS += -DEAP_SERVER_TTLS
  355. OBJS += ../src/eap_server/eap_server_ttls.o
  356. TLS_FUNCS=y
  357. CHAP=y
  358. endif
  359. ifdef CONFIG_EAP_MSCHAPV2
  360. CFLAGS += -DEAP_SERVER_MSCHAPV2
  361. OBJS += ../src/eap_server/eap_server_mschapv2.o
  362. MS_FUNCS=y
  363. endif
  364. ifdef CONFIG_EAP_GTC
  365. CFLAGS += -DEAP_SERVER_GTC
  366. OBJS += ../src/eap_server/eap_server_gtc.o
  367. endif
  368. ifdef CONFIG_EAP_SIM
  369. CFLAGS += -DEAP_SERVER_SIM
  370. OBJS += ../src/eap_server/eap_server_sim.o
  371. CONFIG_EAP_SIM_COMMON=y
  372. NEED_AES_CBC=y
  373. endif
  374. ifdef CONFIG_EAP_AKA
  375. CFLAGS += -DEAP_SERVER_AKA
  376. OBJS += ../src/eap_server/eap_server_aka.o
  377. CONFIG_EAP_SIM_COMMON=y
  378. NEED_SHA256=y
  379. NEED_AES_CBC=y
  380. endif
  381. ifdef CONFIG_EAP_AKA_PRIME
  382. CFLAGS += -DEAP_SERVER_AKA_PRIME
  383. endif
  384. ifdef CONFIG_EAP_SIM_COMMON
  385. OBJS += ../src/eap_common/eap_sim_common.o
  386. # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
  387. # replaced with another file implementating the interface specified in
  388. # eap_sim_db.h.
  389. OBJS += ../src/eap_server/eap_sim_db.o
  390. NEED_FIPS186_2_PRF=y
  391. endif
  392. ifdef CONFIG_EAP_PAX
  393. CFLAGS += -DEAP_SERVER_PAX
  394. OBJS += ../src/eap_server/eap_server_pax.o ../src/eap_common/eap_pax_common.o
  395. endif
  396. ifdef CONFIG_EAP_PSK
  397. CFLAGS += -DEAP_SERVER_PSK
  398. OBJS += ../src/eap_server/eap_server_psk.o ../src/eap_common/eap_psk_common.o
  399. NEED_AES_OMAC1=y
  400. NEED_AES_ENCBLOCK=y
  401. NEED_AES_EAX=y
  402. endif
  403. ifdef CONFIG_EAP_SAKE
  404. CFLAGS += -DEAP_SERVER_SAKE
  405. OBJS += ../src/eap_server/eap_server_sake.o ../src/eap_common/eap_sake_common.o
  406. endif
  407. ifdef CONFIG_EAP_GPSK
  408. CFLAGS += -DEAP_SERVER_GPSK
  409. OBJS += ../src/eap_server/eap_server_gpsk.o ../src/eap_common/eap_gpsk_common.o
  410. ifdef CONFIG_EAP_GPSK_SHA256
  411. CFLAGS += -DEAP_GPSK_SHA256
  412. endif
  413. NEED_SHA256=y
  414. NEED_AES_OMAC1=y
  415. endif
  416. ifdef CONFIG_EAP_PWD
  417. CFLAGS += -DEAP_SERVER_PWD
  418. OBJS += ../src/eap_server/eap_server_pwd.o ../src/eap_common/eap_pwd_common.o
  419. NEED_SHA256=y
  420. endif
  421. ifdef CONFIG_EAP_EKE
  422. CFLAGS += -DEAP_SERVER_EKE
  423. OBJS += ../src/eap_server/eap_server_eke.o ../src/eap_common/eap_eke_common.o
  424. NEED_DH_GROUPS=y
  425. NEED_DH_GROUPS_ALL=y
  426. endif
  427. ifdef CONFIG_EAP_VENDOR_TEST
  428. CFLAGS += -DEAP_SERVER_VENDOR_TEST
  429. OBJS += ../src/eap_server/eap_server_vendor_test.o
  430. endif
  431. ifdef CONFIG_EAP_FAST
  432. CFLAGS += -DEAP_SERVER_FAST
  433. OBJS += ../src/eap_server/eap_server_fast.o
  434. OBJS += ../src/eap_common/eap_fast_common.o
  435. TLS_FUNCS=y
  436. NEED_T_PRF=y
  437. NEED_AES_UNWRAP=y
  438. endif
  439. ifdef CONFIG_WPS
  440. CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
  441. OBJS += ../src/utils/uuid.o
  442. OBJS += ../src/ap/wps_hostapd.o
  443. OBJS += ../src/eap_server/eap_server_wsc.o ../src/eap_common/eap_wsc_common.o
  444. OBJS += ../src/wps/wps.o
  445. OBJS += ../src/wps/wps_common.o
  446. OBJS += ../src/wps/wps_attr_parse.o
  447. OBJS += ../src/wps/wps_attr_build.o
  448. OBJS += ../src/wps/wps_attr_process.o
  449. OBJS += ../src/wps/wps_dev_attr.o
  450. OBJS += ../src/wps/wps_enrollee.o
  451. OBJS += ../src/wps/wps_registrar.o
  452. NEED_DH_GROUPS=y
  453. NEED_SHA256=y
  454. NEED_BASE64=y
  455. NEED_AES_CBC=y
  456. NEED_MODEXP=y
  457. CONFIG_EAP=y
  458. ifdef CONFIG_WPS_NFC
  459. CFLAGS += -DCONFIG_WPS_NFC
  460. OBJS += ../src/wps/ndef.o
  461. NEED_WPS_OOB=y
  462. endif
  463. ifdef NEED_WPS_OOB
  464. CFLAGS += -DCONFIG_WPS_OOB
  465. endif
  466. ifdef CONFIG_WPS_UPNP
  467. CFLAGS += -DCONFIG_WPS_UPNP
  468. OBJS += ../src/wps/wps_upnp.o
  469. OBJS += ../src/wps/wps_upnp_ssdp.o
  470. OBJS += ../src/wps/wps_upnp_web.o
  471. OBJS += ../src/wps/wps_upnp_event.o
  472. OBJS += ../src/wps/wps_upnp_ap.o
  473. OBJS += ../src/wps/upnp_xml.o
  474. OBJS += ../src/wps/httpread.o
  475. OBJS += ../src/wps/http_client.o
  476. OBJS += ../src/wps/http_server.o
  477. endif
  478. ifdef CONFIG_WPS_STRICT
  479. CFLAGS += -DCONFIG_WPS_STRICT
  480. OBJS += ../src/wps/wps_validate.o
  481. endif
  482. ifdef CONFIG_WPS_TESTING
  483. CFLAGS += -DCONFIG_WPS_TESTING
  484. endif
  485. endif
  486. ifdef CONFIG_DPP
  487. CFLAGS += -DCONFIG_DPP
  488. OBJS += ../src/common/dpp.o
  489. OBJS += ../src/ap/dpp_hostapd.o
  490. OBJS += ../src/ap/gas_query_ap.o
  491. NEED_AES_SIV=y
  492. NEED_HMAC_SHA256_KDF=y
  493. NEED_HMAC_SHA384_KDF=y
  494. NEED_HMAC_SHA512_KDF=y
  495. NEED_SHA256=y
  496. NEED_SHA384=y
  497. NEED_SHA512=y
  498. NEED_JSON=y
  499. NEED_GAS=y
  500. endif
  501. ifdef CONFIG_EAP_IKEV2
  502. CFLAGS += -DEAP_SERVER_IKEV2
  503. OBJS += ../src/eap_server/eap_server_ikev2.o ../src/eap_server/ikev2.o
  504. OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  505. NEED_DH_GROUPS=y
  506. NEED_DH_GROUPS_ALL=y
  507. NEED_MODEXP=y
  508. NEED_CIPHER=y
  509. endif
  510. ifdef CONFIG_EAP_TNC
  511. CFLAGS += -DEAP_SERVER_TNC
  512. OBJS += ../src/eap_server/eap_server_tnc.o
  513. OBJS += ../src/eap_server/tncs.o
  514. NEED_BASE64=y
  515. ifndef CONFIG_DRIVER_BSD
  516. LIBS += -ldl
  517. endif
  518. endif
  519. # Basic EAP functionality is needed for EAPOL
  520. OBJS += eap_register.o
  521. OBJS += ../src/eap_server/eap_server.o
  522. OBJS += ../src/eap_common/eap_common.o
  523. OBJS += ../src/eap_server/eap_server_methods.o
  524. OBJS += ../src/eap_server/eap_server_identity.o
  525. CFLAGS += -DEAP_SERVER_IDENTITY
  526. ifdef CONFIG_EAP
  527. CFLAGS += -DEAP_SERVER
  528. endif
  529. ifdef CONFIG_PKCS12
  530. CFLAGS += -DPKCS12_FUNCS
  531. endif
  532. ifdef MS_FUNCS
  533. OBJS += ../src/crypto/ms_funcs.o
  534. NEED_DES=y
  535. NEED_MD4=y
  536. endif
  537. ifdef CHAP
  538. OBJS += ../src/eap_common/chap.o
  539. endif
  540. ifdef TLS_FUNCS
  541. NEED_DES=y
  542. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
  543. CFLAGS += -DEAP_TLS_FUNCS
  544. OBJS += ../src/eap_server/eap_server_tls_common.o
  545. NEED_TLS_PRF=y
  546. endif
  547. ifndef CONFIG_TLS
  548. CONFIG_TLS=openssl
  549. endif
  550. ifdef CONFIG_TLSV11
  551. CFLAGS += -DCONFIG_TLSV11
  552. endif
  553. ifdef CONFIG_TLSV12
  554. CFLAGS += -DCONFIG_TLSV12
  555. NEED_SHA256=y
  556. endif
  557. ifeq ($(CONFIG_TLS), openssl)
  558. ifdef TLS_FUNCS
  559. OBJS += ../src/crypto/tls_openssl.o
  560. OBJS += ../src/crypto/tls_openssl_ocsp.o
  561. LIBS += -lssl
  562. endif
  563. OBJS += ../src/crypto/crypto_openssl.o
  564. HOBJS += ../src/crypto/crypto_openssl.o
  565. ifdef NEED_FIPS186_2_PRF
  566. OBJS += ../src/crypto/fips_prf_openssl.o
  567. endif
  568. NEED_SHA256=y
  569. NEED_TLS_PRF_SHA256=y
  570. LIBS += -lcrypto
  571. LIBS_h += -lcrypto
  572. ifdef CONFIG_TLS_ADD_DL
  573. LIBS += -ldl
  574. LIBS_h += -ldl
  575. endif
  576. ifndef CONFIG_TLS_DEFAULT_CIPHERS
  577. CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW"
  578. endif
  579. CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\"
  580. endif
  581. ifeq ($(CONFIG_TLS), gnutls)
  582. ifdef TLS_FUNCS
  583. OBJS += ../src/crypto/tls_gnutls.o
  584. LIBS += -lgnutls -lgpg-error
  585. endif
  586. OBJS += ../src/crypto/crypto_gnutls.o
  587. HOBJS += ../src/crypto/crypto_gnutls.o
  588. ifdef NEED_FIPS186_2_PRF
  589. OBJS += ../src/crypto/fips_prf_internal.o
  590. SHA1OBJS += ../src/crypto/sha1-internal.o
  591. endif
  592. LIBS += -lgcrypt
  593. LIBS_h += -lgcrypt
  594. CONFIG_INTERNAL_SHA256=y
  595. CONFIG_INTERNAL_RC4=y
  596. CONFIG_INTERNAL_DH_GROUP5=y
  597. endif
  598. ifeq ($(CONFIG_TLS), internal)
  599. ifndef CONFIG_CRYPTO
  600. CONFIG_CRYPTO=internal
  601. endif
  602. ifdef TLS_FUNCS
  603. OBJS += ../src/crypto/crypto_internal-rsa.o
  604. OBJS += ../src/crypto/tls_internal.o
  605. OBJS += ../src/tls/tlsv1_common.o
  606. OBJS += ../src/tls/tlsv1_record.o
  607. OBJS += ../src/tls/tlsv1_cred.o
  608. OBJS += ../src/tls/tlsv1_server.o
  609. OBJS += ../src/tls/tlsv1_server_write.o
  610. OBJS += ../src/tls/tlsv1_server_read.o
  611. OBJS += ../src/tls/asn1.o
  612. OBJS += ../src/tls/rsa.o
  613. OBJS += ../src/tls/x509v3.o
  614. OBJS += ../src/tls/pkcs1.o
  615. OBJS += ../src/tls/pkcs5.o
  616. OBJS += ../src/tls/pkcs8.o
  617. NEED_SHA256=y
  618. NEED_BASE64=y
  619. NEED_TLS_PRF=y
  620. ifdef CONFIG_TLSV12
  621. NEED_TLS_PRF_SHA256=y
  622. endif
  623. NEED_MODEXP=y
  624. NEED_CIPHER=y
  625. CFLAGS += -DCONFIG_TLS_INTERNAL
  626. CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
  627. endif
  628. ifdef NEED_CIPHER
  629. NEED_DES=y
  630. OBJS += ../src/crypto/crypto_internal-cipher.o
  631. endif
  632. ifdef NEED_MODEXP
  633. OBJS += ../src/crypto/crypto_internal-modexp.o
  634. OBJS += ../src/tls/bignum.o
  635. endif
  636. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  637. OBJS += ../src/crypto/crypto_libtomcrypt.o
  638. LIBS += -ltomcrypt -ltfm
  639. LIBS_h += -ltomcrypt -ltfm
  640. CONFIG_INTERNAL_SHA256=y
  641. CONFIG_INTERNAL_RC4=y
  642. CONFIG_INTERNAL_DH_GROUP5=y
  643. endif
  644. ifeq ($(CONFIG_CRYPTO), internal)
  645. OBJS += ../src/crypto/crypto_internal.o
  646. NEED_AES_DEC=y
  647. CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  648. ifdef CONFIG_INTERNAL_LIBTOMMATH
  649. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  650. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  651. CFLAGS += -DLTM_FAST
  652. endif
  653. else
  654. LIBS += -ltommath
  655. LIBS_h += -ltommath
  656. endif
  657. CONFIG_INTERNAL_AES=y
  658. CONFIG_INTERNAL_DES=y
  659. CONFIG_INTERNAL_SHA1=y
  660. CONFIG_INTERNAL_MD4=y
  661. CONFIG_INTERNAL_MD5=y
  662. CONFIG_INTERNAL_SHA256=y
  663. CONFIG_INTERNAL_SHA384=y
  664. CONFIG_INTERNAL_SHA512=y
  665. CONFIG_INTERNAL_RC4=y
  666. CONFIG_INTERNAL_DH_GROUP5=y
  667. endif
  668. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  669. OBJS += ../src/crypto/crypto_cryptoapi.o
  670. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  671. CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  672. CONFIG_INTERNAL_SHA256=y
  673. CONFIG_INTERNAL_RC4=y
  674. endif
  675. endif
  676. ifeq ($(CONFIG_TLS), linux)
  677. OBJS += ../src/crypto/crypto_linux.o
  678. ifdef TLS_FUNCS
  679. OBJS += ../src/crypto/crypto_internal-rsa.o
  680. OBJS += ../src/crypto/tls_internal.o
  681. OBJS += ../src/tls/tlsv1_common.o
  682. OBJS += ../src/tls/tlsv1_record.o
  683. OBJS += ../src/tls/tlsv1_cred.o
  684. OBJS += ../src/tls/tlsv1_server.o
  685. OBJS += ../src/tls/tlsv1_server_write.o
  686. OBJS += ../src/tls/tlsv1_server_read.o
  687. OBJS += ../src/tls/asn1.o
  688. OBJS += ../src/tls/rsa.o
  689. OBJS += ../src/tls/x509v3.o
  690. OBJS += ../src/tls/pkcs1.o
  691. OBJS += ../src/tls/pkcs5.o
  692. OBJS += ../src/tls/pkcs8.o
  693. NEED_SHA256=y
  694. NEED_BASE64=y
  695. NEED_TLS_PRF=y
  696. ifdef CONFIG_TLSV12
  697. NEED_TLS_PRF_SHA256=y
  698. endif
  699. NEED_MODEXP=y
  700. NEED_CIPHER=y
  701. CFLAGS += -DCONFIG_TLS_INTERNAL
  702. CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
  703. endif
  704. ifdef NEED_MODEXP
  705. OBJS += ../src/crypto/crypto_internal-modexp.o
  706. OBJS += ../src/tls/bignum.o
  707. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  708. CFLAGS += -DLTM_FAST
  709. endif
  710. CONFIG_INTERNAL_DH_GROUP5=y
  711. ifdef NEED_FIPS186_2_PRF
  712. OBJS += ../src/crypto/fips_prf_internal.o
  713. OBJS += ../src/crypto/sha1-internal.o
  714. endif
  715. endif
  716. ifeq ($(CONFIG_TLS), none)
  717. ifdef TLS_FUNCS
  718. OBJS += ../src/crypto/tls_none.o
  719. CFLAGS += -DEAP_TLS_NONE
  720. CONFIG_INTERNAL_AES=y
  721. CONFIG_INTERNAL_SHA1=y
  722. CONFIG_INTERNAL_MD5=y
  723. endif
  724. OBJS += ../src/crypto/crypto_none.o
  725. OBJS_p += ../src/crypto/crypto_none.o
  726. CONFIG_INTERNAL_SHA256=y
  727. CONFIG_INTERNAL_RC4=y
  728. endif
  729. ifndef TLS_FUNCS
  730. OBJS += ../src/crypto/tls_none.o
  731. ifeq ($(CONFIG_TLS), internal)
  732. CONFIG_INTERNAL_AES=y
  733. CONFIG_INTERNAL_SHA1=y
  734. CONFIG_INTERNAL_MD5=y
  735. CONFIG_INTERNAL_RC4=y
  736. endif
  737. endif
  738. AESOBJS = # none so far
  739. ifdef CONFIG_INTERNAL_AES
  740. AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-enc.o
  741. endif
  742. ifneq ($(CONFIG_TLS), openssl)
  743. AESOBJS += ../src/crypto/aes-wrap.o
  744. endif
  745. ifdef NEED_AES_EAX
  746. AESOBJS += ../src/crypto/aes-eax.o
  747. NEED_AES_CTR=y
  748. NEED_AES_OMAC1=y
  749. endif
  750. ifdef NEED_AES_SIV
  751. AESOBJS += ../src/crypto/aes-siv.o
  752. NEED_AES_CTR=y
  753. NEED_AES_OMAC1=y
  754. endif
  755. ifdef NEED_AES_CTR
  756. AESOBJS += ../src/crypto/aes-ctr.o
  757. endif
  758. ifdef NEED_AES_ENCBLOCK
  759. AESOBJS += ../src/crypto/aes-encblock.o
  760. endif
  761. ifdef NEED_AES_OMAC1
  762. ifneq ($(CONFIG_TLS), linux)
  763. AESOBJS += ../src/crypto/aes-omac1.o
  764. endif
  765. endif
  766. ifdef NEED_AES_UNWRAP
  767. ifneq ($(CONFIG_TLS), openssl)
  768. ifneq ($(CONFIG_TLS), linux)
  769. NEED_AES_DEC=y
  770. AESOBJS += ../src/crypto/aes-unwrap.o
  771. endif
  772. endif
  773. endif
  774. ifdef NEED_AES_CBC
  775. NEED_AES_DEC=y
  776. ifneq ($(CONFIG_TLS), openssl)
  777. ifneq ($(CONFIG_TLS), linux)
  778. AESOBJS += ../src/crypto/aes-cbc.o
  779. endif
  780. endif
  781. endif
  782. ifdef NEED_AES_DEC
  783. ifdef CONFIG_INTERNAL_AES
  784. AESOBJS += ../src/crypto/aes-internal-dec.o
  785. endif
  786. endif
  787. ifdef NEED_AES
  788. OBJS += $(AESOBJS)
  789. endif
  790. ifdef NEED_SHA1
  791. ifneq ($(CONFIG_TLS), openssl)
  792. ifneq ($(CONFIG_TLS), linux)
  793. SHA1OBJS += ../src/crypto/sha1.o
  794. endif
  795. endif
  796. SHA1OBJS += ../src/crypto/sha1-prf.o
  797. ifdef CONFIG_INTERNAL_SHA1
  798. SHA1OBJS += ../src/crypto/sha1-internal.o
  799. ifdef NEED_FIPS186_2_PRF
  800. SHA1OBJS += ../src/crypto/fips_prf_internal.o
  801. endif
  802. endif
  803. ifneq ($(CONFIG_TLS), openssl)
  804. SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
  805. endif
  806. ifdef NEED_T_PRF
  807. SHA1OBJS += ../src/crypto/sha1-tprf.o
  808. endif
  809. ifdef NEED_TLS_PRF
  810. SHA1OBJS += ../src/crypto/sha1-tlsprf.o
  811. endif
  812. endif
  813. ifdef NEED_SHA1
  814. OBJS += $(SHA1OBJS)
  815. endif
  816. ifneq ($(CONFIG_TLS), openssl)
  817. ifneq ($(CONFIG_TLS), linux)
  818. OBJS += ../src/crypto/md5.o
  819. endif
  820. endif
  821. ifdef NEED_MD5
  822. ifdef CONFIG_INTERNAL_MD5
  823. OBJS += ../src/crypto/md5-internal.o
  824. HOBJS += ../src/crypto/md5-internal.o
  825. endif
  826. endif
  827. ifdef NEED_MD4
  828. ifdef CONFIG_INTERNAL_MD4
  829. OBJS += ../src/crypto/md4-internal.o
  830. endif
  831. endif
  832. ifdef NEED_DES
  833. ifdef CONFIG_INTERNAL_DES
  834. OBJS += ../src/crypto/des-internal.o
  835. endif
  836. endif
  837. ifdef CONFIG_NO_RC4
  838. CFLAGS += -DCONFIG_NO_RC4
  839. endif
  840. ifdef NEED_RC4
  841. ifdef CONFIG_INTERNAL_RC4
  842. ifndef CONFIG_NO_RC4
  843. OBJS += ../src/crypto/rc4.o
  844. endif
  845. endif
  846. endif
  847. ifdef NEED_SHA256
  848. CFLAGS += -DCONFIG_SHA256
  849. ifneq ($(CONFIG_TLS), openssl)
  850. ifneq ($(CONFIG_TLS), linux)
  851. OBJS += ../src/crypto/sha256.o
  852. endif
  853. endif
  854. OBJS += ../src/crypto/sha256-prf.o
  855. ifdef CONFIG_INTERNAL_SHA256
  856. OBJS += ../src/crypto/sha256-internal.o
  857. endif
  858. ifdef NEED_TLS_PRF_SHA256
  859. OBJS += ../src/crypto/sha256-tlsprf.o
  860. endif
  861. ifdef NEED_HMAC_SHA256_KDF
  862. OBJS += ../src/crypto/sha256-kdf.o
  863. endif
  864. ifdef NEED_HMAC_SHA384_KDF
  865. OBJS += ../src/crypto/sha384-kdf.o
  866. endif
  867. ifdef NEED_HMAC_SHA512_KDF
  868. OBJS += ../src/crypto/sha512-kdf.o
  869. endif
  870. endif
  871. ifdef NEED_SHA384
  872. CFLAGS += -DCONFIG_SHA384
  873. ifneq ($(CONFIG_TLS), openssl)
  874. ifneq ($(CONFIG_TLS), linux)
  875. OBJS += ../src/crypto/sha384.o
  876. endif
  877. endif
  878. OBJS += ../src/crypto/sha384-prf.o
  879. endif
  880. ifdef NEED_SHA512
  881. CFLAGS += -DCONFIG_SHA512
  882. ifneq ($(CONFIG_TLS), openssl)
  883. ifneq ($(CONFIG_TLS), linux)
  884. OBJS += ../src/crypto/sha512.o
  885. endif
  886. endif
  887. OBJS += ../src/crypto/sha512-prf.o
  888. endif
  889. ifdef CONFIG_INTERNAL_SHA384
  890. CFLAGS += -DCONFIG_INTERNAL_SHA384
  891. OBJS += ../src/crypto/sha384-internal.o
  892. endif
  893. ifdef CONFIG_INTERNAL_SHA512
  894. CFLAGS += -DCONFIG_INTERNAL_SHA512
  895. OBJS += ../src/crypto/sha512-internal.o
  896. endif
  897. ifdef NEED_DH_GROUPS
  898. OBJS += ../src/crypto/dh_groups.o
  899. endif
  900. ifdef NEED_DH_GROUPS_ALL
  901. CFLAGS += -DALL_DH_GROUPS
  902. endif
  903. ifdef CONFIG_INTERNAL_DH_GROUP5
  904. ifdef NEED_DH_GROUPS
  905. OBJS += ../src/crypto/dh_group5.o
  906. endif
  907. endif
  908. ifdef NEED_ECC
  909. CFLAGS += -DCONFIG_ECC
  910. endif
  911. ifdef CONFIG_NO_RANDOM_POOL
  912. CFLAGS += -DCONFIG_NO_RANDOM_POOL
  913. else
  914. OBJS += ../src/crypto/random.o
  915. HOBJS += ../src/crypto/random.o
  916. HOBJS += ../src/utils/eloop.o
  917. HOBJS += $(SHA1OBJS)
  918. ifneq ($(CONFIG_TLS), openssl)
  919. ifneq ($(CONFIG_TLS), linux)
  920. HOBJS += ../src/crypto/md5.o
  921. endif
  922. endif
  923. endif
  924. ifdef CONFIG_RADIUS_SERVER
  925. CFLAGS += -DRADIUS_SERVER
  926. OBJS += ../src/radius/radius_server.o
  927. endif
  928. ifdef CONFIG_IPV6
  929. CFLAGS += -DCONFIG_IPV6
  930. endif
  931. ifdef CONFIG_DRIVER_RADIUS_ACL
  932. CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
  933. endif
  934. ifdef NEED_BASE64
  935. OBJS += ../src/utils/base64.o
  936. endif
  937. ifdef NEED_JSON
  938. OBJS += ../src/utils/json.o
  939. CFLAGS += -DCONFIG_JSON
  940. endif
  941. ifdef NEED_AP_MLME
  942. OBJS += ../src/ap/wmm.o
  943. OBJS += ../src/ap/ap_list.o
  944. OBJS += ../src/ap/ieee802_11.o
  945. OBJS += ../src/ap/hw_features.o
  946. OBJS += ../src/ap/dfs.o
  947. CFLAGS += -DNEED_AP_MLME
  948. endif
  949. ifdef CONFIG_IEEE80211N
  950. OBJS += ../src/ap/ieee802_11_ht.o
  951. endif
  952. ifdef CONFIG_IEEE80211AC
  953. OBJS += ../src/ap/ieee802_11_vht.o
  954. endif
  955. ifdef CONFIG_P2P_MANAGER
  956. CFLAGS += -DCONFIG_P2P_MANAGER
  957. OBJS += ../src/ap/p2p_hostapd.o
  958. endif
  959. ifdef CONFIG_HS20
  960. CFLAGS += -DCONFIG_HS20
  961. OBJS += ../src/ap/hs20.o
  962. CONFIG_INTERWORKING=y
  963. endif
  964. ifdef CONFIG_INTERWORKING
  965. CFLAGS += -DCONFIG_INTERWORKING
  966. NEED_GAS=y
  967. endif
  968. ifdef NEED_GAS
  969. OBJS += ../src/common/gas.o
  970. OBJS += ../src/ap/gas_serv.o
  971. endif
  972. ifdef CONFIG_PROXYARP
  973. CFLAGS += -DCONFIG_PROXYARP
  974. OBJS += ../src/ap/x_snoop.o
  975. OBJS += ../src/ap/dhcp_snoop.o
  976. ifdef CONFIG_IPV6
  977. OBJS += ../src/ap/ndisc_snoop.o
  978. endif
  979. endif
  980. OBJS += ../src/drivers/driver_common.o
  981. ifdef CONFIG_WPA_CLI_EDIT
  982. OBJS_c += ../src/utils/edit.o
  983. else
  984. OBJS_c += ../src/utils/edit_simple.o
  985. endif
  986. ifdef CONFIG_ACS
  987. CFLAGS += -DCONFIG_ACS
  988. OBJS += ../src/ap/acs.o
  989. LIBS += -lm
  990. endif
  991. ifdef CONFIG_NO_STDOUT_DEBUG
  992. CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  993. endif
  994. ifdef CONFIG_DEBUG_SYSLOG
  995. CFLAGS += -DCONFIG_DEBUG_SYSLOG
  996. endif
  997. ifdef CONFIG_DEBUG_LINUX_TRACING
  998. CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
  999. endif
  1000. ifdef CONFIG_DEBUG_FILE
  1001. CFLAGS += -DCONFIG_DEBUG_FILE
  1002. endif
  1003. ifdef CONFIG_SQLITE
  1004. CFLAGS += -DCONFIG_SQLITE
  1005. LIBS += -lsqlite3
  1006. LIBS_h += -lsqlite3
  1007. endif
  1008. ifdef CONFIG_FST
  1009. CFLAGS += -DCONFIG_FST
  1010. OBJS += ../src/fst/fst.o
  1011. OBJS += ../src/fst/fst_group.o
  1012. OBJS += ../src/fst/fst_iface.o
  1013. OBJS += ../src/fst/fst_session.o
  1014. OBJS += ../src/fst/fst_ctrl_aux.o
  1015. ifdef CONFIG_FST_TEST
  1016. CFLAGS += -DCONFIG_FST_TEST
  1017. endif
  1018. ifndef CONFIG_NO_CTRL_IFACE
  1019. OBJS += ../src/fst/fst_ctrl_iface.o
  1020. endif
  1021. endif
  1022. ALL=hostapd hostapd_cli
  1023. all: verify_config $(ALL)
  1024. Q=@
  1025. E=echo
  1026. ifeq ($(V), 1)
  1027. Q=
  1028. E=true
  1029. endif
  1030. ifeq ($(QUIET), 1)
  1031. Q=@
  1032. E=true
  1033. endif
  1034. ifdef CONFIG_CODE_COVERAGE
  1035. %.o: %.c
  1036. @$(E) " CC " $<
  1037. $(Q)cd $(dir $@); $(CC) -c -o $(notdir $@) $(CFLAGS) $(notdir $<)
  1038. else
  1039. %.o: %.c
  1040. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  1041. @$(E) " CC " $<
  1042. endif
  1043. verify_config:
  1044. @if [ ! -r .config ]; then \
  1045. echo 'Building hostapd requires a configuration file'; \
  1046. echo '(.config). See README for more instructions. You can'; \
  1047. echo 'run "cp defconfig .config" to create an example'; \
  1048. echo 'configuration.'; \
  1049. exit 1; \
  1050. fi
  1051. $(DESTDIR)$(BINDIR)/%: %
  1052. install -D $(<) $(@)
  1053. install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL))
  1054. ../src/drivers/build.hostapd:
  1055. @if [ -f ../src/drivers/build.wpa_supplicant ]; then \
  1056. $(MAKE) -C ../src/drivers clean; \
  1057. fi
  1058. @touch ../src/drivers/build.hostapd
  1059. BCHECK=../src/drivers/build.hostapd
  1060. hostapd: $(BCHECK) $(OBJS)
  1061. $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
  1062. @$(E) " LD " $@
  1063. ifdef CONFIG_WPA_TRACE
  1064. OBJS_c += ../src/utils/trace.o
  1065. endif
  1066. hostapd_cli: $(OBJS_c)
  1067. $(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c)
  1068. @$(E) " LD " $@
  1069. NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS)
  1070. NOBJS += ../src/utils/common.o
  1071. ifdef NEED_RC4
  1072. ifdef CONFIG_INTERNAL_RC4
  1073. ifndef CONFIG_NO_RC4
  1074. NOBJS += ../src/crypto/rc4.o
  1075. endif
  1076. endif
  1077. endif
  1078. ifdef CONFIG_INTERNAL_MD5
  1079. NOBJS += ../src/crypto/md5-internal.o
  1080. endif
  1081. NOBJS += ../src/crypto/crypto_openssl.o ../src/utils/os_$(CONFIG_OS).o
  1082. NOBJS += ../src/utils/wpa_debug.o
  1083. NOBJS += ../src/utils/wpabuf.o
  1084. ifdef CONFIG_WPA_TRACE
  1085. NOBJS += ../src/utils/trace.o
  1086. LIBS_n += -lbfd
  1087. endif
  1088. ifdef TLS_FUNCS
  1089. LIBS_n += -lcrypto
  1090. endif
  1091. HOBJS += hlr_auc_gw.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).o ../src/utils/wpabuf.o ../src/crypto/milenage.o
  1092. HOBJS += ../src/crypto/aes-encblock.o
  1093. ifdef CONFIG_INTERNAL_AES
  1094. HOBJS += ../src/crypto/aes-internal.o
  1095. HOBJS += ../src/crypto/aes-internal-enc.o
  1096. endif
  1097. ifeq ($(CONFIG_TLS), linux)
  1098. HOBJS += ../src/crypto/crypto_linux.o
  1099. endif
  1100. nt_password_hash: $(NOBJS)
  1101. $(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
  1102. @$(E) " LD " $@
  1103. hlr_auc_gw: $(HOBJS)
  1104. $(Q)$(CC) $(LDFLAGS) -o hlr_auc_gw $(HOBJS) $(LIBS_h)
  1105. @$(E) " LD " $@
  1106. lcov-html:
  1107. lcov -c -d .. > lcov.info
  1108. genhtml lcov.info --output-directory lcov-html
  1109. clean:
  1110. $(MAKE) -C ../src clean
  1111. rm -f core *~ *.o hostapd hostapd_cli nt_password_hash hlr_auc_gw
  1112. rm -f *.d *.gcno *.gcda *.gcov
  1113. rm -f lcov.info
  1114. rm -rf lcov-html
  1115. -include $(OBJS:%.o=%.d)