1ALL=hostapd hostapd_cli 2CONFIG_FILE = .config 3ifeq ($(KERNEL_TYPE), linux) 4CC=arm-himix410-linux-gcc 5LD=arm-himix410-linux-ld 6else 7CC=../../../../prebuilts/gcc/linux-x86/arm/arm-linux-ohoseabi-gcc/bin/arm-linux-ohoseabi-gcc 8endif 9 10include ../src/build.rules 11ifndef CFLAGS 12ifeq ($(LIB_TYPE),$(KERNEL_TYPE), 1,linux) 13CFLAGS = -fvisibility=hidden -MMD -O2 -g -w -fsigned-char 14else ifeq ($(LIB_TYPE), 1) 15CFLAGS = -fvisibility=hidden -flto -MMD -O2 -g -w -fsigned-char 16else 17CFLAGS = -MMD -O2 -g -w -fsigned-char 18endif 19endif 20 21ifdef LIBS 22# If LIBS is set with some global build system defaults, clone those for 23# LIBS_c, LIBS_h, and LIBS_n to cover hostapd_cli, hlr_auc_gw, and 24# nt_password_hash as well. 25ifndef LIBS_c 26LIBS_c := $(LIBS) 27endif 28ifndef LIBS_h 29LIBS_h := $(LIBS) 30endif 31ifndef LIBS_n 32LIBS_n := $(LIBS) 33endif 34ifndef LIBS_s 35LIBS_s := $(LIBS) 36endif 37endif 38 39CFLAGS += $(EXTRA_CFLAGS) 40CFLAGS += -I$(abspath ../src) 41CFLAGS += -I$(abspath ../src/utils) 42CFLAGS += -I$(abspath ../src/drivers) 43CFLAGS += -I$(abspath ./) 44CFLAGS += -I$(abspath ../wpa_supplicant) 45CFLAGS += -I$(abspath ../os_dep/include) 46CFLAGS += -I$(abspath ../../../../drivers/framework/include) 47CFLAGS += -I$(abspath ../../../../drivers/framework/include/utils) 48CFLAGS += -I$(abspath ../../../../drivers/framework/utils/include) 49CFLAGS += -I$(abspath ../../../../drivers/framework/include/osal) 50CFLAGS += -I$(abspath ../../../../third_party/bounds_checking_function/include) 51CFLAGS += -I$(abspath ../../../../drivers/framework/ability/sbuf/include) 52CFLAGS += -I$(abspath ../../../../drivers/framework/include/core) 53CFLAGS += -I$(abspath ../../../../drivers/framework/core//adapter/syscall/include) 54CFLAGS += -I$(abspath ../../../../drivers/framework/core/shared/include) 55CFLAGS += -I$(abspath ../../../../drivers/peripheral/wlan/client/include) 56CFLAGS += -I$(abspath ../build/include) 57CFLAGS += -shared -fPIC 58CFLAGS += -fstack-protector-all 59CFLAGS += -DUSERSPACE_CLIENT_SUPPORT 60LIBS += -L$(DEPDIR) -lsec_shared -lhilog_shared -lwifi_driver_client 61 62export BINDIR ?= /usr/local/bin/ 63 64ifeq ($(COMPILER_TYPE), clang) 65SYSROOT_PATH ?= ../../../../sysroot 66ARCH_CFLAGS ?= --target=arm-liteos-ohos -march=armv7-a -mfloat-abi=softfp 67CC := $(COMPILER_DIR)/bin/clang 68CFLAGS += --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS) 69LDFLAGS += --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS) 70LDFLAGS += -lc 71endif 72 73ifndef CONFIG_NO_GITVER 74# Add VERSION_STR postfix for builds from a git repository 75ifeq ($(wildcard ../.git),../.git) 76GITVER := $(shell git describe --dirty=+) 77ifneq ($(GITVER),) 78CFLAGS += -DGIT_VERSION_STR_POSTFIX=\"-$(GITVER)\" 79endif 80endif 81endif 82 83ifdef CONFIG_TESTING_OPTIONS 84CFLAGS += -DCONFIG_TESTING_OPTIONS 85CONFIG_WPS_TESTING=y 86endif 87 88ifndef CONFIG_OS 89ifdef CONFIG_NATIVE_WINDOWS 90CONFIG_OS=win32 91else 92CONFIG_OS=unix 93endif 94endif 95 96ifeq ($(CONFIG_OS), internal) 97CFLAGS += -DOS_NO_C_LIB_DEFINES 98endif 99 100ifdef CONFIG_NATIVE_WINDOWS 101CFLAGS += -DCONFIG_NATIVE_WINDOWS 102LIBS += -lws2_32 103endif 104 105OBJS += ap_main.o 106OBJS += ap_config_file.o 107 108OBJS += ../src/ap/hostapd.o 109OBJS += ../src/ap/wpa_auth_glue.o 110OBJS += ../src/ap/drv_callbacks.o 111OBJS += ../src/ap/ap_drv_ops.o 112OBJS += ../src/ap/utils.o 113OBJS += ../src/ap/authsrv.o 114OBJS += ../src/ap/ieee802_1x.o 115OBJS += ../src/ap/ap_config.o 116OBJS += ../src/ap/eap_user_db.o 117OBJS += ../src/ap/ieee802_11_auth.o 118OBJS += ../src/ap/sta_info.o 119OBJS += ../src/ap/wpa_auth.o 120OBJS += ../src/ap/tkip_countermeasures.o 121OBJS += ../src/ap/ap_mlme.o 122OBJS += ../src/ap/wpa_auth_ie.o 123OBJS += ../src/ap/preauth_auth.o 124OBJS += ../src/ap/pmksa_cache_auth.o 125OBJS += ../src/ap/ieee802_11_shared.o 126OBJS += ../src/ap/beacon.o 127OBJS += ../src/ap/bss_load.o 128OBJS += ../src/ap/neighbor_db.o 129OBJS += ../src/ap/ap_rrm.o 130 131OBJS_c = hostapd_cli.o 132OBJS_c += ../src/common/wpa_ctrl.o 133OBJS_c += ../src/utils/os_$(CONFIG_OS).o 134OBJS_c += ../src/common/cli.o 135 136NEED_RC4=y 137NEED_AES=y 138NEED_MD5=y 139NEED_SHA1=y 140 141OBJS += ../src/drivers/drivers.o 142CFLAGS += -DHOSTAPD 143 144ifdef CONFIG_TAXONOMY 145CFLAGS += -DCONFIG_TAXONOMY 146OBJS += ../src/ap/taxonomy.o 147endif 148 149ifdef CONFIG_MODULE_TESTS 150CFLAGS += -DCONFIG_MODULE_TESTS 151OBJS += hapd_module_tests.o 152endif 153 154ifdef CONFIG_WPA_TRACE 155CFLAGS += -DWPA_TRACE 156OBJS += ../src/utils/trace.o 157HOBJS += ../src/utils/trace.o 158LDFLAGS += -rdynamic 159CFLAGS += -funwind-tables 160ifdef CONFIG_WPA_TRACE_BFD 161CFLAGS += -DPACKAGE="hostapd" -DWPA_TRACE_BFD 162LIBS += -lbfd -ldl -liberty -lz 163LIBS_c += -lbfd -ldl -liberty -lz 164LIBS_h += -lbfd -ldl -liberty -lz 165LIBS_n += -lbfd -ldl -liberty -lz 166LIBS_s += -lbfd -ldl -liberty -lz 167endif 168endif 169 170ifndef CONFIG_ELOOP 171CONFIG_ELOOP=eloop 172endif 173OBJS += ../src/utils/$(CONFIG_ELOOP).o 174OBJS_c += ../src/utils/$(CONFIG_ELOOP).o 175 176ifeq ($(CONFIG_ELOOP), eloop) 177# Using glibc < 2.17 requires -lrt for clock_gettime() 178LIBS += -lrt 179LIBS_c += -lrt 180LIBS_h += -lrt 181LIBS_n += -lrt 182endif 183 184ifdef CONFIG_ELOOP_POLL 185CFLAGS += -DCONFIG_ELOOP_POLL 186endif 187 188ifdef CONFIG_ELOOP_EPOLL 189CFLAGS += -DCONFIG_ELOOP_EPOLL 190endif 191 192ifdef CONFIG_ELOOP_KQUEUE 193CFLAGS += -DCONFIG_ELOOP_KQUEUE 194endif 195 196OBJS += ../src/utils/common.o 197OBJS_c += ../src/utils/common.o 198OBJS += ../src/utils/wpa_debug.o 199OBJS_c += ../src/utils/wpa_debug.o 200OBJS += ../src/utils/wpabuf.o 201OBJS += ../src/utils/os_$(CONFIG_OS).o 202OBJS += ../src/utils/ip_addr.o 203OBJS += ../src/utils/crc32.o 204 205OBJS += ../src/common/ieee802_11_common.o 206OBJS += ../src/common/wpa_common.o 207OBJS += ../src/common/hw_features_common.o 208 209OBJS += ../src/eapol_auth/eapol_auth_sm.o 210 211 212ifdef CONFIG_CODE_COVERAGE 213CFLAGS += -O0 -fprofile-arcs -ftest-coverage 214LIBS += -lgcov 215LIBS_c += -lgcov 216LIBS_h += -lgcov 217LIBS_n += -lgcov 218endif 219 220ifndef CONFIG_NO_DUMP_STATE 221# define HOSTAPD_DUMP_STATE to include support for dumping internal state 222# through control interface commands (undefine it, if you want to save in 223# binary size) 224CFLAGS += -DHOSTAPD_DUMP_STATE 225OBJS += ../src/eapol_auth/eapol_auth_dump.o 226endif 227 228ifdef CONFIG_NO_RADIUS 229CFLAGS += -DCONFIG_NO_RADIUS 230CONFIG_NO_ACCOUNTING=y 231else 232OBJS += ../src/radius/radius.o 233OBJS += ../src/radius/radius_client.o 234OBJS += ../src/radius/radius_das.o 235endif 236 237ifdef CONFIG_NO_ACCOUNTING 238CFLAGS += -DCONFIG_NO_ACCOUNTING 239else 240OBJS += ../src/ap/accounting.o 241endif 242 243ifdef CONFIG_NO_VLAN 244CFLAGS += -DCONFIG_NO_VLAN 245else 246OBJS += ../src/ap/vlan_init.o 247OBJS += ../src/ap/vlan_ifconfig.o 248OBJS += ../src/ap/vlan.o 249ifdef CONFIG_FULL_DYNAMIC_VLAN 250# Define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges 251# and VLAN interfaces for the VLAN feature. 252CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN 253OBJS += ../src/ap/vlan_full.o 254ifdef CONFIG_VLAN_NETLINK 255OBJS += ../src/ap/vlan_util.o 256else 257OBJS += ../src/ap/vlan_ioctl.o 258endif 259endif 260endif 261 262ifdef CONFIG_NO_CTRL_IFACE 263CFLAGS += -DCONFIG_NO_CTRL_IFACE 264else 265ifeq ($(CONFIG_CTRL_IFACE), udp) 266CFLAGS += -DCONFIG_CTRL_IFACE_UDP 267else 268ifeq ($(CONFIG_CTRL_IFACE), udp6) 269CFLAGS += -DCONFIG_CTRL_IFACE_UDP 270CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6 271else 272ifeq ($(CONFIG_CTRL_IFACE), udp-remote) 273CFLAGS += -DCONFIG_CTRL_IFACE_UDP 274CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE 275else 276ifeq ($(CONFIG_CTRL_IFACE), udp6-remote) 277CFLAGS += -DCONFIG_CTRL_IFACE_UDP 278CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE 279CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6 280else 281CFLAGS += -DCONFIG_CTRL_IFACE_UNIX 282endif 283endif 284endif 285endif 286OBJS += ../src/common/ctrl_iface_common.o 287OBJS += ap_ctrl_iface.o 288OBJS += ../src/ap/ctrl_iface_ap.o 289endif 290 291ifndef CONFIG_NO_CTRL_IFACE 292CFLAGS += -DCONFIG_CTRL_IFACE 293endif 294 295ifdef CONFIG_RSN_PREAUTH 296CFLAGS += -DCONFIG_RSN_PREAUTH 297#CONFIG_L2_PACKET=y 298endif 299 300ifdef CONFIG_HS20 301CONFIG_PROXYARP=y 302endif 303 304ifdef CONFIG_PROXYARP 305#CONFIG_L2_PACKET=y 306endif 307 308ifdef CONFIG_SUITEB 309CFLAGS += -DCONFIG_SUITEB 310endif 311 312ifdef CONFIG_SUITEB192 313CFLAGS += -DCONFIG_SUITEB192 314NEED_SHA384=y 315endif 316 317ifdef CONFIG_OCV 318CFLAGS += -DCONFIG_OCV 319OBJS += ../src/common/ocv.o 320endif 321 322ifdef CONFIG_IEEE80211R 323CFLAGS += -DCONFIG_IEEE80211R -DCONFIG_IEEE80211R_AP 324OBJS += ../src/ap/wpa_auth_ft.o 325NEED_AES_UNWRAP=y 326NEED_AES_SIV=y 327NEED_ETH_P_OUI=y 328NEED_HMAC_SHA256_KDF=y 329endif 330 331ifdef NEED_ETH_P_OUI 332CFLAGS += -DCONFIG_ETH_P_OUI 333OBJS += ../src/ap/eth_p_oui.o 334endif 335 336ifdef CONFIG_SAE 337CFLAGS += -DCONFIG_SAE 338OBJS += ../src/common/sae.o 339ifdef CONFIG_SAE_PK 340CFLAGS += -DCONFIG_SAE_PK 341OBJS += ../src/common/sae_pk.o 342endif 343NEED_ECC=y 344NEED_DH_GROUPS=y 345NEED_HMAC_SHA256_KDF=y 346NEED_AP_MLME=y 347NEED_DRAGONFLY=y 348endif 349 350ifdef CONFIG_OWE 351CFLAGS += -DCONFIG_OWE 352NEED_ECC=y 353NEED_HMAC_SHA256_KDF=y 354NEED_HMAC_SHA384_KDF=y 355NEED_HMAC_SHA512_KDF=y 356NEED_SHA384=y 357NEED_SHA512=y 358endif 359 360ifdef CONFIG_AIRTIME_POLICY 361CFLAGS += -DCONFIG_AIRTIME_POLICY 362OBJS += ../src/ap/airtime_policy.o 363endif 364 365ifdef CONFIG_FILS 366CFLAGS += -DCONFIG_FILS 367OBJS += ../src/ap/fils_hlp.o 368NEED_SHA384=y 369NEED_AES_SIV=y 370ifdef CONFIG_FILS_SK_PFS 371CFLAGS += -DCONFIG_FILS_SK_PFS 372NEED_ECC=y 373endif 374endif 375 376ifdef CONFIG_WNM 377CFLAGS += -DCONFIG_WNM -DCONFIG_WNM_AP 378OBJS += ../src/ap/wnm_ap.o 379endif 380 381ifdef CONFIG_IEEE80211AC 382CFLAGS += -DCONFIG_IEEE80211AC 383endif 384 385ifdef CONFIG_IEEE80211AX 386CFLAGS += -DCONFIG_IEEE80211AX 387OBJS += ../src/ap/ieee802_11_he.o 388endif 389 390ifdef CONFIG_MBO 391CFLAGS += -DCONFIG_MBO 392OBJS += ../src/ap/mbo_ap.o 393endif 394 395include ../src/drivers/drivers.mak 396OBJS += $(DRV_AP_OBJS) 397CFLAGS += $(DRV_AP_CFLAGS) 398LDFLAGS += $(DRV_AP_LDFLAGS) 399LIBS += $(DRV_AP_LIBS) 400 401#ifdef CONFIG_L2_PACKET 402#ifdef CONFIG_DNET_PCAP 403#ifdef CONFIG_L2_FREEBSD 404#LIBS += -lpcap 405#OBJS += ../src/l2_packet/l2_packet_freebsd.o 406#else 407#LIBS += -ldnet -lpcap 408#OBJS += ../src/l2_packet/l2_packet_pcap.o 409#endif 410#else 411#OBJS += ../src/l2_packet/l2_packet_linux.o 412#endif 413#else 414#OBJS += ../src/l2_packet/l2_packet_none.o 415#endif 416 417ifndef CONFIG_L2_PACKET 418CONFIG_L2_PACKET=rtos 419endif 420 421OBJS += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o 422 423ifeq ($(CONFIG_L2_PACKET), pcap) 424ifdef CONFIG_WINPCAP 425CFLAGS += -DCONFIG_WINPCAP 426LIBS += -lwpcap -lpacket 427LIBS_w += -lwpcap 428else 429LIBS += -ldnet -lpcap 430endif 431endif 432 433ifeq ($(CONFIG_L2_PACKET), winpcap) 434LIBS += -lwpcap -lpacket 435LIBS_w += -lwpcap 436endif 437 438ifeq ($(CONFIG_L2_PACKET), freebsd) 439LIBS += -lpcap 440endif 441 442 443ifdef CONFIG_ERP 444CFLAGS += -DCONFIG_ERP 445NEED_HMAC_SHA256_KDF=y 446endif 447 448ifdef CONFIG_EAP_MD5 449CFLAGS += -DEAP_SERVER_MD5 450OBJS += ../src/eap_server/eap_server_md5.o 451CHAP=y 452endif 453 454ifdef CONFIG_EAP_TLS 455CFLAGS += -DEAP_SERVER_TLS 456OBJS += ../src/eap_server/eap_server_tls.o 457TLS_FUNCS=y 458endif 459 460ifdef CONFIG_EAP_UNAUTH_TLS 461CFLAGS += -DEAP_SERVER_UNAUTH_TLS 462ifndef CONFIG_EAP_TLS 463OBJS += ../src/eap_server/eap_server_tls.o 464TLS_FUNCS=y 465endif 466endif 467 468ifdef CONFIG_EAP_PEAP 469CFLAGS += -DEAP_SERVER_PEAP 470OBJS += ../src/eap_server/eap_server_peap.o 471OBJS += ../src/eap_common/eap_peap_common.o 472TLS_FUNCS=y 473CONFIG_EAP_MSCHAPV2=y 474endif 475 476ifdef CONFIG_EAP_TTLS 477CFLAGS += -DEAP_SERVER_TTLS 478OBJS += ../src/eap_server/eap_server_ttls.o 479TLS_FUNCS=y 480CHAP=y 481endif 482 483ifdef CONFIG_EAP_MSCHAPV2 484CFLAGS += -DEAP_SERVER_MSCHAPV2 485OBJS += ../src/eap_server/eap_server_mschapv2.o 486MS_FUNCS=y 487endif 488 489ifdef CONFIG_EAP_GTC 490CFLAGS += -DEAP_SERVER_GTC 491OBJS += ../src/eap_server/eap_server_gtc.o 492endif 493 494ifdef CONFIG_EAP_SIM 495CFLAGS += -DEAP_SERVER_SIM 496OBJS += ../src/eap_server/eap_server_sim.o 497CONFIG_EAP_SIM_COMMON=y 498NEED_AES_CBC=y 499endif 500 501ifdef CONFIG_EAP_AKA 502CFLAGS += -DEAP_SERVER_AKA 503OBJS += ../src/eap_server/eap_server_aka.o 504CONFIG_EAP_SIM_COMMON=y 505NEED_AES_CBC=y 506endif 507 508ifdef CONFIG_EAP_AKA_PRIME 509CFLAGS += -DEAP_SERVER_AKA_PRIME 510endif 511 512ifdef CONFIG_EAP_SIM_COMMON 513OBJS += ../src/eap_common/eap_sim_common.o 514# Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be 515# replaced with another file implementing the interface specified in 516# eap_sim_db.h. 517OBJS += ../src/eap_server/eap_sim_db.o 518NEED_FIPS186_2_PRF=y 519endif 520 521ifdef CONFIG_EAP_PAX 522CFLAGS += -DEAP_SERVER_PAX 523OBJS += ../src/eap_server/eap_server_pax.o ../src/eap_common/eap_pax_common.o 524endif 525 526ifdef CONFIG_EAP_PSK 527CFLAGS += -DEAP_SERVER_PSK 528OBJS += ../src/eap_server/eap_server_psk.o ../src/eap_common/eap_psk_common.o 529NEED_AES_ENCBLOCK=y 530NEED_AES_EAX=y 531endif 532 533ifdef CONFIG_EAP_SAKE 534CFLAGS += -DEAP_SERVER_SAKE 535OBJS += ../src/eap_server/eap_server_sake.o ../src/eap_common/eap_sake_common.o 536endif 537 538ifdef CONFIG_EAP_GPSK 539CFLAGS += -DEAP_SERVER_GPSK 540OBJS += ../src/eap_server/eap_server_gpsk.o ../src/eap_common/eap_gpsk_common.o 541ifdef CONFIG_EAP_GPSK_SHA256 542CFLAGS += -DEAP_GPSK_SHA256 543endif 544endif 545 546ifdef CONFIG_EAP_PWD 547CFLAGS += -DEAP_SERVER_PWD 548OBJS += ../src/eap_server/eap_server_pwd.o ../src/eap_common/eap_pwd_common.o 549NEED_ECC=y 550NEED_DRAGONFLY=y 551endif 552 553ifdef CONFIG_EAP_EKE 554CFLAGS += -DEAP_SERVER_EKE 555OBJS += ../src/eap_server/eap_server_eke.o ../src/eap_common/eap_eke_common.o 556NEED_DH_GROUPS=y 557NEED_DH_GROUPS_ALL=y 558endif 559 560ifdef CONFIG_EAP_VENDOR_TEST 561CFLAGS += -DEAP_SERVER_VENDOR_TEST 562OBJS += ../src/eap_server/eap_server_vendor_test.o 563endif 564 565ifdef CONFIG_EAP_FAST 566CFLAGS += -DEAP_SERVER_FAST 567OBJS += ../src/eap_server/eap_server_fast.o 568OBJS += ../src/eap_common/eap_fast_common.o 569TLS_FUNCS=y 570NEED_T_PRF=y 571NEED_AES_UNWRAP=y 572endif 573 574ifdef CONFIG_EAP_TEAP 575CFLAGS += -DEAP_SERVER_TEAP 576OBJS += ../src/eap_server/eap_server_teap.o 577OBJS += ../src/eap_common/eap_teap_common.o 578TLS_FUNCS=y 579NEED_T_PRF=y 580NEED_SHA384=y 581NEED_TLS_PRF_SHA256=y 582NEED_TLS_PRF_SHA384=y 583NEED_AES_UNWRAP=y 584endif 585 586ifdef CONFIG_WPS 587CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC 588OBJS += ../src/utils/uuid.o 589OBJS += ../src/ap/wps_hostapd.o 590OBJS += ../src/eap_server/eap_server_wsc.o ../src/eap_common/eap_wsc_common.o 591OBJS += ../src/wps/wps.o 592OBJS += ../src/wps/wps_common.o 593OBJS += ../src/wps/wps_attr_parse.o 594OBJS += ../src/wps/wps_attr_build.o 595OBJS += ../src/wps/wps_attr_process.o 596OBJS += ../src/wps/wps_dev_attr.o 597OBJS += ../src/wps/wps_enrollee.o 598OBJS += ../src/wps/wps_registrar.o 599NEED_DH_GROUPS=y 600NEED_BASE64=y 601NEED_AES_CBC=y 602NEED_MODEXP=y 603CONFIG_EAP=y 604 605ifdef CONFIG_WPS_NFC 606CFLAGS += -DCONFIG_WPS_NFC 607OBJS += ../src/wps/ndef.o 608NEED_WPS_OOB=y 609endif 610 611ifdef NEED_WPS_OOB 612CFLAGS += -DCONFIG_WPS_OOB 613endif 614 615ifdef CONFIG_WPS_UPNP 616CFLAGS += -DCONFIG_WPS_UPNP 617OBJS += ../src/wps/wps_upnp.o 618OBJS += ../src/wps/wps_upnp_ssdp.o 619OBJS += ../src/wps/wps_upnp_web.o 620OBJS += ../src/wps/wps_upnp_event.o 621OBJS += ../src/wps/wps_upnp_ap.o 622OBJS += ../src/wps/upnp_xml.o 623OBJS += ../src/wps/httpread.o 624OBJS += ../src/wps/http_client.o 625OBJS += ../src/wps/http_server.o 626endif 627 628ifdef CONFIG_WPS_STRICT 629CFLAGS += -DCONFIG_WPS_STRICT 630OBJS += ../src/wps/wps_validate.o 631endif 632 633ifdef CONFIG_WPS_TESTING 634CFLAGS += -DCONFIG_WPS_TESTING 635endif 636 637endif 638 639ifdef CONFIG_DPP 640CFLAGS += -DCONFIG_DPP 641OBJS += ../src/common/dpp.o 642OBJS += ../src/common/dpp_auth.o 643OBJS += ../src/common/dpp_backup.o 644OBJS += ../src/common/dpp_crypto.o 645OBJS += ../src/common/dpp_pkex.o 646OBJS += ../src/common/dpp_reconfig.o 647OBJS += ../src/common/dpp_tcp.o 648OBJS += ../src/ap/dpp_hostapd.o 649OBJS += ../src/ap/gas_query_ap.o 650NEED_AES_SIV=y 651NEED_HMAC_SHA256_KDF=y 652NEED_HMAC_SHA384_KDF=y 653NEED_HMAC_SHA512_KDF=y 654NEED_SHA384=y 655NEED_SHA512=y 656NEED_ECC=y 657NEED_JSON=y 658NEED_GAS=y 659NEED_BASE64=y 660NEED_ASN1=y 661ifdef CONFIG_DPP2 662CFLAGS += -DCONFIG_DPP2 663endif 664ifdef CONFIG_DPP3 665CFLAGS += -DCONFIG_DPP3 666endif 667endif 668 669ifdef CONFIG_PASN 670CFLAGS += -DCONFIG_PASN 671CFLAGS += -DCONFIG_PTKSA_CACHE 672NEED_HMAC_SHA256_KDF=y 673NEED_HMAC_SHA384_KDF=y 674NEED_SHA256=y 675NEED_SHA384=y 676OBJS += ../src/common/ptksa_cache.o 677endif 678 679ifdef CONFIG_EAP_IKEV2 680CFLAGS += -DEAP_SERVER_IKEV2 681OBJS += ../src/eap_server/eap_server_ikev2.o ../src/eap_server/ikev2.o 682OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o 683NEED_DH_GROUPS=y 684NEED_DH_GROUPS_ALL=y 685NEED_MODEXP=y 686NEED_CIPHER=y 687endif 688 689ifdef CONFIG_EAP_TNC 690CFLAGS += -DEAP_SERVER_TNC 691OBJS += ../src/eap_server/eap_server_tnc.o 692OBJS += ../src/eap_server/tncs.o 693NEED_BASE64=y 694ifndef CONFIG_DRIVER_BSD 695LIBS += -ldl 696endif 697endif 698 699ifdef CONFIG_MACSEC 700CFLAGS += -DCONFIG_MACSEC 701OBJS += ../src/ap/wpa_auth_kay.o 702OBJS += ../src/pae/ieee802_1x_cp.o 703OBJS += ../src/pae/ieee802_1x_kay.o 704OBJS += ../src/pae/ieee802_1x_key.o 705OBJS += ../src/pae/ieee802_1x_secy_ops.o 706endif 707 708# Basic EAP functionality is needed for EAPOL 709OBJS += ap_eap_register.o 710OBJS += ../src/eap_server/eap_server.o 711OBJS += ../src/eap_common/eap_common.o 712OBJS += ../src/eap_server/eap_server_methods.o 713OBJS += ../src/eap_server/eap_server_identity.o 714CFLAGS += -DEAP_SERVER_IDENTITY 715 716ifdef CONFIG_EAP 717CFLAGS += -DEAP_SERVER 718endif 719 720ifdef CONFIG_PKCS12 721CFLAGS += -DPKCS12_FUNCS 722endif 723 724ifdef NEED_DRAGONFLY 725OBJS += ../src/common/dragonfly.o 726endif 727 728ifdef MS_FUNCS 729OBJS += ../src/crypto/ms_funcs.o 730NEED_DES=y 731NEED_MD4=y 732endif 733 734ifdef CHAP 735OBJS += ../src/eap_common/chap.o 736endif 737 738ifdef TLS_FUNCS 739NEED_DES=y 740# Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS) 741CFLAGS += -DEAP_TLS_FUNCS 742OBJS += ../src/eap_server/eap_server_tls_common.o 743NEED_TLS_PRF=y 744endif 745 746ifndef CONFIG_TLS 747CONFIG_TLS=openssl 748endif 749 750ifdef CONFIG_TLSV11 751CFLAGS += -DCONFIG_TLSV11 752endif 753 754ifdef CONFIG_TLSV12 755CFLAGS += -DCONFIG_TLSV12 756endif 757 758ifeq ($(CONFIG_TLS), wolfssl) 759CONFIG_CRYPTO=wolfssl 760ifdef TLS_FUNCS 761OBJS += ../src/crypto/tls_wolfssl.o 762LIBS += -lwolfssl -lm 763endif 764OBJS += ../src/crypto/crypto_wolfssl.o 765HOBJS += ../src/crypto/crypto_wolfssl.o 766ifdef NEED_FIPS186_2_PRF 767OBJS += ../src/crypto/fips_prf_wolfssl.o 768endif 769NEED_TLS_PRF_SHA256=y 770LIBS += -lwolfssl -lm 771LIBS_h += -lwolfssl -lm 772ifdef CONFIG_TLS_ADD_DL 773LIBS += -ldl 774LIBS_h += -ldl 775endif 776endif 777 778ifeq ($(CONFIG_TLS), openssl) 779CONFIG_CRYPTO=openssl 780ifdef TLS_FUNCS 781OBJS += ../src/crypto/tls_openssl.o 782OBJS += ../src/crypto/tls_openssl_ocsp.o 783LIBS += -lssl 784endif 785OBJS += ../src/crypto/crypto_openssl.o 786HOBJS += ../src/crypto/crypto_openssl.o 787SOBJS += ../src/crypto/crypto_openssl.o 788ifdef NEED_FIPS186_2_PRF 789OBJS += ../src/crypto/fips_prf_openssl.o 790endif 791NEED_TLS_PRF_SHA256=y 792LIBS += -lcrypto 793LIBS_h += -lcrypto 794LIBS_n += -lcrypto 795LIBS_s += -lcrypto 796ifdef CONFIG_TLS_ADD_DL 797LIBS += -ldl 798LIBS_h += -ldl 799LIBS_s += -ldl 800endif 801ifndef CONFIG_TLS_DEFAULT_CIPHERS 802CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW" 803endif 804CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\" 805endif 806 807ifeq ($(CONFIG_TLS), gnutls) 808ifndef CONFIG_CRYPTO 809# default to libgcrypt 810CONFIG_CRYPTO=gnutls 811endif 812ifdef TLS_FUNCS 813OBJS += ../src/crypto/tls_gnutls.o 814LIBS += -lgnutls -lgpg-error 815endif 816OBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o 817HOBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o 818ifdef NEED_FIPS186_2_PRF 819OBJS += ../src/crypto/fips_prf_internal.o 820SHA1OBJS += ../src/crypto/sha1-internal.o 821endif 822ifeq ($(CONFIG_CRYPTO), gnutls) 823LIBS += -lgcrypt 824LIBS_h += -lgcrypt 825LIBS_n += -lgcrypt 826CONFIG_INTERNAL_RC4=y 827CONFIG_INTERNAL_DH_GROUP5=y 828endif 829ifeq ($(CONFIG_CRYPTO), nettle) 830LIBS += -lnettle -lgmp 831LIBS_p += -lnettle -lgmp 832CONFIG_INTERNAL_RC4=y 833CONFIG_INTERNAL_DH_GROUP5=y 834endif 835endif 836 837ifeq ($(CONFIG_TLS), internal) 838ifndef CONFIG_CRYPTO 839CONFIG_CRYPTO=internal 840endif 841ifdef TLS_FUNCS 842OBJS += ../src/crypto/crypto_internal-rsa.o 843OBJS += ../src/crypto/tls_internal.o 844OBJS += ../src/tls/tlsv1_common.o 845OBJS += ../src/tls/tlsv1_record.o 846OBJS += ../src/tls/tlsv1_cred.o 847OBJS += ../src/tls/tlsv1_server.o 848OBJS += ../src/tls/tlsv1_server_write.o 849OBJS += ../src/tls/tlsv1_server_read.o 850OBJS += ../src/tls/rsa.o 851OBJS += ../src/tls/x509v3.o 852OBJS += ../src/tls/pkcs1.o 853OBJS += ../src/tls/pkcs5.o 854OBJS += ../src/tls/pkcs8.o 855NEED_ASN1=y 856NEED_BASE64=y 857NEED_TLS_PRF=y 858ifdef CONFIG_TLSV12 859NEED_TLS_PRF_SHA256=y 860endif 861NEED_MODEXP=y 862NEED_CIPHER=y 863CFLAGS += -DCONFIG_TLS_INTERNAL 864CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER 865endif 866ifdef NEED_CIPHER 867NEED_DES=y 868OBJS += ../src/crypto/crypto_internal-cipher.o 869endif 870ifdef NEED_MODEXP 871OBJS += ../src/crypto/crypto_internal-modexp.o 872OBJS += ../src/tls/bignum.o 873endif 874ifeq ($(CONFIG_CRYPTO), libtomcrypt) 875OBJS += ../src/crypto/crypto_libtomcrypt.o 876LIBS += -ltomcrypt -ltfm 877LIBS_h += -ltomcrypt -ltfm 878CONFIG_INTERNAL_SHA256=y 879CONFIG_INTERNAL_RC4=y 880CONFIG_INTERNAL_DH_GROUP5=y 881endif 882ifeq ($(CONFIG_CRYPTO), internal) 883OBJS += ../src/crypto/crypto_internal.o 884NEED_AES_DEC=y 885CFLAGS += -DCONFIG_CRYPTO_INTERNAL 886ifdef CONFIG_INTERNAL_LIBTOMMATH 887CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH 888ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST 889CFLAGS += -DLTM_FAST 890endif 891else 892LIBS += -ltommath 893LIBS_h += -ltommath 894endif 895CONFIG_INTERNAL_AES=y 896CONFIG_INTERNAL_DES=y 897CONFIG_INTERNAL_SHA1=y 898CONFIG_INTERNAL_MD4=y 899CONFIG_INTERNAL_MD5=y 900CONFIG_INTERNAL_SHA256=y 901CONFIG_INTERNAL_SHA384=y 902CONFIG_INTERNAL_SHA512=y 903CONFIG_INTERNAL_RC4=y 904CONFIG_INTERNAL_DH_GROUP5=y 905endif 906ifeq ($(CONFIG_CRYPTO), cryptoapi) 907OBJS += ../src/crypto/crypto_cryptoapi.o 908OBJS_p += ../src/crypto/crypto_cryptoapi.o 909CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI 910CONFIG_INTERNAL_SHA256=y 911CONFIG_INTERNAL_RC4=y 912endif 913endif 914 915ifeq ($(CONFIG_TLS), linux) 916OBJS += ../src/crypto/crypto_linux.o 917ifdef TLS_FUNCS 918OBJS += ../src/crypto/crypto_internal-rsa.o 919OBJS += ../src/crypto/tls_internal.o 920OBJS += ../src/tls/tlsv1_common.o 921OBJS += ../src/tls/tlsv1_record.o 922OBJS += ../src/tls/tlsv1_cred.o 923OBJS += ../src/tls/tlsv1_server.o 924OBJS += ../src/tls/tlsv1_server_write.o 925OBJS += ../src/tls/tlsv1_server_read.o 926OBJS += ../src/tls/rsa.o 927OBJS += ../src/tls/x509v3.o 928OBJS += ../src/tls/pkcs1.o 929OBJS += ../src/tls/pkcs5.o 930OBJS += ../src/tls/pkcs8.o 931NEED_ASN1=y 932NEED_BASE64=y 933NEED_TLS_PRF=y 934ifdef CONFIG_TLSV12 935NEED_TLS_PRF_SHA256=y 936endif 937NEED_MODEXP=y 938NEED_CIPHER=y 939CFLAGS += -DCONFIG_TLS_INTERNAL 940CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER 941endif 942ifdef NEED_MODEXP 943OBJS += ../src/crypto/crypto_internal-modexp.o 944OBJS += ../src/tls/bignum.o 945CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH 946CFLAGS += -DLTM_FAST 947endif 948CONFIG_INTERNAL_DH_GROUP5=y 949ifdef NEED_FIPS186_2_PRF 950OBJS += ../src/crypto/fips_prf_internal.o 951OBJS += ../src/crypto/sha1-internal.o 952endif 953endif 954 955ifeq ($(CONFIG_TLS), none) 956ifdef TLS_FUNCS 957OBJS += ../src/crypto/tls_none.o 958CFLAGS += -DEAP_TLS_NONE 959CONFIG_INTERNAL_AES=y 960CONFIG_INTERNAL_SHA1=y 961CONFIG_INTERNAL_MD5=y 962endif 963OBJS += ../src/crypto/crypto_none.o 964OBJS_p += ../src/crypto/crypto_none.o 965CONFIG_INTERNAL_SHA256=y 966CONFIG_INTERNAL_RC4=y 967endif 968 969ifndef TLS_FUNCS 970OBJS += ../src/crypto/tls_none.o 971ifeq ($(CONFIG_TLS), internal) 972CONFIG_INTERNAL_AES=y 973CONFIG_INTERNAL_SHA1=y 974CONFIG_INTERNAL_MD5=y 975CONFIG_INTERNAL_RC4=y 976endif 977endif 978 979AESOBJS = # none so far 980ifdef CONFIG_INTERNAL_AES 981AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-enc.o 982endif 983 984ifneq ($(CONFIG_TLS), openssl) 985ifneq ($(CONFIG_TLS), wolfssl) 986AESOBJS += ../src/crypto/aes-wrap.o 987endif 988endif 989ifdef NEED_AES_EAX 990AESOBJS += ../src/crypto/aes-eax.o 991NEED_AES_CTR=y 992endif 993ifdef NEED_AES_SIV 994AESOBJS += ../src/crypto/aes-siv.o 995NEED_AES_CTR=y 996endif 997ifdef NEED_AES_CTR 998AESOBJS += ../src/crypto/aes-ctr.o 999endif 1000ifdef NEED_AES_ENCBLOCK 1001AESOBJS += ../src/crypto/aes-encblock.o 1002endif 1003ifneq ($(CONFIG_TLS), linux) 1004ifneq ($(CONFIG_TLS), wolfssl) 1005AESOBJS += ../src/crypto/aes-omac1.o 1006endif 1007endif 1008ifdef NEED_AES_UNWRAP 1009ifneq ($(CONFIG_TLS), openssl) 1010ifneq ($(CONFIG_TLS), linux) 1011ifneq ($(CONFIG_TLS), wolfssl) 1012NEED_AES_DEC=y 1013AESOBJS += ../src/crypto/aes-unwrap.o 1014endif 1015endif 1016endif 1017endif 1018ifdef NEED_AES_CBC 1019NEED_AES_DEC=y 1020ifneq ($(CONFIG_TLS), openssl) 1021ifneq ($(CONFIG_TLS), linux) 1022ifneq ($(CONFIG_TLS), wolfssl) 1023AESOBJS += ../src/crypto/aes-cbc.o 1024endif 1025endif 1026endif 1027endif 1028ifdef NEED_AES_DEC 1029ifdef CONFIG_INTERNAL_AES 1030AESOBJS += ../src/crypto/aes-internal-dec.o 1031endif 1032endif 1033ifdef NEED_AES 1034OBJS += $(AESOBJS) 1035endif 1036 1037ifdef NEED_SHA1 1038ifneq ($(CONFIG_TLS), openssl) 1039ifneq ($(CONFIG_TLS), linux) 1040ifneq ($(CONFIG_TLS), gnutls) 1041ifneq ($(CONFIG_TLS), wolfssl) 1042SHA1OBJS += ../src/crypto/sha1.o 1043endif 1044endif 1045endif 1046endif 1047SHA1OBJS += ../src/crypto/sha1-prf.o 1048ifdef CONFIG_INTERNAL_SHA1 1049SHA1OBJS += ../src/crypto/sha1-internal.o 1050ifdef NEED_FIPS186_2_PRF 1051SHA1OBJS += ../src/crypto/fips_prf_internal.o 1052endif 1053endif 1054ifneq ($(CONFIG_TLS), openssl) 1055ifneq ($(CONFIG_TLS), wolfssl) 1056SHA1OBJS += ../src/crypto/sha1-pbkdf2.o 1057endif 1058endif 1059ifdef NEED_T_PRF 1060SHA1OBJS += ../src/crypto/sha1-tprf.o 1061endif 1062ifdef NEED_TLS_PRF 1063SHA1OBJS += ../src/crypto/sha1-tlsprf.o 1064endif 1065endif 1066 1067ifdef NEED_SHA1 1068OBJS += $(SHA1OBJS) 1069endif 1070 1071ifneq ($(CONFIG_TLS), openssl) 1072ifneq ($(CONFIG_TLS), linux) 1073ifneq ($(CONFIG_TLS), gnutls) 1074ifneq ($(CONFIG_TLS), wolfssl) 1075OBJS += ../src/crypto/md5.o 1076endif 1077endif 1078endif 1079endif 1080 1081ifdef NEED_MD5 1082ifdef CONFIG_INTERNAL_MD5 1083OBJS += ../src/crypto/md5-internal.o 1084HOBJS += ../src/crypto/md5-internal.o 1085endif 1086endif 1087 1088ifdef NEED_MD4 1089ifdef CONFIG_INTERNAL_MD4 1090OBJS += ../src/crypto/md4-internal.o 1091endif 1092endif 1093 1094ifdef NEED_DES 1095CFLAGS += -DCONFIG_DES 1096ifdef CONFIG_INTERNAL_DES 1097OBJS += ../src/crypto/des-internal.o 1098endif 1099endif 1100 1101ifdef CONFIG_NO_RC4 1102CFLAGS += -DCONFIG_NO_RC4 1103endif 1104 1105ifdef NEED_RC4 1106ifdef CONFIG_INTERNAL_RC4 1107ifndef CONFIG_NO_RC4 1108OBJS += ../src/crypto/rc4.o 1109endif 1110endif 1111endif 1112 1113CFLAGS += -DCONFIG_SHA256 1114ifneq ($(CONFIG_TLS), openssl) 1115ifneq ($(CONFIG_TLS), linux) 1116ifneq ($(CONFIG_TLS), gnutls) 1117ifneq ($(CONFIG_TLS), wolfssl) 1118OBJS += ../src/crypto/sha256.o 1119endif 1120endif 1121endif 1122endif 1123OBJS += ../src/crypto/sha256-prf.o 1124ifdef CONFIG_INTERNAL_SHA256 1125OBJS += ../src/crypto/sha256-internal.o 1126endif 1127ifdef NEED_TLS_PRF_SHA256 1128OBJS += ../src/crypto/sha256-tlsprf.o 1129endif 1130ifdef NEED_TLS_PRF_SHA384 1131OBJS += ../src/crypto/sha384-tlsprf.o 1132endif 1133ifdef NEED_HMAC_SHA256_KDF 1134OBJS += ../src/crypto/sha256-kdf.o 1135endif 1136ifdef NEED_HMAC_SHA384_KDF 1137OBJS += ../src/crypto/sha384-kdf.o 1138endif 1139ifdef NEED_HMAC_SHA512_KDF 1140OBJS += ../src/crypto/sha512-kdf.o 1141endif 1142ifdef NEED_SHA384 1143CFLAGS += -DCONFIG_SHA384 1144ifneq ($(CONFIG_TLS), openssl) 1145ifneq ($(CONFIG_TLS), linux) 1146ifneq ($(CONFIG_TLS), gnutls) 1147ifneq ($(CONFIG_TLS), wolfssl) 1148OBJS += ../src/crypto/sha384.o 1149endif 1150endif 1151endif 1152endif 1153OBJS += ../src/crypto/sha384-prf.o 1154endif 1155ifdef NEED_SHA512 1156CFLAGS += -DCONFIG_SHA512 1157ifneq ($(CONFIG_TLS), openssl) 1158ifneq ($(CONFIG_TLS), linux) 1159ifneq ($(CONFIG_TLS), gnutls) 1160ifneq ($(CONFIG_TLS), wolfssl) 1161OBJS += ../src/crypto/sha512.o 1162endif 1163endif 1164endif 1165endif 1166OBJS += ../src/crypto/sha512-prf.o 1167endif 1168 1169ifdef CONFIG_INTERNAL_SHA384 1170CFLAGS += -DCONFIG_INTERNAL_SHA384 1171OBJS += ../src/crypto/sha384-internal.o 1172endif 1173 1174ifdef CONFIG_INTERNAL_SHA512 1175CFLAGS += -DCONFIG_INTERNAL_SHA512 1176OBJS += ../src/crypto/sha512-internal.o 1177endif 1178 1179ifdef NEED_ASN1 1180OBJS += ../src/tls/asn1.o 1181endif 1182 1183ifdef NEED_DH_GROUPS 1184OBJS += ../src/crypto/dh_groups.o 1185endif 1186ifdef NEED_DH_GROUPS_ALL 1187CFLAGS += -DALL_DH_GROUPS 1188endif 1189ifdef CONFIG_INTERNAL_DH_GROUP5 1190ifdef NEED_DH_GROUPS 1191OBJS += ../src/crypto/dh_group5.o 1192endif 1193endif 1194 1195ifdef NEED_ECC 1196CFLAGS += -DCONFIG_ECC 1197endif 1198 1199ifdef CONFIG_NO_RANDOM_POOL 1200CFLAGS += -DCONFIG_NO_RANDOM_POOL 1201else 1202ifdef CONFIG_GETRANDOM 1203CFLAGS += -DCONFIG_GETRANDOM 1204endif 1205OBJS += ../src/crypto/random.o 1206HOBJS += ../src/crypto/random.o 1207HOBJS += ../src/utils/eloop.o 1208HOBJS += $(SHA1OBJS) 1209ifneq ($(CONFIG_TLS), openssl) 1210ifneq ($(CONFIG_TLS), linux) 1211ifneq ($(CONFIG_TLS), wolfssl) 1212HOBJS += ../src/crypto/md5.o 1213endif 1214endif 1215endif 1216endif 1217 1218ifdef CONFIG_RADIUS_SERVER 1219CFLAGS += -DRADIUS_SERVER 1220OBJS += ../src/radius/radius_server.o 1221endif 1222 1223ifdef CONFIG_IPV6 1224CFLAGS += -DCONFIG_IPV6 1225endif 1226 1227ifdef CONFIG_DRIVER_RADIUS_ACL 1228CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL 1229endif 1230 1231ifdef NEED_BASE64 1232OBJS += ../src/utils/base64.o 1233endif 1234 1235ifdef NEED_JSON 1236OBJS += ../src/utils/json.o 1237CFLAGS += -DCONFIG_JSON 1238endif 1239 1240ifdef NEED_AP_MLME 1241OBJS += ../src/ap/wmm.o 1242OBJS += ../src/ap/ap_list.o 1243OBJS += ../src/ap/ieee802_11.o 1244OBJS += ../src/ap/hw_features.o 1245OBJS += ../src/ap/dfs.o 1246CFLAGS += -DNEED_AP_MLME 1247endif 1248OBJS += ../src/ap/ieee802_11_ht.o 1249 1250ifdef CONFIG_IEEE80211AC 1251OBJS += ../src/ap/ieee802_11_vht.o 1252endif 1253 1254ifdef CONFIG_P2P_MANAGER 1255CFLAGS += -DCONFIG_P2P_MANAGER 1256OBJS += ../src/ap/p2p_hostapd.o 1257endif 1258 1259ifdef CONFIG_HS20 1260CFLAGS += -DCONFIG_HS20 1261OBJS += ../src/ap/hs20.o 1262CONFIG_INTERWORKING=y 1263endif 1264 1265ifdef CONFIG_INTERWORKING 1266CFLAGS += -DCONFIG_INTERWORKING 1267NEED_GAS=y 1268endif 1269 1270ifdef NEED_GAS 1271OBJS += ../src/common/gas.o 1272OBJS += ../src/ap/gas_serv.o 1273endif 1274 1275ifdef CONFIG_PROXYARP 1276CFLAGS += -DCONFIG_PROXYARP 1277OBJS += ../src/ap/x_snoop.o 1278OBJS += ../src/ap/dhcp_snoop.o 1279ifdef CONFIG_IPV6 1280OBJS += ../src/ap/ndisc_snoop.o 1281endif 1282endif 1283 1284OBJS += ../src/drivers/driver_common.o 1285 1286ifdef CONFIG_WPA_CLI_EDIT 1287OBJS_c += ../src/utils/edit.o 1288else 1289OBJS_c += ../src/utils/edit_simple.o 1290endif 1291 1292ifdef CONFIG_ACS 1293CFLAGS += -DCONFIG_ACS 1294OBJS += ../src/ap/acs.o 1295LIBS += -lm 1296endif 1297 1298#ifdef CONFIG_NO_STDOUT_DEBUG 1299ifneq ($(DEBUG), 1) 1300CFLAGS += -DCONFIG_WPA_NO_LOG 1301CFLAGS += -DCONFIG_NO_STDOUT_DEBUG 1302endif 1303 1304ifdef CONFIG_DEBUG_SYSLOG 1305CFLAGS += -DCONFIG_DEBUG_SYSLOG 1306endif 1307 1308ifdef CONFIG_DEBUG_LINUX_TRACING 1309CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING 1310endif 1311 1312ifdef CONFIG_DEBUG_FILE 1313CFLAGS += -DCONFIG_DEBUG_FILE 1314endif 1315 1316ifdef CONFIG_SQLITE 1317CFLAGS += -DCONFIG_SQLITE 1318LIBS += -lsqlite3 1319LIBS_h += -lsqlite3 1320endif 1321 1322ifdef CONFIG_FST 1323CFLAGS += -DCONFIG_FST 1324OBJS += ../src/fst/fst.o 1325OBJS += ../src/fst/fst_group.o 1326OBJS += ../src/fst/fst_iface.o 1327OBJS += ../src/fst/fst_session.o 1328OBJS += ../src/fst/fst_ctrl_aux.o 1329ifdef CONFIG_FST_TEST 1330CFLAGS += -DCONFIG_FST_TEST 1331endif 1332ifndef CONFIG_NO_CTRL_IFACE 1333OBJS += ../src/fst/fst_ctrl_iface.o 1334endif 1335endif 1336 1337ifdef CONFIG_WEP 1338CFLAGS += -DCONFIG_WEP 1339COPY_OBJS = copy_objs 1340ALL=$(COPY_OBJS) hostapd_cli 1341 1342all: verify_config $(ALL) 1343 1344Q=@ 1345E=echo 1346ifeq ($(V), 1) 1347Q= 1348E=true 1349endif 1350 1351ifdef CONFIG_NO_TKIP 1352CFLAGS += -DCONFIG_NO_TKIP 1353endif 1354 1355$(DESTDIR)$(BINDIR)/%: % 1356 install -D $(<) $(@) 1357 1358install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL)) 1359 1360_OBJS_VAR := OBJS 1361include ../src/objs.mk 1362 1363hostapd: $(OBJS) 1364 $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) 1365 @$(E) " LD " $@ 1366BCHECK=../src/drivers/build.hostapd 1367 1368$(COPY_OBJS): $(OBJS) 1369 cp $(OBJS) ../build/objs > /dev/null 2>&1 1370 1371#hostapd: $(BCHECK) $(OBJS) 1372# $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) 1373# @$(E) " LD " $@ 1374 1375ifdef CONFIG_WPA_TRACE 1376OBJS_c += ../src/utils/trace.o 1377endif 1378 1379_OBJS_VAR := OBJS_c 1380include ../src/objs.mk 1381 1382hostapd_cli: $(OBJS_c) 1383 $(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c) 1384 @$(E) " LD " $@ 1385 1386NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) 1387NOBJS += ../src/utils/common.o 1388ifdef NEED_RC4 1389ifdef CONFIG_INTERNAL_RC4 1390ifndef CONFIG_NO_RC4 1391NOBJS += ../src/crypto/rc4.o 1392endif 1393endif 1394endif 1395ifdef CONFIG_INTERNAL_MD5 1396NOBJS += ../src/crypto/md5-internal.o 1397endif 1398NOBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o 1399NOBJS += ../src/utils/os_$(CONFIG_OS).o 1400NOBJS += ../src/utils/wpa_debug.o 1401NOBJS += ../src/utils/wpabuf.o 1402ifdef CONFIG_WPA_TRACE 1403NOBJS += ../src/utils/trace.o 1404endif 1405 1406HOBJS += 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 1407HOBJS += ../src/crypto/aes-encblock.o 1408ifdef CONFIG_INTERNAL_AES 1409HOBJS += ../src/crypto/aes-internal.o 1410HOBJS += ../src/crypto/aes-internal-enc.o 1411endif 1412ifeq ($(CONFIG_TLS), linux) 1413HOBJS += ../src/crypto/crypto_linux.o 1414endif 1415 1416SOBJS += sae_pk_gen.o 1417SOBJS += ../src/utils/common.o 1418SOBJS += ../src/utils/os_$(CONFIG_OS).o 1419SOBJS += ../src/utils/base64.o 1420SOBJS += ../src/utils/wpa_debug.o 1421SOBJS += ../src/utils/wpabuf.o 1422ifdef CONFIG_WPA_TRACE 1423SOBJS += ../src/utils/trace.o 1424endif 1425SOBJS += ../src/common/ieee802_11_common.o 1426SOBJS += ../src/common/sae.o 1427SOBJS += ../src/common/sae_pk.o 1428SOBJS += ../src/common/dragonfly.o 1429SOBJS += $(AESOBJS) 1430SOBJS += ../src/crypto/sha256-prf.o 1431SOBJS += ../src/crypto/sha384-prf.o 1432SOBJS += ../src/crypto/sha512-prf.o 1433SOBJS += ../src/crypto/dh_groups.o 1434SOBJS += ../src/crypto/sha256-kdf.o 1435SOBJS += ../src/crypto/sha384-kdf.o 1436SOBJS += ../src/crypto/sha512-kdf.o 1437 1438_OBJS_VAR := NOBJS 1439include ../src/objs.mk 1440_OBJS_VAR := HOBJS 1441include ../src/objs.mk 1442_OBJS_VAR := SOBJS 1443include ../src/objs.mk 1444 1445nt_password_hash: $(NOBJS) 1446 $(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n) 1447 @$(E) " LD " $@ 1448 1449hlr_auc_gw: $(HOBJS) 1450 $(Q)$(CC) $(LDFLAGS) -o hlr_auc_gw $(HOBJS) $(LIBS_h) 1451 @$(E) " LD " $@ 1452 1453sae_pk_gen: $(SOBJS) 1454 $(Q)$(CC) $(LDFLAGS) -o sae_pk_gen $(SOBJS) $(LIBS_s) 1455 @$(E) " LD " $@ 1456 1457.PHONY: lcov-html 1458lcov-html: 1459 lcov -c -d $(BUILDDIR) > lcov.info 1460 genhtml lcov.info --output-directory lcov-html 1461 1462clean: common-clean 1463 rm -f core *~ nt_password_hash hlr_auc_gw 1464 rm -f sae_pk_gen 1465 rm -f lcov.info 1466 rm -rf lcov-html 1467