Makefile 26 KB

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