Makefile 25 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213
  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. endif
  256. ifdef CONFIG_SAE
  257. CFLAGS += -DCONFIG_SAE
  258. OBJS += ../src/common/sae.o
  259. NEED_ECC=y
  260. NEED_DH_GROUPS=y
  261. NEED_AP_MLME=y
  262. endif
  263. ifdef CONFIG_OWE
  264. CFLAGS += -DCONFIG_OWE
  265. NEED_ECC=y
  266. NEED_HMAC_SHA256_KDF=y
  267. endif
  268. ifdef CONFIG_FILS
  269. CFLAGS += -DCONFIG_FILS
  270. OBJS += ../src/ap/fils_hlp.o
  271. NEED_SHA384=y
  272. NEED_AES_SIV=y
  273. endif
  274. ifdef CONFIG_WNM
  275. CFLAGS += -DCONFIG_WNM
  276. OBJS += ../src/ap/wnm_ap.o
  277. endif
  278. ifdef CONFIG_IEEE80211N
  279. CFLAGS += -DCONFIG_IEEE80211N
  280. endif
  281. ifdef CONFIG_IEEE80211AC
  282. CFLAGS += -DCONFIG_IEEE80211AC
  283. endif
  284. ifdef CONFIG_IEEE80211AX
  285. CFLAGS += -DCONFIG_IEEE80211AX
  286. OBJS += ../src/ap/ieee802_11_he.o
  287. endif
  288. ifdef CONFIG_MBO
  289. CFLAGS += -DCONFIG_MBO
  290. OBJS += ../src/ap/mbo_ap.o
  291. endif
  292. include ../src/drivers/drivers.mak
  293. OBJS += $(DRV_AP_OBJS)
  294. CFLAGS += $(DRV_AP_CFLAGS)
  295. LDFLAGS += $(DRV_AP_LDFLAGS)
  296. LIBS += $(DRV_AP_LIBS)
  297. ifdef CONFIG_L2_PACKET
  298. ifdef CONFIG_DNET_PCAP
  299. ifdef CONFIG_L2_FREEBSD
  300. LIBS += -lpcap
  301. OBJS += ../src/l2_packet/l2_packet_freebsd.o
  302. else
  303. LIBS += -ldnet -lpcap
  304. OBJS += ../src/l2_packet/l2_packet_pcap.o
  305. endif
  306. else
  307. OBJS += ../src/l2_packet/l2_packet_linux.o
  308. endif
  309. else
  310. OBJS += ../src/l2_packet/l2_packet_none.o
  311. endif
  312. ifdef CONFIG_ERP
  313. CFLAGS += -DCONFIG_ERP
  314. NEED_SHA256=y
  315. NEED_HMAC_SHA256_KDF=y
  316. endif
  317. ifdef CONFIG_EAP_MD5
  318. CFLAGS += -DEAP_SERVER_MD5
  319. OBJS += ../src/eap_server/eap_server_md5.o
  320. CHAP=y
  321. endif
  322. ifdef CONFIG_EAP_TLS
  323. CFLAGS += -DEAP_SERVER_TLS
  324. OBJS += ../src/eap_server/eap_server_tls.o
  325. TLS_FUNCS=y
  326. endif
  327. ifdef CONFIG_EAP_UNAUTH_TLS
  328. CFLAGS += -DEAP_SERVER_UNAUTH_TLS
  329. ifndef CONFIG_EAP_TLS
  330. OBJS += ../src/eap_server/eap_server_tls.o
  331. TLS_FUNCS=y
  332. endif
  333. endif
  334. ifdef CONFIG_EAP_PEAP
  335. CFLAGS += -DEAP_SERVER_PEAP
  336. OBJS += ../src/eap_server/eap_server_peap.o
  337. OBJS += ../src/eap_common/eap_peap_common.o
  338. TLS_FUNCS=y
  339. CONFIG_EAP_MSCHAPV2=y
  340. endif
  341. ifdef CONFIG_EAP_TTLS
  342. CFLAGS += -DEAP_SERVER_TTLS
  343. OBJS += ../src/eap_server/eap_server_ttls.o
  344. TLS_FUNCS=y
  345. CHAP=y
  346. endif
  347. ifdef CONFIG_EAP_MSCHAPV2
  348. CFLAGS += -DEAP_SERVER_MSCHAPV2
  349. OBJS += ../src/eap_server/eap_server_mschapv2.o
  350. MS_FUNCS=y
  351. endif
  352. ifdef CONFIG_EAP_GTC
  353. CFLAGS += -DEAP_SERVER_GTC
  354. OBJS += ../src/eap_server/eap_server_gtc.o
  355. endif
  356. ifdef CONFIG_EAP_SIM
  357. CFLAGS += -DEAP_SERVER_SIM
  358. OBJS += ../src/eap_server/eap_server_sim.o
  359. CONFIG_EAP_SIM_COMMON=y
  360. NEED_AES_CBC=y
  361. endif
  362. ifdef CONFIG_EAP_AKA
  363. CFLAGS += -DEAP_SERVER_AKA
  364. OBJS += ../src/eap_server/eap_server_aka.o
  365. CONFIG_EAP_SIM_COMMON=y
  366. NEED_SHA256=y
  367. NEED_AES_CBC=y
  368. endif
  369. ifdef CONFIG_EAP_AKA_PRIME
  370. CFLAGS += -DEAP_SERVER_AKA_PRIME
  371. endif
  372. ifdef CONFIG_EAP_SIM_COMMON
  373. OBJS += ../src/eap_common/eap_sim_common.o
  374. # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
  375. # replaced with another file implementating the interface specified in
  376. # eap_sim_db.h.
  377. OBJS += ../src/eap_server/eap_sim_db.o
  378. NEED_FIPS186_2_PRF=y
  379. endif
  380. ifdef CONFIG_EAP_PAX
  381. CFLAGS += -DEAP_SERVER_PAX
  382. OBJS += ../src/eap_server/eap_server_pax.o ../src/eap_common/eap_pax_common.o
  383. endif
  384. ifdef CONFIG_EAP_PSK
  385. CFLAGS += -DEAP_SERVER_PSK
  386. OBJS += ../src/eap_server/eap_server_psk.o ../src/eap_common/eap_psk_common.o
  387. NEED_AES_OMAC1=y
  388. NEED_AES_ENCBLOCK=y
  389. NEED_AES_EAX=y
  390. endif
  391. ifdef CONFIG_EAP_SAKE
  392. CFLAGS += -DEAP_SERVER_SAKE
  393. OBJS += ../src/eap_server/eap_server_sake.o ../src/eap_common/eap_sake_common.o
  394. endif
  395. ifdef CONFIG_EAP_GPSK
  396. CFLAGS += -DEAP_SERVER_GPSK
  397. OBJS += ../src/eap_server/eap_server_gpsk.o ../src/eap_common/eap_gpsk_common.o
  398. ifdef CONFIG_EAP_GPSK_SHA256
  399. CFLAGS += -DEAP_GPSK_SHA256
  400. endif
  401. NEED_SHA256=y
  402. NEED_AES_OMAC1=y
  403. endif
  404. ifdef CONFIG_EAP_PWD
  405. CFLAGS += -DEAP_SERVER_PWD
  406. OBJS += ../src/eap_server/eap_server_pwd.o ../src/eap_common/eap_pwd_common.o
  407. NEED_SHA256=y
  408. endif
  409. ifdef CONFIG_EAP_EKE
  410. CFLAGS += -DEAP_SERVER_EKE
  411. OBJS += ../src/eap_server/eap_server_eke.o ../src/eap_common/eap_eke_common.o
  412. NEED_DH_GROUPS=y
  413. NEED_DH_GROUPS_ALL=y
  414. endif
  415. ifdef CONFIG_EAP_VENDOR_TEST
  416. CFLAGS += -DEAP_SERVER_VENDOR_TEST
  417. OBJS += ../src/eap_server/eap_server_vendor_test.o
  418. endif
  419. ifdef CONFIG_EAP_FAST
  420. CFLAGS += -DEAP_SERVER_FAST
  421. OBJS += ../src/eap_server/eap_server_fast.o
  422. OBJS += ../src/eap_common/eap_fast_common.o
  423. TLS_FUNCS=y
  424. NEED_T_PRF=y
  425. NEED_AES_UNWRAP=y
  426. endif
  427. ifdef CONFIG_WPS
  428. CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
  429. OBJS += ../src/utils/uuid.o
  430. OBJS += ../src/ap/wps_hostapd.o
  431. OBJS += ../src/eap_server/eap_server_wsc.o ../src/eap_common/eap_wsc_common.o
  432. OBJS += ../src/wps/wps.o
  433. OBJS += ../src/wps/wps_common.o
  434. OBJS += ../src/wps/wps_attr_parse.o
  435. OBJS += ../src/wps/wps_attr_build.o
  436. OBJS += ../src/wps/wps_attr_process.o
  437. OBJS += ../src/wps/wps_dev_attr.o
  438. OBJS += ../src/wps/wps_enrollee.o
  439. OBJS += ../src/wps/wps_registrar.o
  440. NEED_DH_GROUPS=y
  441. NEED_SHA256=y
  442. NEED_BASE64=y
  443. NEED_AES_CBC=y
  444. NEED_MODEXP=y
  445. CONFIG_EAP=y
  446. ifdef CONFIG_WPS_NFC
  447. CFLAGS += -DCONFIG_WPS_NFC
  448. OBJS += ../src/wps/ndef.o
  449. NEED_WPS_OOB=y
  450. endif
  451. ifdef NEED_WPS_OOB
  452. CFLAGS += -DCONFIG_WPS_OOB
  453. endif
  454. ifdef CONFIG_WPS_UPNP
  455. CFLAGS += -DCONFIG_WPS_UPNP
  456. OBJS += ../src/wps/wps_upnp.o
  457. OBJS += ../src/wps/wps_upnp_ssdp.o
  458. OBJS += ../src/wps/wps_upnp_web.o
  459. OBJS += ../src/wps/wps_upnp_event.o
  460. OBJS += ../src/wps/wps_upnp_ap.o
  461. OBJS += ../src/wps/upnp_xml.o
  462. OBJS += ../src/wps/httpread.o
  463. OBJS += ../src/wps/http_client.o
  464. OBJS += ../src/wps/http_server.o
  465. endif
  466. ifdef CONFIG_WPS_STRICT
  467. CFLAGS += -DCONFIG_WPS_STRICT
  468. OBJS += ../src/wps/wps_validate.o
  469. endif
  470. ifdef CONFIG_WPS_TESTING
  471. CFLAGS += -DCONFIG_WPS_TESTING
  472. endif
  473. endif
  474. ifdef CONFIG_EAP_IKEV2
  475. CFLAGS += -DEAP_SERVER_IKEV2
  476. OBJS += ../src/eap_server/eap_server_ikev2.o ../src/eap_server/ikev2.o
  477. OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  478. NEED_DH_GROUPS=y
  479. NEED_DH_GROUPS_ALL=y
  480. NEED_MODEXP=y
  481. NEED_CIPHER=y
  482. endif
  483. ifdef CONFIG_EAP_TNC
  484. CFLAGS += -DEAP_SERVER_TNC
  485. OBJS += ../src/eap_server/eap_server_tnc.o
  486. OBJS += ../src/eap_server/tncs.o
  487. NEED_BASE64=y
  488. ifndef CONFIG_DRIVER_BSD
  489. LIBS += -ldl
  490. endif
  491. endif
  492. # Basic EAP functionality is needed for EAPOL
  493. OBJS += eap_register.o
  494. OBJS += ../src/eap_server/eap_server.o
  495. OBJS += ../src/eap_common/eap_common.o
  496. OBJS += ../src/eap_server/eap_server_methods.o
  497. OBJS += ../src/eap_server/eap_server_identity.o
  498. CFLAGS += -DEAP_SERVER_IDENTITY
  499. ifdef CONFIG_EAP
  500. CFLAGS += -DEAP_SERVER
  501. endif
  502. ifdef CONFIG_PKCS12
  503. CFLAGS += -DPKCS12_FUNCS
  504. endif
  505. ifdef MS_FUNCS
  506. OBJS += ../src/crypto/ms_funcs.o
  507. NEED_DES=y
  508. NEED_MD4=y
  509. endif
  510. ifdef CHAP
  511. OBJS += ../src/eap_common/chap.o
  512. endif
  513. ifdef TLS_FUNCS
  514. NEED_DES=y
  515. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
  516. CFLAGS += -DEAP_TLS_FUNCS
  517. OBJS += ../src/eap_server/eap_server_tls_common.o
  518. NEED_TLS_PRF=y
  519. endif
  520. ifndef CONFIG_TLS
  521. CONFIG_TLS=openssl
  522. endif
  523. ifdef CONFIG_TLSV11
  524. CFLAGS += -DCONFIG_TLSV11
  525. endif
  526. ifdef CONFIG_TLSV12
  527. CFLAGS += -DCONFIG_TLSV12
  528. NEED_SHA256=y
  529. endif
  530. ifeq ($(CONFIG_TLS), openssl)
  531. ifdef TLS_FUNCS
  532. OBJS += ../src/crypto/tls_openssl.o
  533. OBJS += ../src/crypto/tls_openssl_ocsp.o
  534. LIBS += -lssl
  535. endif
  536. OBJS += ../src/crypto/crypto_openssl.o
  537. HOBJS += ../src/crypto/crypto_openssl.o
  538. ifdef NEED_FIPS186_2_PRF
  539. OBJS += ../src/crypto/fips_prf_openssl.o
  540. endif
  541. NEED_SHA256=y
  542. NEED_TLS_PRF_SHA256=y
  543. LIBS += -lcrypto
  544. LIBS_h += -lcrypto
  545. ifdef CONFIG_TLS_ADD_DL
  546. LIBS += -ldl
  547. LIBS_h += -ldl
  548. endif
  549. endif
  550. ifeq ($(CONFIG_TLS), gnutls)
  551. ifdef TLS_FUNCS
  552. OBJS += ../src/crypto/tls_gnutls.o
  553. LIBS += -lgnutls -lgpg-error
  554. endif
  555. OBJS += ../src/crypto/crypto_gnutls.o
  556. HOBJS += ../src/crypto/crypto_gnutls.o
  557. ifdef NEED_FIPS186_2_PRF
  558. OBJS += ../src/crypto/fips_prf_internal.o
  559. SHA1OBJS += ../src/crypto/sha1-internal.o
  560. endif
  561. LIBS += -lgcrypt
  562. LIBS_h += -lgcrypt
  563. CONFIG_INTERNAL_SHA256=y
  564. CONFIG_INTERNAL_RC4=y
  565. CONFIG_INTERNAL_DH_GROUP5=y
  566. endif
  567. ifeq ($(CONFIG_TLS), internal)
  568. ifndef CONFIG_CRYPTO
  569. CONFIG_CRYPTO=internal
  570. endif
  571. ifdef TLS_FUNCS
  572. OBJS += ../src/crypto/crypto_internal-rsa.o
  573. OBJS += ../src/crypto/tls_internal.o
  574. OBJS += ../src/tls/tlsv1_common.o
  575. OBJS += ../src/tls/tlsv1_record.o
  576. OBJS += ../src/tls/tlsv1_cred.o
  577. OBJS += ../src/tls/tlsv1_server.o
  578. OBJS += ../src/tls/tlsv1_server_write.o
  579. OBJS += ../src/tls/tlsv1_server_read.o
  580. OBJS += ../src/tls/asn1.o
  581. OBJS += ../src/tls/rsa.o
  582. OBJS += ../src/tls/x509v3.o
  583. OBJS += ../src/tls/pkcs1.o
  584. OBJS += ../src/tls/pkcs5.o
  585. OBJS += ../src/tls/pkcs8.o
  586. NEED_SHA256=y
  587. NEED_BASE64=y
  588. NEED_TLS_PRF=y
  589. ifdef CONFIG_TLSV12
  590. NEED_TLS_PRF_SHA256=y
  591. endif
  592. NEED_MODEXP=y
  593. NEED_CIPHER=y
  594. CFLAGS += -DCONFIG_TLS_INTERNAL
  595. CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
  596. endif
  597. ifdef NEED_CIPHER
  598. NEED_DES=y
  599. OBJS += ../src/crypto/crypto_internal-cipher.o
  600. endif
  601. ifdef NEED_MODEXP
  602. OBJS += ../src/crypto/crypto_internal-modexp.o
  603. OBJS += ../src/tls/bignum.o
  604. endif
  605. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  606. OBJS += ../src/crypto/crypto_libtomcrypt.o
  607. LIBS += -ltomcrypt -ltfm
  608. LIBS_h += -ltomcrypt -ltfm
  609. CONFIG_INTERNAL_SHA256=y
  610. CONFIG_INTERNAL_RC4=y
  611. CONFIG_INTERNAL_DH_GROUP5=y
  612. endif
  613. ifeq ($(CONFIG_CRYPTO), internal)
  614. OBJS += ../src/crypto/crypto_internal.o
  615. NEED_AES_DEC=y
  616. CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  617. ifdef CONFIG_INTERNAL_LIBTOMMATH
  618. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  619. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  620. CFLAGS += -DLTM_FAST
  621. endif
  622. else
  623. LIBS += -ltommath
  624. LIBS_h += -ltommath
  625. endif
  626. CONFIG_INTERNAL_AES=y
  627. CONFIG_INTERNAL_DES=y
  628. CONFIG_INTERNAL_SHA1=y
  629. CONFIG_INTERNAL_MD4=y
  630. CONFIG_INTERNAL_MD5=y
  631. CONFIG_INTERNAL_SHA256=y
  632. CONFIG_INTERNAL_SHA384=y
  633. CONFIG_INTERNAL_SHA512=y
  634. CONFIG_INTERNAL_RC4=y
  635. CONFIG_INTERNAL_DH_GROUP5=y
  636. endif
  637. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  638. OBJS += ../src/crypto/crypto_cryptoapi.o
  639. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  640. CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  641. CONFIG_INTERNAL_SHA256=y
  642. CONFIG_INTERNAL_RC4=y
  643. endif
  644. endif
  645. ifeq ($(CONFIG_TLS), linux)
  646. OBJS += ../src/crypto/crypto_linux.o
  647. ifdef TLS_FUNCS
  648. OBJS += ../src/crypto/crypto_internal-rsa.o
  649. OBJS += ../src/crypto/tls_internal.o
  650. OBJS += ../src/tls/tlsv1_common.o
  651. OBJS += ../src/tls/tlsv1_record.o
  652. OBJS += ../src/tls/tlsv1_cred.o
  653. OBJS += ../src/tls/tlsv1_server.o
  654. OBJS += ../src/tls/tlsv1_server_write.o
  655. OBJS += ../src/tls/tlsv1_server_read.o
  656. OBJS += ../src/tls/asn1.o
  657. OBJS += ../src/tls/rsa.o
  658. OBJS += ../src/tls/x509v3.o
  659. OBJS += ../src/tls/pkcs1.o
  660. OBJS += ../src/tls/pkcs5.o
  661. OBJS += ../src/tls/pkcs8.o
  662. NEED_SHA256=y
  663. NEED_BASE64=y
  664. NEED_TLS_PRF=y
  665. ifdef CONFIG_TLSV12
  666. NEED_TLS_PRF_SHA256=y
  667. endif
  668. NEED_MODEXP=y
  669. NEED_CIPHER=y
  670. CFLAGS += -DCONFIG_TLS_INTERNAL
  671. CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
  672. endif
  673. ifdef NEED_MODEXP
  674. OBJS += ../src/crypto/crypto_internal-modexp.o
  675. OBJS += ../src/tls/bignum.o
  676. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  677. CFLAGS += -DLTM_FAST
  678. endif
  679. CONFIG_INTERNAL_DH_GROUP5=y
  680. ifdef NEED_FIPS186_2_PRF
  681. OBJS += ../src/crypto/fips_prf_internal.o
  682. OBJS += ../src/crypto/sha1-internal.o
  683. endif
  684. endif
  685. ifeq ($(CONFIG_TLS), none)
  686. ifdef TLS_FUNCS
  687. OBJS += ../src/crypto/tls_none.o
  688. CFLAGS += -DEAP_TLS_NONE
  689. CONFIG_INTERNAL_AES=y
  690. CONFIG_INTERNAL_SHA1=y
  691. CONFIG_INTERNAL_MD5=y
  692. endif
  693. OBJS += ../src/crypto/crypto_none.o
  694. OBJS_p += ../src/crypto/crypto_none.o
  695. CONFIG_INTERNAL_SHA256=y
  696. CONFIG_INTERNAL_RC4=y
  697. endif
  698. ifndef TLS_FUNCS
  699. OBJS += ../src/crypto/tls_none.o
  700. ifeq ($(CONFIG_TLS), internal)
  701. CONFIG_INTERNAL_AES=y
  702. CONFIG_INTERNAL_SHA1=y
  703. CONFIG_INTERNAL_MD5=y
  704. CONFIG_INTERNAL_RC4=y
  705. endif
  706. endif
  707. AESOBJS = # none so far
  708. ifdef CONFIG_INTERNAL_AES
  709. AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-enc.o
  710. endif
  711. ifneq ($(CONFIG_TLS), openssl)
  712. AESOBJS += ../src/crypto/aes-wrap.o
  713. endif
  714. ifdef NEED_AES_EAX
  715. AESOBJS += ../src/crypto/aes-eax.o
  716. NEED_AES_CTR=y
  717. NEED_AES_OMAC1=y
  718. endif
  719. ifdef NEED_AES_SIV
  720. AESOBJS += ../src/crypto/aes-siv.o
  721. NEED_AES_CTR=y
  722. NEED_AES_OMAC1=y
  723. endif
  724. ifdef NEED_AES_CTR
  725. AESOBJS += ../src/crypto/aes-ctr.o
  726. endif
  727. ifdef NEED_AES_ENCBLOCK
  728. AESOBJS += ../src/crypto/aes-encblock.o
  729. endif
  730. ifdef NEED_AES_OMAC1
  731. ifneq ($(CONFIG_TLS), linux)
  732. AESOBJS += ../src/crypto/aes-omac1.o
  733. endif
  734. endif
  735. ifdef NEED_AES_UNWRAP
  736. ifneq ($(CONFIG_TLS), openssl)
  737. ifneq ($(CONFIG_TLS), linux)
  738. NEED_AES_DEC=y
  739. AESOBJS += ../src/crypto/aes-unwrap.o
  740. endif
  741. endif
  742. endif
  743. ifdef NEED_AES_CBC
  744. NEED_AES_DEC=y
  745. ifneq ($(CONFIG_TLS), openssl)
  746. ifneq ($(CONFIG_TLS), linux)
  747. AESOBJS += ../src/crypto/aes-cbc.o
  748. endif
  749. endif
  750. endif
  751. ifdef NEED_AES_DEC
  752. ifdef CONFIG_INTERNAL_AES
  753. AESOBJS += ../src/crypto/aes-internal-dec.o
  754. endif
  755. endif
  756. ifdef NEED_AES
  757. OBJS += $(AESOBJS)
  758. endif
  759. ifdef NEED_SHA1
  760. ifneq ($(CONFIG_TLS), openssl)
  761. ifneq ($(CONFIG_TLS), linux)
  762. SHA1OBJS += ../src/crypto/sha1.o
  763. endif
  764. endif
  765. SHA1OBJS += ../src/crypto/sha1-prf.o
  766. ifdef CONFIG_INTERNAL_SHA1
  767. SHA1OBJS += ../src/crypto/sha1-internal.o
  768. ifdef NEED_FIPS186_2_PRF
  769. SHA1OBJS += ../src/crypto/fips_prf_internal.o
  770. endif
  771. endif
  772. ifneq ($(CONFIG_TLS), openssl)
  773. SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
  774. endif
  775. ifdef NEED_T_PRF
  776. SHA1OBJS += ../src/crypto/sha1-tprf.o
  777. endif
  778. ifdef NEED_TLS_PRF
  779. SHA1OBJS += ../src/crypto/sha1-tlsprf.o
  780. endif
  781. endif
  782. ifdef NEED_SHA1
  783. OBJS += $(SHA1OBJS)
  784. endif
  785. ifneq ($(CONFIG_TLS), openssl)
  786. ifneq ($(CONFIG_TLS), linux)
  787. OBJS += ../src/crypto/md5.o
  788. endif
  789. endif
  790. ifdef NEED_MD5
  791. ifdef CONFIG_INTERNAL_MD5
  792. OBJS += ../src/crypto/md5-internal.o
  793. HOBJS += ../src/crypto/md5-internal.o
  794. endif
  795. endif
  796. ifdef NEED_MD4
  797. ifdef CONFIG_INTERNAL_MD4
  798. OBJS += ../src/crypto/md4-internal.o
  799. endif
  800. endif
  801. ifdef NEED_DES
  802. ifdef CONFIG_INTERNAL_DES
  803. OBJS += ../src/crypto/des-internal.o
  804. endif
  805. endif
  806. ifdef CONFIG_NO_RC4
  807. CFLAGS += -DCONFIG_NO_RC4
  808. endif
  809. ifdef NEED_RC4
  810. ifdef CONFIG_INTERNAL_RC4
  811. ifndef CONFIG_NO_RC4
  812. OBJS += ../src/crypto/rc4.o
  813. endif
  814. endif
  815. endif
  816. ifdef NEED_SHA256
  817. CFLAGS += -DCONFIG_SHA256
  818. ifneq ($(CONFIG_TLS), openssl)
  819. ifneq ($(CONFIG_TLS), linux)
  820. OBJS += ../src/crypto/sha256.o
  821. endif
  822. endif
  823. OBJS += ../src/crypto/sha256-prf.o
  824. ifdef CONFIG_INTERNAL_SHA256
  825. OBJS += ../src/crypto/sha256-internal.o
  826. endif
  827. ifdef NEED_TLS_PRF_SHA256
  828. OBJS += ../src/crypto/sha256-tlsprf.o
  829. endif
  830. ifdef NEED_HMAC_SHA256_KDF
  831. OBJS += ../src/crypto/sha256-kdf.o
  832. endif
  833. endif
  834. ifdef NEED_SHA384
  835. CFLAGS += -DCONFIG_SHA384
  836. ifneq ($(CONFIG_TLS), openssl)
  837. ifneq ($(CONFIG_TLS), linux)
  838. OBJS += ../src/crypto/sha384.o
  839. endif
  840. endif
  841. OBJS += ../src/crypto/sha384-prf.o
  842. endif
  843. ifdef CONFIG_INTERNAL_SHA384
  844. CFLAGS += -DCONFIG_INTERNAL_SHA384
  845. OBJS += ../src/crypto/sha384-internal.o
  846. endif
  847. ifdef CONFIG_INTERNAL_SHA512
  848. CFLAGS += -DCONFIG_INTERNAL_SHA512
  849. OBJS += ../src/crypto/sha512-internal.o
  850. endif
  851. ifdef NEED_DH_GROUPS
  852. OBJS += ../src/crypto/dh_groups.o
  853. endif
  854. ifdef NEED_DH_GROUPS_ALL
  855. CFLAGS += -DALL_DH_GROUPS
  856. endif
  857. ifdef CONFIG_INTERNAL_DH_GROUP5
  858. ifdef NEED_DH_GROUPS
  859. OBJS += ../src/crypto/dh_group5.o
  860. endif
  861. endif
  862. ifdef NEED_ECC
  863. CFLAGS += -DCONFIG_ECC
  864. endif
  865. ifdef CONFIG_NO_RANDOM_POOL
  866. CFLAGS += -DCONFIG_NO_RANDOM_POOL
  867. else
  868. OBJS += ../src/crypto/random.o
  869. HOBJS += ../src/crypto/random.o
  870. HOBJS += ../src/utils/eloop.o
  871. HOBJS += $(SHA1OBJS)
  872. ifneq ($(CONFIG_TLS), openssl)
  873. ifneq ($(CONFIG_TLS), linux)
  874. HOBJS += ../src/crypto/md5.o
  875. endif
  876. endif
  877. endif
  878. ifdef CONFIG_RADIUS_SERVER
  879. CFLAGS += -DRADIUS_SERVER
  880. OBJS += ../src/radius/radius_server.o
  881. endif
  882. ifdef CONFIG_IPV6
  883. CFLAGS += -DCONFIG_IPV6
  884. endif
  885. ifdef CONFIG_DRIVER_RADIUS_ACL
  886. CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
  887. endif
  888. ifdef NEED_BASE64
  889. OBJS += ../src/utils/base64.o
  890. endif
  891. ifdef NEED_AP_MLME
  892. OBJS += ../src/ap/wmm.o
  893. OBJS += ../src/ap/ap_list.o
  894. OBJS += ../src/ap/ieee802_11.o
  895. OBJS += ../src/ap/hw_features.o
  896. OBJS += ../src/ap/dfs.o
  897. CFLAGS += -DNEED_AP_MLME
  898. endif
  899. ifdef CONFIG_IEEE80211N
  900. OBJS += ../src/ap/ieee802_11_ht.o
  901. endif
  902. ifdef CONFIG_IEEE80211AC
  903. OBJS += ../src/ap/ieee802_11_vht.o
  904. endif
  905. ifdef CONFIG_P2P_MANAGER
  906. CFLAGS += -DCONFIG_P2P_MANAGER
  907. OBJS += ../src/ap/p2p_hostapd.o
  908. endif
  909. ifdef CONFIG_HS20
  910. CFLAGS += -DCONFIG_HS20
  911. OBJS += ../src/ap/hs20.o
  912. CONFIG_INTERWORKING=y
  913. endif
  914. ifdef CONFIG_INTERWORKING
  915. CFLAGS += -DCONFIG_INTERWORKING
  916. OBJS += ../src/common/gas.o
  917. OBJS += ../src/ap/gas_serv.o
  918. endif
  919. ifdef CONFIG_PROXYARP
  920. CFLAGS += -DCONFIG_PROXYARP
  921. OBJS += ../src/ap/x_snoop.o
  922. OBJS += ../src/ap/dhcp_snoop.o
  923. ifdef CONFIG_IPV6
  924. OBJS += ../src/ap/ndisc_snoop.o
  925. endif
  926. endif
  927. OBJS += ../src/drivers/driver_common.o
  928. ifdef CONFIG_WPA_CLI_EDIT
  929. OBJS_c += ../src/utils/edit.o
  930. else
  931. OBJS_c += ../src/utils/edit_simple.o
  932. endif
  933. ifdef CONFIG_ACS
  934. CFLAGS += -DCONFIG_ACS
  935. OBJS += ../src/ap/acs.o
  936. LIBS += -lm
  937. endif
  938. ifdef CONFIG_NO_STDOUT_DEBUG
  939. CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  940. endif
  941. ifdef CONFIG_DEBUG_SYSLOG
  942. CFLAGS += -DCONFIG_DEBUG_SYSLOG
  943. endif
  944. ifdef CONFIG_DEBUG_LINUX_TRACING
  945. CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
  946. endif
  947. ifdef CONFIG_DEBUG_FILE
  948. CFLAGS += -DCONFIG_DEBUG_FILE
  949. endif
  950. ifdef CONFIG_SQLITE
  951. CFLAGS += -DCONFIG_SQLITE
  952. LIBS += -lsqlite3
  953. LIBS_h += -lsqlite3
  954. endif
  955. ifdef CONFIG_FST
  956. CFLAGS += -DCONFIG_FST
  957. OBJS += ../src/fst/fst.o
  958. OBJS += ../src/fst/fst_group.o
  959. OBJS += ../src/fst/fst_iface.o
  960. OBJS += ../src/fst/fst_session.o
  961. OBJS += ../src/fst/fst_ctrl_aux.o
  962. ifdef CONFIG_FST_TEST
  963. CFLAGS += -DCONFIG_FST_TEST
  964. endif
  965. ifndef CONFIG_NO_CTRL_IFACE
  966. OBJS += ../src/fst/fst_ctrl_iface.o
  967. endif
  968. endif
  969. ALL=hostapd hostapd_cli
  970. all: verify_config $(ALL)
  971. Q=@
  972. E=echo
  973. ifeq ($(V), 1)
  974. Q=
  975. E=true
  976. endif
  977. ifeq ($(QUIET), 1)
  978. Q=@
  979. E=true
  980. endif
  981. ifdef CONFIG_CODE_COVERAGE
  982. %.o: %.c
  983. @$(E) " CC " $<
  984. $(Q)cd $(dir $@); $(CC) -c -o $(notdir $@) $(CFLAGS) $(notdir $<)
  985. else
  986. %.o: %.c
  987. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  988. @$(E) " CC " $<
  989. endif
  990. verify_config:
  991. @if [ ! -r .config ]; then \
  992. echo 'Building hostapd requires a configuration file'; \
  993. echo '(.config). See README for more instructions. You can'; \
  994. echo 'run "cp defconfig .config" to create an example'; \
  995. echo 'configuration.'; \
  996. exit 1; \
  997. fi
  998. $(DESTDIR)$(BINDIR)/%: %
  999. install -D $(<) $(@)
  1000. install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL))
  1001. ../src/drivers/build.hostapd:
  1002. @if [ -f ../src/drivers/build.wpa_supplicant ]; then \
  1003. $(MAKE) -C ../src/drivers clean; \
  1004. fi
  1005. @touch ../src/drivers/build.hostapd
  1006. BCHECK=../src/drivers/build.hostapd
  1007. hostapd: $(BCHECK) $(OBJS)
  1008. $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
  1009. @$(E) " LD " $@
  1010. ifdef CONFIG_WPA_TRACE
  1011. OBJS_c += ../src/utils/trace.o
  1012. endif
  1013. hostapd_cli: $(OBJS_c)
  1014. $(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c)
  1015. @$(E) " LD " $@
  1016. NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS)
  1017. NOBJS += ../src/utils/common.o
  1018. ifdef NEED_RC4
  1019. ifdef CONFIG_INTERNAL_RC4
  1020. ifndef CONFIG_NO_RC4
  1021. NOBJS += ../src/crypto/rc4.o
  1022. endif
  1023. endif
  1024. endif
  1025. ifdef CONFIG_INTERNAL_MD5
  1026. NOBJS += ../src/crypto/md5-internal.o
  1027. endif
  1028. NOBJS += ../src/crypto/crypto_openssl.o ../src/utils/os_$(CONFIG_OS).o
  1029. NOBJS += ../src/utils/wpa_debug.o
  1030. NOBJS += ../src/utils/wpabuf.o
  1031. ifdef CONFIG_WPA_TRACE
  1032. NOBJS += ../src/utils/trace.o
  1033. LIBS_n += -lbfd
  1034. endif
  1035. ifdef TLS_FUNCS
  1036. LIBS_n += -lcrypto
  1037. endif
  1038. 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
  1039. HOBJS += ../src/crypto/aes-encblock.o
  1040. ifdef CONFIG_INTERNAL_AES
  1041. HOBJS += ../src/crypto/aes-internal.o
  1042. HOBJS += ../src/crypto/aes-internal-enc.o
  1043. endif
  1044. ifeq ($(CONFIG_TLS), linux)
  1045. HOBJS += ../src/crypto/crypto_linux.o
  1046. endif
  1047. nt_password_hash: $(NOBJS)
  1048. $(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
  1049. @$(E) " LD " $@
  1050. hlr_auc_gw: $(HOBJS)
  1051. $(Q)$(CC) $(LDFLAGS) -o hlr_auc_gw $(HOBJS) $(LIBS_h)
  1052. @$(E) " LD " $@
  1053. lcov-html:
  1054. lcov -c -d .. > lcov.info
  1055. genhtml lcov.info --output-directory lcov-html
  1056. clean:
  1057. $(MAKE) -C ../src clean
  1058. rm -f core *~ *.o hostapd hostapd_cli nt_password_hash hlr_auc_gw
  1059. rm -f *.d *.gcno *.gcda *.gcov
  1060. rm -f lcov.info
  1061. rm -rf lcov-html
  1062. -include $(OBJS:%.o=%.d)