1ifeq ($(KERNEL_TYPE), linux) 2CC=arm-himix410-linux-gcc 3LD=arm-himix410-linux-ld 4else 5CC=../../../../prebuilts/gcc/linux-x86/arm/arm-linux-ohoseabi-gcc/bin/arm-linux-ohoseabi-gcc 6endif 7 8ifndef CFLAGS 9ifeq ($(LIB_TYPE),$(KERNEL_TYPE), 1,linux) 10CFLAGS = -fvisibility=hidden -MMD -O2 -g -w -fsigned-char 11else ifeq ($(LIB_TYPE), 1) 12CFLAGS = -fvisibility=hidden -flto -MMD -O2 -g -w -fsigned-char 13else 14CFLAGS = -MMD -O2 -g -w -fsigned-char 15endif 16endif 17 18ifeq ($(MAKECMDGOALS), libwpa_client.so) 19ifeq ($(LIB_TYPE),$(KERNEL_TYPE), 1,linux) 20CFLAGS = -MMD -O2 -g -w -fsigned-char 21else ifeq ($(LIB_TYPE), 1) 22CFLAGS = -flto -MMD -O2 -g -w -fsigned-char 23endif 24endif 25 26ifeq ($(MAKECMDGOALS), libwpa_client.a) 27CFLAGS = -MMD -O2 -g -w -fsigned-char 28endif 29 30ifdef LIBS 31# If LIBS is set with some global build system defaults, clone those for 32# LIBS_c and LIBS_p to cover wpa_passphrase and wpa_cli as well. 33ifndef LIBS_c 34LIBS_c := $(LIBS) 35endif 36ifndef LIBS_p 37LIBS_p := $(LIBS) 38endif 39endif 40 41export LIBDIR ?= /usr/local/lib/ 42export INCDIR ?= /usr/local/include/ 43export BINDIR ?= /usr/local/sbin/ 44PKG_CONFIG ?= pkg-config 45 46CFLAGS += $(EXTRA_CFLAGS) 47CFLAGS += -I$(abspath ../src) 48CFLAGS += -I$(abspath ../src/utils) 49CFLAGS += -I$(abspath ../src/drivers) 50CFLAGS += -I$(abspath ./) 51CFLAGS += -I$(abspath ../os_dep/include) 52CFLAGS += -I$(abspath ../../../../drivers/framework/include) 53CFLAGS += -I$(abspath ../../../../drivers/framework/include/utils) 54CFLAGS += -I$(abspath ../../../../drivers/framework/utils/include) 55CFLAGS += -I$(abspath ../../../../drivers/framework/include/osal) 56CFLAGS += -I$(abspath ../../../../drivers/framework/ability/sbuf/include) 57CFLAGS += -I$(abspath ../../../../drivers/framework/core/shared/include) 58CFLAGS += -I$(abspath ../../../../drivers/framework/include/core) 59CFLAGS += -I$(abspath ../../../../drivers/framework/core/adapter/syscall/include) 60CFLAGS += -I$(abspath ../../../../third_party/bounds_checking_function/include) 61CFLAGS += -I$(abspath ../../../../drivers/peripheral/wlan/client/include) 62CFLAGS += -I$(abspath ../build/include) 63CFLAGS += -shared -fPIC 64CFLAGS += -DUSERSPACE_CLIENT_SUPPORT 65CFLAGS += -fstack-protector-all 66LIBS += -L$(DEPDIR) -lsec_shared -lhilog_shared -lwifi_driver_client.z 67-include .config 68 69ifeq ($(COMPILER_TYPE), clang) 70SYSROOT_PATH ?= ../../../../sysroot 71ARCH_CFLAGS ?= --target=arm-liteos-ohos -march=armv7-a -mfloat-abi=softfp 72CC := $(COMPILER_DIR)/bin/clang 73CFLAGS += --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS) 74LDFLAGS += --sysroot=$(SYSROOT_PATH) $(ARCH_CFLAGS) 75LDFLAGS += -lc 76endif 77 78ifndef CONFIG_NO_GITVER 79# Add VERSION_STR postfix for builds from a git repository 80ifeq ($(wildcard ../.git),../.git) 81GITVER := $(shell git describe --dirty=+) 82ifneq ($(GITVER),) 83CFLAGS += -DGIT_VERSION_STR_POSTFIX=\"-$(GITVER)\" 84endif 85endif 86endif 87 88ifdef CONFIG_TESTING_OPTIONS 89CFLAGS += -DCONFIG_TESTING_OPTIONS 90CONFIG_WPS_TESTING=y 91CONFIG_TDLS_TESTING=y 92endif 93 94COPY_OBJS = copy_objs 95BINALL=$(COPY_OBJS) wpa_cli 96 97ifndef CONFIG_NO_WPA_PASSPHRASE 98BINALL += wpa_passphrase 99endif 100 101ALL = $(BINALL) 102ALL += systemd/wpa_supplicant.service 103ALL += systemd/wpa_supplicant@.service 104ALL += systemd/wpa_supplicant-nl80211@.service 105ALL += systemd/wpa_supplicant-wired@.service 106ALL += dbus/fi.w1.wpa_supplicant1.service 107ifdef CONFIG_BUILD_WPA_CLIENT_SO 108ALL += libwpa_client.so 109endif 110 111 112all: verify_config $(ALL) dynamic_eap_methods 113 114verify_config: 115 @if [ ! -r .config ]; then \ 116 echo 'Building wpa_supplicant requires a configuration file'; \ 117 echo '(.config). See README for more instructions. You can'; \ 118 echo 'run "cp defconfig .config" to create an example'; \ 119 echo 'configuration.'; \ 120 exit 1; \ 121 fi 122 123mkconfig: 124 @if [ -f .config ]; then \ 125 echo '.config exists - did not replace it'; \ 126 exit 1; \ 127 fi 128 echo CONFIG_DRIVER_HOSTAP=y >> .config 129 echo CONFIG_DRIVER_WEXT=y >> .config 130 131$(DESTDIR)$(BINDIR)/%: % 132 install -D $(<) $(@) 133 134install: $(addprefix $(DESTDIR)$(BINDIR)/,$(BINALL)) 135 $(MAKE) -C ../src install 136ifdef CONFIG_BUILD_WPA_CLIENT_SO 137 install -m 0644 -D libwpa_client.so $(DESTDIR)/$(LIBDIR)/libwpa_client.so 138 install -m 0644 -D ../src/common/wpa_ctrl.h $(DESTDIR)/$(INCDIR)/wpa_ctrl.h 139endif 140 141ifdef CONFIG_FIPS 142CONFIG_NO_RANDOM_POOL= 143CONFIG_OPENSSL_CMAC=y 144endif 145 146OBJS = config.o 147OBJS += notify.o 148OBJS += bss.o 149OBJS += eap_register.o 150OBJS += ../src/utils/common.o 151OBJS += ../src/utils/wpa_debug.o 152OBJS += ../src/utils/wpabuf.o 153OBJS += ../src/utils/bitfield.o 154OBJS += op_classes.o 155OBJS += rrm.o 156OBJS_p = wpa_passphrase.o 157OBJS_p += ../src/utils/common.o 158OBJS_p += ../src/utils/wpa_debug.o 159OBJS_p += ../src/utils/wpabuf.o 160OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o 161OBJS_c += ../src/utils/wpa_debug.o 162OBJS_c += ../src/utils/common.o 163OBJS_c += ../src/common/cli.o 164OBJS += wmm_ac.o 165 166ifndef CONFIG_OS 167ifdef CONFIG_NATIVE_WINDOWS 168CONFIG_OS=win32 169else 170CONFIG_OS=unix 171endif 172endif 173 174ifeq ($(CONFIG_OS), internal) 175CFLAGS += -DOS_NO_C_LIB_DEFINES 176endif 177 178OBJS += ../src/utils/os_$(CONFIG_OS).o 179OBJS_p += ../src/utils/os_$(CONFIG_OS).o 180OBJS_c += ../src/utils/os_$(CONFIG_OS).o 181 182ifdef CONFIG_WPA_TRACE 183CFLAGS += -DWPA_TRACE 184OBJS += ../src/utils/trace.o 185OBJS_p += ../src/utils/trace.o 186OBJS_c += ../src/utils/trace.o 187OBJS_priv += ../src/utils/trace.o 188LIBCTRL += ../src/utils/trace.o 189ifeq ($(LIB_TYPE), 0) 190OBJS += ../src/utils/trace.o 191endif 192LIBCTRLSO += ../src/utils/trace.c 193LDFLAGS += -rdynamic 194CFLAGS += -funwind-tables 195ifdef CONFIG_WPA_TRACE_BFD 196CFLAGS += -DPACKAGE="wpa_supplicant" -DWPA_TRACE_BFD 197LIBS += -lbfd -ldl -liberty -lz 198LIBS_p += -lbfd -ldl -liberty -lz 199LIBS_c += -lbfd -ldl -liberty -lz 200endif 201endif 202 203ifndef CONFIG_ELOOP 204CONFIG_ELOOP=eloop 205endif 206OBJS += ../src/utils/$(CONFIG_ELOOP).o 207OBJS_c += ../src/utils/$(CONFIG_ELOOP).o 208 209ifndef CONFIG_OSX 210ifeq ($(CONFIG_ELOOP), eloop) 211# Using glibc < 2.17 requires -lrt for clock_gettime() 212# OS X has an alternate implementation 213LIBS += -lrt 214LIBS_c += -lrt 215LIBS_p += -lrt 216endif 217endif 218 219ifdef CONFIG_ELOOP_POLL 220CFLAGS += -DCONFIG_ELOOP_POLL 221endif 222 223ifdef CONFIG_ELOOP_EPOLL 224CFLAGS += -DCONFIG_ELOOP_EPOLL 225endif 226 227ifdef CONFIG_ELOOP_KQUEUE 228CFLAGS += -DCONFIG_ELOOP_KQUEUE 229endif 230 231ifdef CONFIG_EAPOL_TEST 232CFLAGS += -Werror -DEAPOL_TEST 233endif 234 235ifdef CONFIG_CODE_COVERAGE 236CFLAGS += -O0 -fprofile-arcs -ftest-coverage 237LIBS += -lgcov 238LIBS_c += -lgcov 239LIBS_p += -lgcov 240endif 241 242ifdef CONFIG_HT_OVERRIDES 243CFLAGS += -DCONFIG_HT_OVERRIDES 244endif 245 246ifdef CONFIG_VHT_OVERRIDES 247CFLAGS += -DCONFIG_VHT_OVERRIDES 248endif 249 250ifndef CONFIG_BACKEND 251CONFIG_BACKEND=file 252endif 253 254ifeq ($(CONFIG_BACKEND), file) 255OBJS += config_file.o 256ifndef CONFIG_NO_CONFIG_BLOBS 257NEED_BASE64=y 258endif 259CFLAGS += -DCONFIG_BACKEND_FILE 260endif 261 262ifeq ($(CONFIG_BACKEND), winreg) 263OBJS += config_winreg.o 264endif 265 266ifeq ($(CONFIG_BACKEND), none) 267OBJS += config_none.o 268endif 269 270ifdef CONFIG_NO_CONFIG_WRITE 271CFLAGS += -DCONFIG_NO_CONFIG_WRITE 272endif 273 274ifdef CONFIG_NO_CONFIG_BLOBS 275CFLAGS += -DCONFIG_NO_CONFIG_BLOBS 276endif 277 278ifdef CONFIG_NO_SCAN_PROCESSING 279CFLAGS += -DCONFIG_NO_SCAN_PROCESSING 280endif 281 282ifdef CONFIG_SUITEB 283CFLAGS += -DCONFIG_SUITEB 284NEED_SHA256=y 285NEED_AES_OMAC1=y 286endif 287 288ifdef CONFIG_SUITEB192 289CFLAGS += -DCONFIG_SUITEB192 290NEED_SHA384=y 291endif 292 293ifdef CONFIG_OCV 294CFLAGS += -DCONFIG_OCV 295OBJS += ../src/common/ocv.o 296CONFIG_IEEE80211W=y 297endif 298 299ifdef CONFIG_IEEE80211W 300CFLAGS += -DCONFIG_IEEE80211W 301NEED_SHA256=y 302NEED_AES_OMAC1=y 303endif 304 305ifdef CONFIG_IEEE80211R 306CFLAGS += -DCONFIG_IEEE80211R 307OBJS += ../src/rsn_supp/wpa_ft.o 308NEED_SHA256=y 309NEED_AES_OMAC1=y 310endif 311 312ifdef CONFIG_MESH 313NEED_80211_COMMON=y 314NEED_SHA256=y 315NEED_AES_SIV=y 316CONFIG_SAE=y 317CONFIG_AP=y 318CFLAGS += -DCONFIG_MESH 319OBJS += mesh.o 320OBJS += mesh_mpm.o 321OBJS += mesh_rsn.o 322endif 323 324ifdef CONFIG_SAE 325CFLAGS += -DCONFIG_SAE 326OBJS += ../src/common/sae.o 327NEED_ECC=y 328NEED_DH_GROUPS=y 329NEED_DRAGONFLY=y 330endif 331 332ifdef CONFIG_DPP 333CFLAGS += -DCONFIG_DPP 334OBJS += ../src/common/dpp.o 335OBJS += dpp_supplicant.o 336NEED_AES_SIV=y 337NEED_HMAC_SHA256_KDF=y 338NEED_HMAC_SHA384_KDF=y 339NEED_HMAC_SHA512_KDF=y 340NEED_SHA256=y 341NEED_SHA384=y 342NEED_SHA512=y 343NEED_JSON=y 344NEED_GAS_SERVER=y 345NEED_BASE64=y 346ifdef CONFIG_DPP2 347CFLAGS += -DCONFIG_DPP2 348endif 349endif 350 351ifdef CONFIG_OWE 352CFLAGS += -DCONFIG_OWE 353NEED_ECC=y 354NEED_HMAC_SHA256_KDF=y 355NEED_HMAC_SHA384_KDF=y 356NEED_HMAC_SHA512_KDF=y 357NEED_SHA256=y 358NEED_SHA384=y 359NEED_SHA512=y 360endif 361 362ifdef CONFIG_FILS 363CFLAGS += -DCONFIG_FILS 364NEED_SHA384=y 365NEED_AES_SIV=y 366ifdef CONFIG_FILS_SK_PFS 367CFLAGS += -DCONFIG_FILS_SK_PFS 368NEED_ECC=y 369endif 370endif 371 372ifdef CONFIG_MBO 373CONFIG_WNM=y 374endif 375 376ifdef CONFIG_WNM 377CFLAGS += -DCONFIG_WNM 378OBJS += wnm_sta.o 379endif 380 381ifdef CONFIG_TDLS 382CFLAGS += -DCONFIG_TDLS 383OBJS += ../src/rsn_supp/tdls.o 384NEED_SHA256=y 385NEED_AES_OMAC1=y 386endif 387 388ifdef CONFIG_TDLS_TESTING 389CFLAGS += -DCONFIG_TDLS_TESTING 390endif 391 392ifdef CONFIG_PMKSA_CACHE_EXTERNAL 393CFLAGS += -DCONFIG_PMKSA_CACHE_EXTERNAL 394endif 395 396ifndef CONFIG_NO_WPA 397OBJS += ../src/rsn_supp/wpa.o 398OBJS += ../src/rsn_supp/preauth.o 399OBJS += ../src/rsn_supp/pmksa_cache.o 400OBJS += ../src/rsn_supp/wpa_ie.o 401OBJS += ../src/common/wpa_common.o 402NEED_AES=y 403NEED_SHA1=y 404NEED_MD5=y 405NEED_RC4=y 406else 407CFLAGS += -DCONFIG_NO_WPA 408ifeq ($(CONFIG_TLS), internal) 409NEED_SHA1=y 410NEED_MD5=y 411endif 412endif 413 414ifdef CONFIG_IBSS_RSN 415NEED_RSN_AUTHENTICATOR=y 416CFLAGS += -DCONFIG_IBSS_RSN 417CFLAGS += -DCONFIG_NO_VLAN 418OBJS += ibss_rsn.o 419endif 420 421ifdef CONFIG_MATCH_IFACE 422CFLAGS += -DCONFIG_MATCH_IFACE 423endif 424 425ifdef CONFIG_P2P 426OBJS += p2p_supplicant.o 427OBJS += p2p_supplicant_sd.o 428OBJS += ../src/p2p/p2p.o 429OBJS += ../src/p2p/p2p_utils.o 430OBJS += ../src/p2p/p2p_parse.o 431OBJS += ../src/p2p/p2p_build.o 432OBJS += ../src/p2p/p2p_go_neg.o 433OBJS += ../src/p2p/p2p_sd.o 434OBJS += ../src/p2p/p2p_pd.o 435OBJS += ../src/p2p/p2p_invitation.o 436OBJS += ../src/p2p/p2p_dev_disc.o 437OBJS += ../src/p2p/p2p_group.o 438OBJS += ../src/ap/p2p_hostapd.o 439CFLAGS += -DCONFIG_P2P 440NEED_GAS=y 441NEED_OFFCHANNEL=y 442CONFIG_WPS=y 443CONFIG_AP=y 444ifdef CONFIG_P2P_STRICT 445CFLAGS += -DCONFIG_P2P_STRICT 446endif 447endif 448 449ifdef CONFIG_WIFI_DISPLAY 450CFLAGS += -DCONFIG_WIFI_DISPLAY 451OBJS += wifi_display.o 452endif 453 454ifdef CONFIG_HS20 455OBJS += hs20_supplicant.o 456CFLAGS += -DCONFIG_HS20 457CONFIG_INTERWORKING=y 458NEED_AES_OMAC1=y 459endif 460 461ifdef CONFIG_INTERWORKING 462OBJS += interworking.o 463CFLAGS += -DCONFIG_INTERWORKING 464NEED_GAS=y 465endif 466 467ifdef CONFIG_NO_ROAMING 468CFLAGS += -DCONFIG_NO_ROAMING 469endif 470 471include ../src/drivers/drivers.mak 472ifdef CONFIG_AP 473OBJS_d += $(DRV_BOTH_OBJS) 474CFLAGS += $(DRV_BOTH_CFLAGS) 475LDFLAGS += $(DRV_BOTH_LDFLAGS) 476LIBS += $(DRV_BOTH_LIBS) 477else 478NEED_AP_MLME= 479OBJS_d += $(DRV_WPA_OBJS) 480CFLAGS += $(DRV_WPA_CFLAGS) 481LDFLAGS += $(DRV_WPA_LDFLAGS) 482LIBS += $(DRV_WPA_LIBS) 483endif 484 485ifndef CONFIG_L2_PACKET 486CONFIG_L2_PACKET=linux 487endif 488 489OBJS_l2 += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o 490 491ifeq ($(CONFIG_L2_PACKET), pcap) 492ifdef CONFIG_WINPCAP 493CFLAGS += -DCONFIG_WINPCAP 494LIBS += -lwpcap -lpacket 495LIBS_w += -lwpcap 496else 497LIBS += -ldnet -lpcap 498endif 499endif 500 501ifeq ($(CONFIG_L2_PACKET), winpcap) 502LIBS += -lwpcap -lpacket 503LIBS_w += -lwpcap 504endif 505 506ifeq ($(CONFIG_L2_PACKET), freebsd) 507LIBS += -lpcap 508endif 509 510ifdef CONFIG_ERP 511CFLAGS += -DCONFIG_ERP 512NEED_SHA256=y 513NEED_HMAC_SHA256_KDF=y 514endif 515 516ifdef CONFIG_EAP_TLS 517# EAP-TLS 518ifeq ($(CONFIG_EAP_TLS), dyn) 519CFLAGS += -DEAP_TLS_DYNAMIC 520EAPDYN += ../src/eap_peer/eap_tls.so 521else 522CFLAGS += -DEAP_TLS 523OBJS += ../src/eap_peer/eap_tls.o 524endif 525TLS_FUNCS=y 526CONFIG_IEEE8021X_EAPOL=y 527endif 528 529ifdef CONFIG_EAP_UNAUTH_TLS 530# EAP-UNAUTH-TLS 531CFLAGS += -DEAP_UNAUTH_TLS 532ifndef CONFIG_EAP_TLS 533OBJS += ../src/eap_peer/eap_tls.o 534TLS_FUNCS=y 535endif 536CONFIG_IEEE8021X_EAPOL=y 537endif 538 539ifdef CONFIG_EAP_PEAP 540# EAP-PEAP 541ifeq ($(CONFIG_EAP_PEAP), dyn) 542CFLAGS += -DEAP_PEAP_DYNAMIC 543EAPDYN += ../src/eap_peer/eap_peap.so 544else 545CFLAGS += -DEAP_PEAP 546OBJS += ../src/eap_peer/eap_peap.o 547OBJS += ../src/eap_common/eap_peap_common.o 548endif 549TLS_FUNCS=y 550CONFIG_IEEE8021X_EAPOL=y 551endif 552 553ifdef CONFIG_EAP_TTLS 554# EAP-TTLS 555ifeq ($(CONFIG_EAP_TTLS), dyn) 556CFLAGS += -DEAP_TTLS_DYNAMIC 557EAPDYN += ../src/eap_peer/eap_ttls.so 558else 559CFLAGS += -DEAP_TTLS 560OBJS += ../src/eap_peer/eap_ttls.o 561endif 562TLS_FUNCS=y 563ifndef CONFIG_FIPS 564MS_FUNCS=y 565CHAP=y 566endif 567CONFIG_IEEE8021X_EAPOL=y 568endif 569 570ifdef CONFIG_EAP_MD5 571# EAP-MD5 572ifeq ($(CONFIG_EAP_MD5), dyn) 573CFLAGS += -DEAP_MD5_DYNAMIC 574EAPDYN += ../src/eap_peer/eap_md5.so 575else 576CFLAGS += -DEAP_MD5 577OBJS += ../src/eap_peer/eap_md5.o 578endif 579CHAP=y 580CONFIG_IEEE8021X_EAPOL=y 581endif 582 583# backwards compatibility for old spelling 584ifdef CONFIG_MSCHAPV2 585ifndef CONFIG_EAP_MSCHAPV2 586CONFIG_EAP_MSCHAPV2=y 587endif 588endif 589 590ifdef CONFIG_EAP_MSCHAPV2 591# EAP-MSCHAPv2 592ifeq ($(CONFIG_EAP_MSCHAPV2), dyn) 593CFLAGS += -DEAP_MSCHAPv2_DYNAMIC 594EAPDYN += ../src/eap_peer/eap_mschapv2.so 595EAPDYN += ../src/eap_peer/mschapv2.so 596else 597CFLAGS += -DEAP_MSCHAPv2 598OBJS += ../src/eap_peer/eap_mschapv2.o 599OBJS += ../src/eap_peer/mschapv2.o 600endif 601MS_FUNCS=y 602CONFIG_IEEE8021X_EAPOL=y 603endif 604 605ifdef CONFIG_EAP_GTC 606# EAP-GTC 607ifeq ($(CONFIG_EAP_GTC), dyn) 608CFLAGS += -DEAP_GTC_DYNAMIC 609EAPDYN += ../src/eap_peer/eap_gtc.so 610else 611CFLAGS += -DEAP_GTC 612OBJS += ../src/eap_peer/eap_gtc.o 613endif 614CONFIG_IEEE8021X_EAPOL=y 615endif 616 617ifdef CONFIG_EAP_OTP 618# EAP-OTP 619ifeq ($(CONFIG_EAP_OTP), dyn) 620CFLAGS += -DEAP_OTP_DYNAMIC 621EAPDYN += ../src/eap_peer/eap_otp.so 622else 623CFLAGS += -DEAP_OTP 624OBJS += ../src/eap_peer/eap_otp.o 625endif 626CONFIG_IEEE8021X_EAPOL=y 627endif 628 629ifdef CONFIG_EAP_SIM 630# EAP-SIM 631ifeq ($(CONFIG_EAP_SIM), dyn) 632CFLAGS += -DEAP_SIM_DYNAMIC 633EAPDYN += ../src/eap_peer/eap_sim.so 634else 635CFLAGS += -DEAP_SIM 636OBJS += ../src/eap_peer/eap_sim.o 637endif 638CONFIG_IEEE8021X_EAPOL=y 639CONFIG_EAP_SIM_COMMON=y 640NEED_AES_CBC=y 641endif 642 643ifdef CONFIG_EAP_LEAP 644# EAP-LEAP 645ifeq ($(CONFIG_EAP_LEAP), dyn) 646CFLAGS += -DEAP_LEAP_DYNAMIC 647EAPDYN += ../src/eap_peer/eap_leap.so 648else 649CFLAGS += -DEAP_LEAP 650OBJS += ../src/eap_peer/eap_leap.o 651endif 652MS_FUNCS=y 653CONFIG_IEEE8021X_EAPOL=y 654endif 655 656ifdef CONFIG_EAP_PSK 657# EAP-PSK 658ifeq ($(CONFIG_EAP_PSK), dyn) 659CFLAGS += -DEAP_PSK_DYNAMIC 660EAPDYN += ../src/eap_peer/eap_psk.so 661else 662CFLAGS += -DEAP_PSK 663OBJS += ../src/eap_peer/eap_psk.o ../src/eap_common/eap_psk_common.o 664endif 665CONFIG_IEEE8021X_EAPOL=y 666NEED_AES=y 667NEED_AES_OMAC1=y 668NEED_AES_ENCBLOCK=y 669NEED_AES_EAX=y 670endif 671 672ifdef CONFIG_EAP_AKA 673# EAP-AKA 674ifeq ($(CONFIG_EAP_AKA), dyn) 675CFLAGS += -DEAP_AKA_DYNAMIC 676EAPDYN += ../src/eap_peer/eap_aka.so 677else 678CFLAGS += -DEAP_AKA 679OBJS += ../src/eap_peer/eap_aka.o 680endif 681CONFIG_IEEE8021X_EAPOL=y 682CONFIG_EAP_SIM_COMMON=y 683NEED_AES_CBC=y 684endif 685 686ifdef CONFIG_EAP_PROXY 687CFLAGS += -DCONFIG_EAP_PROXY 688OBJS += ../src/eap_peer/eap_proxy_$(CONFIG_EAP_PROXY).o 689include eap_proxy_$(CONFIG_EAP_PROXY).mak 690CONFIG_IEEE8021X_EAPOL=y 691endif 692 693ifdef CONFIG_EAP_AKA_PRIME 694# EAP-AKA' 695ifeq ($(CONFIG_EAP_AKA_PRIME), dyn) 696CFLAGS += -DEAP_AKA_PRIME_DYNAMIC 697else 698CFLAGS += -DEAP_AKA_PRIME 699endif 700NEED_SHA256=y 701endif 702 703ifdef CONFIG_EAP_SIM_COMMON 704OBJS += ../src/eap_common/eap_sim_common.o 705NEED_AES=y 706NEED_FIPS186_2_PRF=y 707endif 708 709ifdef CONFIG_EAP_FAST 710# EAP-FAST 711ifeq ($(CONFIG_EAP_FAST), dyn) 712CFLAGS += -DEAP_FAST_DYNAMIC 713EAPDYN += ../src/eap_peer/eap_fast.so 714EAPDYN += ../src/eap_common/eap_fast_common.o 715else 716CFLAGS += -DEAP_FAST 717OBJS += ../src/eap_peer/eap_fast.o ../src/eap_peer/eap_fast_pac.o 718OBJS += ../src/eap_common/eap_fast_common.o 719endif 720TLS_FUNCS=y 721CONFIG_IEEE8021X_EAPOL=y 722NEED_T_PRF=y 723endif 724 725ifdef CONFIG_EAP_TEAP 726# EAP-TEAP 727ifeq ($(CONFIG_EAP_TEAP), dyn) 728CFLAGS += -DEAP_TEAP_DYNAMIC 729EAPDYN += ../src/eap_peer/eap_teap.so 730EAPDYN += ../src/eap_common/eap_teap_common.o 731else 732CFLAGS += -DEAP_TEAP 733OBJS += ../src/eap_peer/eap_teap.o ../src/eap_peer/eap_teap_pac.o 734OBJS += ../src/eap_common/eap_teap_common.o 735endif 736TLS_FUNCS=y 737CONFIG_IEEE8021X_EAPOL=y 738NEED_T_PRF=y 739NEED_SHA384=y 740endif 741 742ifdef CONFIG_EAP_PAX 743# EAP-PAX 744ifeq ($(CONFIG_EAP_PAX), dyn) 745CFLAGS += -DEAP_PAX_DYNAMIC 746EAPDYN += ../src/eap_peer/eap_pax.so 747else 748CFLAGS += -DEAP_PAX 749OBJS += ../src/eap_peer/eap_pax.o ../src/eap_common/eap_pax_common.o 750endif 751CONFIG_IEEE8021X_EAPOL=y 752endif 753 754ifdef CONFIG_EAP_SAKE 755# EAP-SAKE 756ifeq ($(CONFIG_EAP_SAKE), dyn) 757CFLAGS += -DEAP_SAKE_DYNAMIC 758EAPDYN += ../src/eap_peer/eap_sake.so 759else 760CFLAGS += -DEAP_SAKE 761OBJS += ../src/eap_peer/eap_sake.o ../src/eap_common/eap_sake_common.o 762endif 763CONFIG_IEEE8021X_EAPOL=y 764endif 765 766ifdef CONFIG_EAP_GPSK 767# EAP-GPSK 768ifeq ($(CONFIG_EAP_GPSK), dyn) 769CFLAGS += -DEAP_GPSK_DYNAMIC 770EAPDYN += ../src/eap_peer/eap_gpsk.so 771else 772CFLAGS += -DEAP_GPSK 773OBJS += ../src/eap_peer/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o 774endif 775CONFIG_IEEE8021X_EAPOL=y 776ifdef CONFIG_EAP_GPSK_SHA256 777CFLAGS += -DEAP_GPSK_SHA256 778endif 779NEED_SHA256=y 780NEED_AES_OMAC1=y 781endif 782 783ifdef CONFIG_EAP_PWD 784CFLAGS += -DEAP_PWD 785ifeq ($(CONFIG_TLS), wolfssl) 786CFLAGS += -DCONFIG_ECC 787endif 788OBJS += ../src/eap_peer/eap_pwd.o ../src/eap_common/eap_pwd_common.o 789CONFIG_IEEE8021X_EAPOL=y 790NEED_SHA256=y 791NEED_ECC=y 792NEED_DRAGONFLY=y 793endif 794 795ifdef CONFIG_EAP_EKE 796# EAP-EKE 797ifeq ($(CONFIG_EAP_EKE), dyn) 798CFLAGS += -DEAP_EKE_DYNAMIC 799EAPDYN += ../src/eap_peer/eap_eke.so 800else 801CFLAGS += -DEAP_EKE 802OBJS += ../src/eap_peer/eap_eke.o ../src/eap_common/eap_eke_common.o 803endif 804CONFIG_IEEE8021X_EAPOL=y 805NEED_DH_GROUPS=y 806NEED_DH_GROUPS_ALL=y 807NEED_SHA256=y 808NEED_AES_CBC=y 809endif 810 811ifdef CONFIG_WPS 812# EAP-WSC 813CFLAGS += -DCONFIG_WPS -DEAP_WSC 814OBJS += wps_supplicant.o 815OBJS += ../src/utils/uuid.o 816OBJS += ../src/eap_peer/eap_wsc.o ../src/eap_common/eap_wsc_common.o 817OBJS += ../src/wps/wps.o 818OBJS += ../src/wps/wps_common.o 819OBJS += ../src/wps/wps_attr_parse.o 820OBJS += ../src/wps/wps_attr_build.o 821OBJS += ../src/wps/wps_attr_process.o 822OBJS += ../src/wps/wps_dev_attr.o 823OBJS += ../src/wps/wps_enrollee.o 824OBJS += ../src/wps/wps_registrar.o 825CONFIG_IEEE8021X_EAPOL=y 826NEED_DH_GROUPS=y 827NEED_SHA256=y 828NEED_BASE64=y 829NEED_AES_CBC=y 830NEED_MODEXP=y 831 832ifdef CONFIG_WPS_NFC 833CFLAGS += -DCONFIG_WPS_NFC 834OBJS += ../src/wps/ndef.o 835NEED_WPS_OOB=y 836endif 837 838ifdef NEED_WPS_OOB 839CFLAGS += -DCONFIG_WPS_OOB 840endif 841 842ifdef CONFIG_WPS_ER 843CONFIG_WPS_UPNP=y 844CFLAGS += -DCONFIG_WPS_ER 845OBJS += ../src/wps/wps_er.o 846OBJS += ../src/wps/wps_er_ssdp.o 847endif 848 849ifdef CONFIG_WPS_UPNP 850CFLAGS += -DCONFIG_WPS_UPNP 851OBJS += ../src/wps/wps_upnp.o 852OBJS += ../src/wps/wps_upnp_ssdp.o 853OBJS += ../src/wps/wps_upnp_web.o 854OBJS += ../src/wps/wps_upnp_event.o 855OBJS += ../src/wps/wps_upnp_ap.o 856OBJS += ../src/wps/upnp_xml.o 857OBJS += ../src/wps/httpread.o 858OBJS += ../src/wps/http_client.o 859OBJS += ../src/wps/http_server.o 860endif 861 862ifdef CONFIG_WPS_STRICT 863CFLAGS += -DCONFIG_WPS_STRICT 864OBJS += ../src/wps/wps_validate.o 865endif 866 867ifdef CONFIG_WPS_TESTING 868CFLAGS += -DCONFIG_WPS_TESTING 869endif 870 871ifdef CONFIG_WPS_REG_DISABLE_OPEN 872CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN 873endif 874 875endif 876 877ifdef CONFIG_EAP_IKEV2 878# EAP-IKEv2 879ifeq ($(CONFIG_EAP_IKEV2), dyn) 880CFLAGS += -DEAP_IKEV2_DYNAMIC 881EAPDYN += ../src/eap_peer/eap_ikev2.so ../src/eap_peer/ikev2.o 882EAPDYN += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o 883else 884CFLAGS += -DEAP_IKEV2 885OBJS += ../src/eap_peer/eap_ikev2.o ../src/eap_peer/ikev2.o 886OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o 887endif 888CONFIG_IEEE8021X_EAPOL=y 889NEED_DH_GROUPS=y 890NEED_DH_GROUPS_ALL=y 891NEED_MODEXP=y 892NEED_CIPHER=y 893endif 894 895ifdef CONFIG_EAP_VENDOR_TEST 896ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn) 897CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC 898EAPDYN += ../src/eap_peer/eap_vendor_test.so 899else 900CFLAGS += -DEAP_VENDOR_TEST 901OBJS += ../src/eap_peer/eap_vendor_test.o 902endif 903CONFIG_IEEE8021X_EAPOL=y 904endif 905 906ifdef CONFIG_EAP_TNC 907# EAP-TNC 908CFLAGS += -DEAP_TNC 909OBJS += ../src/eap_peer/eap_tnc.o 910OBJS += ../src/eap_peer/tncc.o 911NEED_BASE64=y 912ifndef CONFIG_NATIVE_WINDOWS 913ifndef CONFIG_DRIVER_BSD 914LIBS += -ldl 915endif 916endif 917endif 918 919ifdef CONFIG_MACSEC 920CFLAGS += -DCONFIG_MACSEC 921CONFIG_IEEE8021X_EAPOL=y 922NEED_AES_ENCBLOCK=y 923NEED_AES_UNWRAP=y 924NEED_AES_WRAP=y 925NEED_AES_OMAC1=y 926OBJS += wpas_kay.o 927OBJS += ../src/pae/ieee802_1x_cp.o 928OBJS += ../src/pae/ieee802_1x_kay.o 929OBJS += ../src/pae/ieee802_1x_key.o 930OBJS += ../src/pae/ieee802_1x_secy_ops.o 931ifdef CONFIG_AP 932OBJS += ../src/ap/wpa_auth_kay.o 933endif 934endif 935 936ifdef CONFIG_IEEE8021X_EAPOL 937# IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication) 938CFLAGS += -DIEEE8021X_EAPOL 939OBJS += ../src/eapol_supp/eapol_supp_sm.o 940OBJS += ../src/eap_peer/eap.o ../src/eap_peer/eap_methods.o 941NEED_EAP_COMMON=y 942ifdef CONFIG_DYNAMIC_EAP_METHODS 943CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS 944LIBS += -ldl -rdynamic 945endif 946endif 947 948ifdef CONFIG_AP 949NEED_EAP_COMMON=y 950NEED_RSN_AUTHENTICATOR=y 951CFLAGS += -DCONFIG_AP 952OBJS += ap.o 953CFLAGS += -DCONFIG_NO_RADIUS 954CFLAGS += -DCONFIG_NO_ACCOUNTING 955CFLAGS += -DCONFIG_NO_VLAN 956OBJS += ../src/ap/hostapd.o 957OBJS += ../src/ap/wpa_auth_glue.o 958OBJS += ../src/ap/utils.o 959OBJS += ../src/ap/authsrv.o 960OBJS += ../src/ap/ap_config.o 961OBJS += ../src/utils/ip_addr.o 962OBJS += ../src/ap/sta_info.o 963OBJS += ../src/ap/tkip_countermeasures.o 964OBJS += ../src/ap/ap_mlme.o 965OBJS += ../src/ap/ieee802_1x.o 966OBJS += ../src/eapol_auth/eapol_auth_sm.o 967OBJS += ../src/ap/ieee802_11_auth.o 968OBJS += ../src/ap/ieee802_11_shared.o 969OBJS += ../src/ap/drv_callbacks.o 970OBJS += ../src/ap/ap_drv_ops.o 971OBJS += ../src/ap/beacon.o 972OBJS += ../src/ap/bss_load.o 973OBJS += ../src/ap/eap_user_db.o 974OBJS += ../src/ap/neighbor_db.o 975OBJS += ../src/ap/rrm.o 976ifdef CONFIG_IEEE80211N 977OBJS += ../src/ap/ieee802_11_ht.o 978ifdef CONFIG_IEEE80211AC 979OBJS += ../src/ap/ieee802_11_vht.o 980endif 981ifdef CONFIG_IEEE80211AX 982OBJS += ../src/ap/ieee802_11_he.o 983endif 984endif 985ifdef CONFIG_WNM_AP 986CFLAGS += -DCONFIG_WNM_AP 987OBJS += ../src/ap/wnm_ap.o 988endif 989ifdef CONFIG_MBO 990OBJS += ../src/ap/mbo_ap.o 991endif 992ifdef CONFIG_FILS 993OBJS += ../src/ap/fils_hlp.o 994endif 995ifdef CONFIG_CTRL_IFACE 996OBJS += ../src/ap/ctrl_iface_ap.o 997endif 998 999CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY 1000OBJS += ../src/eap_server/eap_server.o 1001OBJS += ../src/eap_server/eap_server_identity.o 1002OBJS += ../src/eap_server/eap_server_methods.o 1003 1004ifdef CONFIG_IEEE80211N 1005CFLAGS += -DCONFIG_IEEE80211N 1006ifdef CONFIG_IEEE80211AC 1007CFLAGS += -DCONFIG_IEEE80211AC 1008endif 1009ifdef CONFIG_IEEE80211AX 1010CFLAGS += -DCONFIG_IEEE80211AX 1011endif 1012endif 1013 1014ifdef NEED_AP_MLME 1015OBJS += ../src/ap/wmm.o 1016OBJS += ../src/ap/ap_list.o 1017OBJS += ../src/ap/ieee802_11.o 1018OBJS += ../src/ap/hw_features.o 1019OBJS += ../src/ap/dfs.o 1020CFLAGS += -DNEED_AP_MLME 1021endif 1022ifdef CONFIG_WPS 1023CFLAGS += -DEAP_SERVER_WSC 1024OBJS += ../src/ap/wps_hostapd.o 1025OBJS += ../src/eap_server/eap_server_wsc.o 1026endif 1027ifdef CONFIG_DPP 1028OBJS += ../src/ap/dpp_hostapd.o 1029OBJS += ../src/ap/gas_query_ap.o 1030endif 1031ifdef CONFIG_INTERWORKING 1032OBJS += ../src/ap/gas_serv.o 1033endif 1034ifdef CONFIG_HS20 1035OBJS += ../src/ap/hs20.o 1036endif 1037endif 1038 1039ifdef CONFIG_MBO 1040OBJS += mbo.o 1041CFLAGS += -DCONFIG_MBO 1042endif 1043 1044ifdef NEED_RSN_AUTHENTICATOR 1045CFLAGS += -DCONFIG_NO_RADIUS 1046NEED_AES_WRAP=y 1047OBJS += ../src/ap/wpa_auth.o 1048OBJS += ../src/ap/wpa_auth_ie.o 1049OBJS += ../src/ap/pmksa_cache_auth.o 1050endif 1051 1052ifdef CONFIG_ACS 1053CFLAGS += -DCONFIG_ACS 1054OBJS += ../src/ap/acs.o 1055LIBS += -lm 1056endif 1057 1058ifdef CONFIG_PCSC 1059# PC/SC interface for smartcards (USIM, GSM SIM) 1060CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC 1061OBJS += ../src/utils/pcsc_funcs.o 1062# -lpthread may not be needed depending on how pcsc-lite was configured 1063ifdef CONFIG_NATIVE_WINDOWS 1064#Once MinGW gets support for WinScard, -lwinscard could be used instead of the 1065#dynamic symbol loading that is now used in pcsc_funcs.c 1066#LIBS += -lwinscard 1067else 1068ifdef CONFIG_OSX 1069LIBS += -framework PCSC 1070else 1071LIBS += -lpcsclite -lpthread 1072endif 1073endif 1074endif 1075 1076ifdef CONFIG_SIM_SIMULATOR 1077CFLAGS += -DCONFIG_SIM_SIMULATOR 1078NEED_MILENAGE=y 1079endif 1080 1081ifdef CONFIG_USIM_SIMULATOR 1082CFLAGS += -DCONFIG_USIM_SIMULATOR 1083NEED_MILENAGE=y 1084endif 1085 1086ifdef NEED_MILENAGE 1087OBJS += ../src/crypto/milenage.o 1088NEED_AES_ENCBLOCK=y 1089endif 1090 1091ifdef CONFIG_PKCS12 1092CFLAGS += -DPKCS12_FUNCS 1093endif 1094 1095ifdef CONFIG_SMARTCARD 1096CFLAGS += -DCONFIG_SMARTCARD 1097endif 1098 1099ifdef NEED_DRAGONFLY 1100OBJS += ../src/common/dragonfly.o 1101endif 1102 1103ifdef MS_FUNCS 1104OBJS += ../src/crypto/ms_funcs.o 1105NEED_DES=y 1106NEED_MD4=y 1107endif 1108 1109ifdef CHAP 1110OBJS += ../src/eap_common/chap.o 1111endif 1112 1113ifdef TLS_FUNCS 1114NEED_DES=y 1115# Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, EAP_FAST, and 1116# EAP_TEAP) 1117OBJS += ../src/eap_peer/eap_tls_common.o 1118ifndef CONFIG_FIPS 1119NEED_TLS_PRF=y 1120NEED_SHA1=y 1121NEED_MD5=y 1122endif 1123endif 1124 1125ifndef CONFIG_TLS 1126CONFIG_TLS=openssl 1127endif 1128 1129ifdef CONFIG_TLSV11 1130CFLAGS += -DCONFIG_TLSV11 1131endif 1132 1133ifdef CONFIG_TLSV12 1134CFLAGS += -DCONFIG_TLSV12 1135NEED_SHA256=y 1136endif 1137 1138ifeq ($(CONFIG_TLS), wolfssl) 1139ifdef TLS_FUNCS 1140CFLAGS += -DWOLFSSL_DER_LOAD -I/usr/local/include/wolfssl 1141OBJS += ../src/crypto/tls_wolfssl.o 1142endif 1143OBJS += ../src/crypto/crypto_wolfssl.o 1144OBJS_p += ../src/crypto/crypto_wolfssl.o 1145ifdef NEED_FIPS186_2_PRF 1146OBJS += ../src/crypto/fips_prf_wolfssl.o 1147endif 1148NEED_TLS_PRF_SHA256=y 1149LIBS += -lwolfssl -lm 1150LIBS_p += -lwolfssl -lm 1151endif 1152 1153ifeq ($(CONFIG_TLS), openssl) 1154ifdef TLS_FUNCS 1155CFLAGS += -DEAP_TLS_OPENSSL 1156OBJS += ../src/crypto/tls_openssl.o 1157OBJS += ../src/crypto/tls_openssl_ocsp.o 1158LIBS += -lssl 1159endif 1160OBJS += ../src/crypto/crypto_openssl.o 1161OBJS_p += ../src/crypto/crypto_openssl.o 1162OBJS_priv += ../src/crypto/crypto_openssl.o 1163ifdef NEED_FIPS186_2_PRF 1164OBJS += ../src/crypto/fips_prf_openssl.o 1165endif 1166NEED_SHA256=y 1167NEED_TLS_PRF_SHA256=y 1168LIBS += -lcrypto 1169LIBS_p += -lcrypto 1170ifdef CONFIG_TLS_ADD_DL 1171LIBS += -ldl 1172LIBS_p += -ldl 1173endif 1174ifndef CONFIG_TLS_DEFAULT_CIPHERS 1175CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW" 1176endif 1177CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\" 1178endif 1179 1180ifeq ($(CONFIG_TLS), gnutls) 1181ifndef CONFIG_CRYPTO 1182# default to libgcrypt 1183CONFIG_CRYPTO=gnutls 1184endif 1185ifdef TLS_FUNCS 1186OBJS += ../src/crypto/tls_gnutls.o 1187LIBS += -lgnutls -lgpg-error 1188endif 1189OBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o 1190OBJS_p += ../src/crypto/crypto_$(CONFIG_CRYPTO).o 1191OBJS_priv += ../src/crypto/crypto_$(CONFIG_CRYPTO).o 1192ifdef NEED_FIPS186_2_PRF 1193OBJS += ../src/crypto/fips_prf_internal.o 1194SHA1OBJS += ../src/crypto/sha1-internal.o 1195endif 1196ifeq ($(CONFIG_CRYPTO), gnutls) 1197LIBS += -lgcrypt 1198LIBS_p += -lgcrypt 1199CONFIG_INTERNAL_RC4=y 1200CONFIG_INTERNAL_DH_GROUP5=y 1201endif 1202ifeq ($(CONFIG_CRYPTO), nettle) 1203LIBS += -lnettle -lgmp 1204LIBS_p += -lnettle -lgmp 1205CONFIG_INTERNAL_RC4=y 1206CONFIG_INTERNAL_DH_GROUP5=y 1207endif 1208endif 1209 1210ifeq ($(CONFIG_TLS), internal) 1211ifndef CONFIG_CRYPTO 1212CONFIG_CRYPTO=internal 1213endif 1214ifdef TLS_FUNCS 1215OBJS += ../src/crypto/crypto_internal-rsa.o 1216OBJS += ../src/crypto/tls_internal.o 1217OBJS += ../src/tls/tlsv1_common.o 1218OBJS += ../src/tls/tlsv1_record.o 1219OBJS += ../src/tls/tlsv1_cred.o 1220OBJS += ../src/tls/tlsv1_client.o 1221OBJS += ../src/tls/tlsv1_client_write.o 1222OBJS += ../src/tls/tlsv1_client_read.o 1223OBJS += ../src/tls/tlsv1_client_ocsp.o 1224OBJS += ../src/tls/asn1.o 1225OBJS += ../src/tls/rsa.o 1226OBJS += ../src/tls/x509v3.o 1227OBJS += ../src/tls/pkcs1.o 1228OBJS += ../src/tls/pkcs5.o 1229OBJS += ../src/tls/pkcs8.o 1230NEED_SHA256=y 1231NEED_BASE64=y 1232NEED_TLS_PRF=y 1233ifdef CONFIG_TLSV12 1234NEED_TLS_PRF_SHA256=y 1235endif 1236NEED_MODEXP=y 1237NEED_CIPHER=y 1238CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT 1239endif 1240ifdef NEED_CIPHER 1241NEED_DES=y 1242OBJS += ../src/crypto/crypto_internal-cipher.o 1243endif 1244ifdef NEED_MODEXP 1245OBJS += ../src/crypto/crypto_internal-modexp.o 1246OBJS += ../src/tls/bignum.o 1247endif 1248ifeq ($(CONFIG_CRYPTO), libtomcrypt) 1249OBJS += ../src/crypto/crypto_libtomcrypt.o 1250OBJS_p += ../src/crypto/crypto_libtomcrypt.o 1251LIBS += -ltomcrypt -ltfm 1252LIBS_p += -ltomcrypt -ltfm 1253CONFIG_INTERNAL_SHA256=y 1254CONFIG_INTERNAL_RC4=y 1255CONFIG_INTERNAL_DH_GROUP5=y 1256endif 1257ifeq ($(CONFIG_CRYPTO), internal) 1258OBJS += ../src/crypto/crypto_internal.o 1259OBJS_p += ../src/crypto/crypto_internal.o 1260NEED_AES_ENC=y 1261CFLAGS += -DCONFIG_CRYPTO_INTERNAL 1262ifdef CONFIG_INTERNAL_LIBTOMMATH 1263CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH 1264ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST 1265CFLAGS += -DLTM_FAST 1266endif 1267else 1268LIBS += -ltommath 1269LIBS_p += -ltommath 1270endif 1271CONFIG_INTERNAL_AES=y 1272CONFIG_INTERNAL_DES=y 1273CONFIG_INTERNAL_SHA1=y 1274CONFIG_INTERNAL_MD4=y 1275CONFIG_INTERNAL_MD5=y 1276CONFIG_INTERNAL_SHA256=y 1277CONFIG_INTERNAL_SHA384=y 1278CONFIG_INTERNAL_SHA512=y 1279CONFIG_INTERNAL_RC4=y 1280CONFIG_INTERNAL_DH_GROUP5=y 1281endif 1282ifeq ($(CONFIG_CRYPTO), cryptoapi) 1283OBJS += ../src/crypto/crypto_cryptoapi.o 1284OBJS_p += ../src/crypto/crypto_cryptoapi.o 1285CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI 1286CONFIG_INTERNAL_SHA256=y 1287CONFIG_INTERNAL_RC4=y 1288endif 1289endif 1290 1291ifeq ($(CONFIG_TLS), linux) 1292OBJS += ../src/crypto/crypto_linux.o 1293OBJS_p += ../src/crypto/crypto_linux.o 1294ifdef TLS_FUNCS 1295OBJS += ../src/crypto/crypto_internal-rsa.o 1296OBJS += ../src/crypto/tls_internal.o 1297OBJS += ../src/tls/tlsv1_common.o 1298OBJS += ../src/tls/tlsv1_record.o 1299OBJS += ../src/tls/tlsv1_cred.o 1300OBJS += ../src/tls/tlsv1_client.o 1301OBJS += ../src/tls/tlsv1_client_write.o 1302OBJS += ../src/tls/tlsv1_client_read.o 1303OBJS += ../src/tls/tlsv1_client_ocsp.o 1304OBJS += ../src/tls/asn1.o 1305OBJS += ../src/tls/rsa.o 1306OBJS += ../src/tls/x509v3.o 1307OBJS += ../src/tls/pkcs1.o 1308OBJS += ../src/tls/pkcs5.o 1309OBJS += ../src/tls/pkcs8.o 1310NEED_SHA256=y 1311NEED_BASE64=y 1312NEED_TLS_PRF=y 1313ifdef CONFIG_TLSV12 1314NEED_TLS_PRF_SHA256=y 1315endif 1316NEED_MODEXP=y 1317NEED_CIPHER=y 1318CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT 1319endif 1320ifdef NEED_MODEXP 1321OBJS += ../src/crypto/crypto_internal-modexp.o 1322OBJS += ../src/tls/bignum.o 1323CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH 1324CFLAGS += -DLTM_FAST 1325endif 1326CONFIG_INTERNAL_DH_GROUP5=y 1327ifdef NEED_FIPS186_2_PRF 1328OBJS += ../src/crypto/fips_prf_internal.o 1329OBJS += ../src/crypto/sha1-internal.o 1330endif 1331endif 1332 1333ifeq ($(CONFIG_TLS), none) 1334ifdef TLS_FUNCS 1335OBJS += ../src/crypto/tls_none.o 1336CFLAGS += -DEAP_TLS_NONE 1337CONFIG_INTERNAL_AES=y 1338CONFIG_INTERNAL_SHA1=y 1339CONFIG_INTERNAL_MD5=y 1340endif 1341OBJS += ../src/crypto/crypto_none.o 1342OBJS_p += ../src/crypto/crypto_none.o 1343CONFIG_INTERNAL_SHA256=y 1344CONFIG_INTERNAL_RC4=y 1345endif 1346 1347ifdef TLS_FUNCS 1348ifdef CONFIG_SMARTCARD 1349ifndef CONFIG_NATIVE_WINDOWS 1350ifneq ($(CONFIG_L2_PACKET), freebsd) 1351LIBS += -ldl 1352endif 1353endif 1354endif 1355endif 1356 1357ifndef TLS_FUNCS 1358OBJS += ../src/crypto/tls_none.o 1359ifeq ($(CONFIG_TLS), internal) 1360CONFIG_INTERNAL_AES=y 1361CONFIG_INTERNAL_SHA1=y 1362CONFIG_INTERNAL_MD5=y 1363CONFIG_INTERNAL_RC4=y 1364endif 1365endif 1366 1367AESOBJS = # none so far (see below) 1368ifdef CONFIG_INTERNAL_AES 1369AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-dec.o 1370endif 1371 1372ifneq ($(CONFIG_TLS), openssl) 1373ifneq ($(CONFIG_TLS), wolfssl) 1374NEED_INTERNAL_AES_WRAP=y 1375endif 1376endif 1377ifdef CONFIG_OPENSSL_INTERNAL_AES_WRAP 1378# Seems to be needed at least with BoringSSL 1379NEED_INTERNAL_AES_WRAP=y 1380CFLAGS += -DCONFIG_OPENSSL_INTERNAL_AES_WRAP 1381endif 1382ifdef CONFIG_FIPS 1383# Have to use internal AES key wrap routines to use OpenSSL EVP since the 1384# OpenSSL AES_wrap_key()/AES_unwrap_key() API is not available in FIPS mode. 1385NEED_INTERNAL_AES_WRAP=y 1386endif 1387 1388ifdef NEED_INTERNAL_AES_WRAP 1389ifneq ($(CONFIG_TLS), linux) 1390AESOBJS += ../src/crypto/aes-unwrap.o 1391endif 1392endif 1393ifdef NEED_AES_EAX 1394AESOBJS += ../src/crypto/aes-eax.o 1395NEED_AES_CTR=y 1396NEED_AES_OMAC1=y 1397endif 1398ifdef NEED_AES_SIV 1399AESOBJS += ../src/crypto/aes-siv.o 1400NEED_AES_CTR=y 1401NEED_AES_OMAC1=y 1402endif 1403ifdef NEED_AES_CTR 1404AESOBJS += ../src/crypto/aes-ctr.o 1405endif 1406ifdef NEED_AES_ENCBLOCK 1407AESOBJS += ../src/crypto/aes-encblock.o 1408endif 1409ifdef NEED_AES_OMAC1 1410NEED_AES_ENC=y 1411ifdef CONFIG_OPENSSL_CMAC 1412CFLAGS += -DCONFIG_OPENSSL_CMAC 1413else 1414ifneq ($(CONFIG_TLS), linux) 1415ifneq ($(CONFIG_TLS), wolfssl) 1416AESOBJS += ../src/crypto/aes-omac1.o 1417endif 1418endif 1419endif 1420endif 1421ifdef NEED_AES_WRAP 1422NEED_AES_ENC=y 1423ifdef NEED_INTERNAL_AES_WRAP 1424AESOBJS += ../src/crypto/aes-wrap.o 1425endif 1426endif 1427ifdef NEED_AES_CBC 1428NEED_AES_ENC=y 1429ifneq ($(CONFIG_TLS), openssl) 1430ifneq ($(CONFIG_TLS), linux) 1431ifneq ($(CONFIG_TLS), wolfssl) 1432AESOBJS += ../src/crypto/aes-cbc.o 1433endif 1434endif 1435endif 1436endif 1437ifdef NEED_AES_ENC 1438ifdef CONFIG_INTERNAL_AES 1439AESOBJS += ../src/crypto/aes-internal-enc.o 1440endif 1441endif 1442ifdef NEED_AES 1443OBJS += $(AESOBJS) 1444endif 1445 1446ifdef NEED_SHA1 1447ifneq ($(CONFIG_TLS), openssl) 1448ifneq ($(CONFIG_TLS), linux) 1449ifneq ($(CONFIG_TLS), gnutls) 1450ifneq ($(CONFIG_TLS), wolfssl) 1451SHA1OBJS += ../src/crypto/sha1.o 1452endif 1453endif 1454endif 1455endif 1456SHA1OBJS += ../src/crypto/sha1-prf.o 1457ifdef CONFIG_INTERNAL_SHA1 1458SHA1OBJS += ../src/crypto/sha1-internal.o 1459ifdef NEED_FIPS186_2_PRF 1460SHA1OBJS += ../src/crypto/fips_prf_internal.o 1461endif 1462endif 1463ifdef CONFIG_NO_WPA_PASSPHRASE 1464CFLAGS += -DCONFIG_NO_PBKDF2 1465else 1466ifneq ($(CONFIG_TLS), openssl) 1467ifneq ($(CONFIG_TLS), wolfssl) 1468SHA1OBJS += ../src/crypto/sha1-pbkdf2.o 1469endif 1470endif 1471endif 1472ifdef NEED_T_PRF 1473SHA1OBJS += ../src/crypto/sha1-tprf.o 1474endif 1475ifdef NEED_TLS_PRF 1476SHA1OBJS += ../src/crypto/sha1-tlsprf.o 1477endif 1478endif 1479 1480ifndef CONFIG_FIPS 1481ifneq ($(CONFIG_TLS), openssl) 1482ifneq ($(CONFIG_TLS), linux) 1483ifneq ($(CONFIG_TLS), gnutls) 1484ifneq ($(CONFIG_TLS), wolfssl) 1485MD5OBJS += ../src/crypto/md5.o 1486endif 1487endif 1488endif 1489endif 1490endif 1491ifdef NEED_MD5 1492ifdef CONFIG_INTERNAL_MD5 1493MD5OBJS += ../src/crypto/md5-internal.o 1494endif 1495OBJS += $(MD5OBJS) 1496OBJS_p += $(MD5OBJS) 1497OBJS_priv += $(MD5OBJS) 1498endif 1499 1500ifdef NEED_MD4 1501ifdef CONFIG_INTERNAL_MD4 1502OBJS += ../src/crypto/md4-internal.o 1503endif 1504endif 1505 1506DESOBJS = # none needed when not internal 1507ifdef NEED_DES 1508ifndef CONFIG_FIPS 1509CFLAGS += -DCONFIG_DES 1510endif 1511ifdef CONFIG_INTERNAL_DES 1512DESOBJS += ../src/crypto/des-internal.o 1513endif 1514endif 1515 1516ifdef CONFIG_NO_RC4 1517CFLAGS += -DCONFIG_NO_RC4 1518endif 1519 1520ifdef NEED_RC4 1521ifdef CONFIG_INTERNAL_RC4 1522ifndef CONFIG_NO_RC4 1523OBJS += ../src/crypto/rc4.o 1524endif 1525endif 1526endif 1527 1528SHA256OBJS = # none by default 1529ifdef NEED_SHA256 1530CFLAGS += -DCONFIG_SHA256 1531ifneq ($(CONFIG_TLS), openssl) 1532ifneq ($(CONFIG_TLS), linux) 1533ifneq ($(CONFIG_TLS), gnutls) 1534ifneq ($(CONFIG_TLS), wolfssl) 1535SHA256OBJS += ../src/crypto/sha256.o 1536endif 1537endif 1538endif 1539endif 1540SHA256OBJS += ../src/crypto/sha256-prf.o 1541ifdef CONFIG_INTERNAL_SHA256 1542SHA256OBJS += ../src/crypto/sha256-internal.o 1543endif 1544ifdef CONFIG_INTERNAL_SHA384 1545CFLAGS += -DCONFIG_INTERNAL_SHA384 1546SHA256OBJS += ../src/crypto/sha384-internal.o 1547endif 1548ifdef CONFIG_INTERNAL_SHA512 1549CFLAGS += -DCONFIG_INTERNAL_SHA512 1550SHA256OBJS += ../src/crypto/sha512-internal.o 1551endif 1552ifdef NEED_TLS_PRF_SHA256 1553SHA256OBJS += ../src/crypto/sha256-tlsprf.o 1554endif 1555ifdef NEED_HMAC_SHA256_KDF 1556CFLAGS += -DCONFIG_HMAC_SHA256_KDF 1557OBJS += ../src/crypto/sha256-kdf.o 1558endif 1559ifdef NEED_HMAC_SHA384_KDF 1560CFLAGS += -DCONFIG_HMAC_SHA384_KDF 1561OBJS += ../src/crypto/sha384-kdf.o 1562endif 1563ifdef NEED_HMAC_SHA512_KDF 1564CFLAGS += -DCONFIG_HMAC_SHA512_KDF 1565OBJS += ../src/crypto/sha512-kdf.o 1566endif 1567OBJS += $(SHA256OBJS) 1568endif 1569ifdef NEED_SHA384 1570ifneq ($(CONFIG_TLS), openssl) 1571ifneq ($(CONFIG_TLS), linux) 1572ifneq ($(CONFIG_TLS), gnutls) 1573ifneq ($(CONFIG_TLS), wolfssl) 1574OBJS += ../src/crypto/sha384.o 1575endif 1576endif 1577endif 1578endif 1579CFLAGS += -DCONFIG_SHA384 1580OBJS += ../src/crypto/sha384-prf.o 1581endif 1582ifdef NEED_SHA512 1583ifneq ($(CONFIG_TLS), openssl) 1584ifneq ($(CONFIG_TLS), linux) 1585ifneq ($(CONFIG_TLS), gnutls) 1586ifneq ($(CONFIG_TLS), wolfssl) 1587OBJS += ../src/crypto/sha512.o 1588endif 1589endif 1590endif 1591endif 1592CFLAGS += -DCONFIG_SHA512 1593OBJS += ../src/crypto/sha512-prf.o 1594endif 1595 1596ifdef NEED_DH_GROUPS 1597OBJS += ../src/crypto/dh_groups.o 1598endif 1599ifdef NEED_DH_GROUPS_ALL 1600CFLAGS += -DALL_DH_GROUPS 1601endif 1602ifdef CONFIG_INTERNAL_DH_GROUP5 1603ifdef NEED_DH_GROUPS 1604OBJS += ../src/crypto/dh_group5.o 1605endif 1606endif 1607 1608ifdef NEED_ECC 1609CFLAGS += -DCONFIG_ECC 1610endif 1611 1612ifdef CONFIG_NO_RANDOM_POOL 1613CFLAGS += -DCONFIG_NO_RANDOM_POOL 1614else 1615ifdef CONFIG_GETRANDOM 1616CFLAGS += -DCONFIG_GETRANDOM 1617endif 1618OBJS += ../src/crypto/random.o 1619endif 1620 1621ifdef CONFIG_CTRL_IFACE 1622ifeq ($(CONFIG_CTRL_IFACE), y) 1623ifdef CONFIG_NATIVE_WINDOWS 1624CONFIG_CTRL_IFACE=named_pipe 1625else 1626CONFIG_CTRL_IFACE=unix 1627endif 1628endif 1629CFLAGS += -DCONFIG_CTRL_IFACE 1630ifeq ($(CONFIG_CTRL_IFACE), unix) 1631CFLAGS += -DCONFIG_CTRL_IFACE_UNIX 1632OBJS += ../src/common/ctrl_iface_common.o 1633endif 1634ifeq ($(CONFIG_CTRL_IFACE), udp) 1635CFLAGS += -DCONFIG_CTRL_IFACE_UDP 1636CFLAGS += -DCONFIG_OPEN_HARMONY_PATCH_LITE 1637endif 1638ifeq ($(CONFIG_CTRL_IFACE), udp6) 1639CONFIG_CTRL_IFACE=udp 1640CFLAGS += -DCONFIG_CTRL_IFACE_UDP 1641CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6 1642endif 1643ifeq ($(CONFIG_CTRL_IFACE), named_pipe) 1644CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE 1645endif 1646ifeq ($(CONFIG_CTRL_IFACE), udp-remote) 1647CONFIG_CTRL_IFACE=udp 1648CFLAGS += -DCONFIG_CTRL_IFACE_UDP 1649CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE 1650endif 1651ifeq ($(CONFIG_CTRL_IFACE), udp6-remote) 1652CONFIG_CTRL_IFACE=udp 1653CFLAGS += -DCONFIG_CTRL_IFACE_UDP 1654CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE 1655CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6 1656endif 1657OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o 1658endif 1659 1660ifdef CONFIG_CTRL_IFACE_DBUS_NEW 1661CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW 1662OBJS += dbus/dbus_dict_helpers.o 1663OBJS += dbus/dbus_new_helpers.o 1664OBJS += dbus/dbus_new.o dbus/dbus_new_handlers.o 1665OBJS += dbus/dbus_common.o 1666ifdef CONFIG_WPS 1667OBJS += dbus/dbus_new_handlers_wps.o 1668endif 1669ifdef CONFIG_P2P 1670OBJS += dbus/dbus_new_handlers_p2p.o 1671endif 1672ifndef DBUS_LIBS 1673DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1) 1674endif 1675ifndef DBUS_INCLUDE 1676DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1) 1677endif 1678ifdef CONFIG_CTRL_IFACE_DBUS_INTRO 1679OBJS += dbus/dbus_new_introspect.o 1680CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO 1681endif 1682CFLAGS += $(DBUS_INCLUDE) 1683LIBS += $(DBUS_LIBS) 1684endif 1685 1686ifdef CONFIG_READLINE 1687OBJS_c += ../src/utils/edit_readline.o 1688LIBS_c += -lreadline -lncurses 1689else 1690ifdef CONFIG_WPA_CLI_EDIT 1691OBJS_c += ../src/utils/edit.o 1692else 1693OBJS_c += ../src/utils/edit_simple.o 1694endif 1695endif 1696 1697ifdef CONFIG_NATIVE_WINDOWS 1698CFLAGS += -DCONFIG_NATIVE_WINDOWS 1699LIBS += -lws2_32 -lgdi32 -lcrypt32 1700LIBS_c += -lws2_32 1701LIBS_p += -lws2_32 -lgdi32 1702ifeq ($(CONFIG_CRYPTO), cryptoapi) 1703LIBS_p += -lcrypt32 1704endif 1705endif 1706 1707#ifdef CONFIG_NO_STDOUT_DEBUG 1708ifneq ($(DEBUG), 1) 1709CFLAGS += -DCONFIG_WPA_NO_LOG 1710CFLAGS += -DCONFIG_NO_STDOUT_DEBUG 1711ifndef CONFIG_CTRL_IFACE 1712CFLAGS += -DCONFIG_NO_WPA_MSG 1713endif 1714endif 1715 1716ifdef CONFIG_IPV6 1717# for eapol_test only 1718CFLAGS += -DCONFIG_IPV6 1719endif 1720 1721ifdef CONFIG_NO_LINUX_PACKET_SOCKET_WAR 1722CFLAGS += -DCONFIG_NO_LINUX_PACKET_SOCKET_WAR 1723endif 1724 1725ifdef NEED_BASE64 1726OBJS += ../src/utils/base64.o 1727endif 1728 1729ifdef NEED_SME 1730OBJS += sme.o 1731CFLAGS += -DCONFIG_SME 1732endif 1733 1734OBJS += ../src/common/ieee802_11_common.o 1735OBJS += ../src/common/hw_features_common.o 1736 1737ifdef NEED_EAP_COMMON 1738OBJS += ../src/eap_common/eap_common.o 1739endif 1740 1741ifndef CONFIG_MAIN 1742CONFIG_MAIN=main 1743endif 1744 1745ifdef CONFIG_DEBUG_SYSLOG 1746CFLAGS += -DCONFIG_DEBUG_SYSLOG 1747ifdef CONFIG_DEBUG_SYSLOG_FACILITY 1748CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)" 1749endif 1750endif 1751 1752ifdef CONFIG_DEBUG_LINUX_TRACING 1753CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING 1754endif 1755 1756ifdef CONFIG_DEBUG_FILE 1757CFLAGS += -DCONFIG_DEBUG_FILE 1758endif 1759 1760ifdef CONFIG_DELAYED_MIC_ERROR_REPORT 1761CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT 1762endif 1763 1764ifdef CONFIG_FIPS 1765CFLAGS += -DCONFIG_FIPS 1766ifneq ($(CONFIG_TLS), openssl) 1767ifneq ($(CONFIG_TLS), wolfssl) 1768$(error CONFIG_FIPS=y requires CONFIG_TLS=openssl) 1769endif 1770endif 1771endif 1772 1773OBJS += $(SHA1OBJS) $(DESOBJS) 1774 1775OBJS_p += $(SHA1OBJS) 1776OBJS_p += $(SHA256OBJS) 1777OBJS_priv += $(SHA1OBJS) 1778 1779ifdef CONFIG_BGSCAN_SIMPLE 1780CFLAGS += -DCONFIG_BGSCAN_SIMPLE 1781OBJS += bgscan_simple.o 1782NEED_BGSCAN=y 1783endif 1784 1785ifdef CONFIG_BGSCAN_LEARN 1786CFLAGS += -DCONFIG_BGSCAN_LEARN 1787OBJS += bgscan_learn.o 1788NEED_BGSCAN=y 1789endif 1790 1791ifdef NEED_BGSCAN 1792CFLAGS += -DCONFIG_BGSCAN 1793OBJS += bgscan.o 1794endif 1795 1796ifdef CONFIG_AUTOSCAN_EXPONENTIAL 1797CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL 1798OBJS += autoscan_exponential.o 1799NEED_AUTOSCAN=y 1800endif 1801 1802ifdef CONFIG_AUTOSCAN_PERIODIC 1803CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC 1804OBJS += autoscan_periodic.o 1805NEED_AUTOSCAN=y 1806endif 1807 1808ifdef NEED_AUTOSCAN 1809CFLAGS += -DCONFIG_AUTOSCAN 1810OBJS += autoscan.o 1811endif 1812 1813ifdef CONFIG_EXT_PASSWORD_TEST 1814OBJS += ../src/utils/ext_password_test.o 1815CFLAGS += -DCONFIG_EXT_PASSWORD_TEST 1816NEED_EXT_PASSWORD=y 1817endif 1818 1819ifdef NEED_EXT_PASSWORD 1820OBJS += ../src/utils/ext_password.o 1821CFLAGS += -DCONFIG_EXT_PASSWORD 1822endif 1823 1824ifdef NEED_GAS_SERVER 1825OBJS += ../src/common/gas_server.o 1826CFLAGS += -DCONFIG_GAS_SERVER 1827NEED_GAS=y 1828endif 1829 1830ifdef NEED_GAS 1831OBJS += ../src/common/gas.o 1832OBJS += gas_query.o 1833CFLAGS += -DCONFIG_GAS 1834NEED_OFFCHANNEL=y 1835endif 1836 1837ifdef NEED_OFFCHANNEL 1838OBJS += offchannel.o 1839CFLAGS += -DCONFIG_OFFCHANNEL 1840endif 1841 1842ifdef NEED_JSON 1843OBJS += ../src/utils/json.o 1844CFLAGS += -DCONFIG_JSON 1845endif 1846 1847ifdef CONFIG_MODULE_TESTS 1848CFLAGS += -DCONFIG_MODULE_TESTS 1849OBJS += wpas_module_tests.o 1850OBJS += ../src/utils/utils_module_tests.o 1851OBJS += ../src/common/common_module_tests.o 1852OBJS += ../src/crypto/crypto_module_tests.o 1853ifdef CONFIG_WPS 1854OBJS += ../src/wps/wps_module_tests.o 1855endif 1856endif 1857 1858OBJS += ../src/drivers/driver_common.o 1859OBJS_priv += ../src/drivers/driver_common.o 1860 1861OBJS += wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o 1862OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o 1863OBJS_t += ../src/radius/radius_client.o 1864OBJS_t += ../src/radius/radius.o 1865ifndef CONFIG_AP 1866OBJS_t += ../src/utils/ip_addr.o 1867endif 1868OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o 1869 1870OBJS_nfc := $(OBJS) $(OBJS_l2) nfc_pw_token.o 1871OBJS_nfc += $(OBJS_d) ../src/drivers/drivers.o 1872 1873OBJS += $(CONFIG_MAIN).o 1874 1875ifdef CONFIG_PRIVSEP 1876OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o 1877OBJS_priv += $(OBJS_l2) 1878OBJS_priv += ../src/utils/os_$(CONFIG_OS).o 1879OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o 1880OBJS_priv += ../src/utils/common.o 1881OBJS_priv += ../src/utils/wpa_debug.o 1882OBJS_priv += ../src/utils/wpabuf.o 1883OBJS_priv += wpa_priv.o 1884ifdef CONFIG_DRIVER_NL80211 1885OBJS_priv += ../src/common/ieee802_11_common.o 1886endif 1887OBJS += ../src/l2_packet/l2_packet_privsep.o 1888OBJS += ../src/drivers/driver_privsep.o 1889EXTRA_progs += wpa_priv 1890else 1891OBJS += $(OBJS_d) ../src/drivers/drivers.o 1892OBJS += $(OBJS_l2) 1893endif 1894 1895ifdef CONFIG_NDIS_EVENTS_INTEGRATED 1896CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED 1897OBJS += ../src/drivers/ndis_events.o 1898EXTRALIBS += -loleaut32 -lole32 -luuid 1899ifdef PLATFORMSDKLIB 1900EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib 1901else 1902EXTRALIBS += WbemUuid.Lib 1903endif 1904endif 1905 1906ifdef CONFIG_FST 1907CFLAGS += -DCONFIG_FST 1908ifdef CONFIG_FST_TEST 1909CFLAGS += -DCONFIG_FST_TEST 1910endif 1911FST_OBJS += ../src/fst/fst.o 1912FST_OBJS += ../src/fst/fst_session.o 1913FST_OBJS += ../src/fst/fst_iface.o 1914FST_OBJS += ../src/fst/fst_group.o 1915FST_OBJS += ../src/fst/fst_ctrl_aux.o 1916ifdef CONFIG_CTRL_IFACE 1917FST_OBJS += ../src/fst/fst_ctrl_iface.o 1918endif 1919OBJS += $(FST_OBJS) 1920OBJS_t += $(FST_OBJS) 1921OBJS_t2 += $(FST_OBJS) 1922OBJS_nfc += $(FST_OBJS) 1923endif 1924 1925ifndef LDO 1926LDO=$(CC) 1927endif 1928 1929Q=@ 1930E=echo 1931ifeq ($(V), 1) 1932Q= 1933E=true 1934endif 1935ifeq ($(QUIET), 1) 1936Q=@ 1937E=true 1938endif 1939 1940dynamic_eap_methods: $(EAPDYN) 1941 1942../src/drivers/build.wpa_supplicant: 1943 @if [ -f ../src/drivers/build.hostapd ]; then \ 1944 $(MAKE) -C ../src/drivers clean; \ 1945 fi 1946 @touch ../src/drivers/build.wpa_supplicant 1947 1948BCHECK=../src/drivers/build.wpa_supplicant 1949 1950wpa_priv: $(BCHECK) $(OBJS_priv) 1951 $(Q)$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS) 1952 @$(E) " LD " $@ 1953 1954$(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config 1955 1956$(COPY_OBJS): $(OBJS) 1957 cp $(OBJS) ../build/objs > /dev/null 2>&1 1958 1959#wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) 1960# $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) -lm -lpthread 1961# @$(E) " LD " $@ 1962 1963eapol_test: $(OBJS_t) 1964 $(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS) 1965 @$(E) " LD " $@ 1966 1967preauth_test: $(OBJS_t2) 1968 $(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS) 1969 @$(E) " LD " $@ 1970 1971wpa_passphrase: $(OBJS_p) 1972 $(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS) 1973 @$(E) " LD " $@ 1974 1975wpa_cli: $(OBJS_c) 1976 $(Q)$(LDO) --static $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c) 1977 @$(E) " LD " $@ 1978 1979LIBCTRL += ../src/common/wpa_ctrl.o 1980LIBCTRL += ../src/utils/os_$(CONFIG_OS).o 1981LIBCTRL += ../src/utils/common.o 1982LIBCTRL += ../src/utils/wpa_debug.o 1983LIBCTRLSO += ../src/common/wpa_ctrl.c 1984LIBCTRLSO += ../src/utils/os_$(CONFIG_OS).c 1985LIBCTRLSO += ../src/utils/common.c 1986LIBCTRLSO += ../src/utils/wpa_debug.c 1987 1988ifeq ($(LIB_TYPE), 0) 1989OBJS += ../src/common/wpa_ctrl.o 1990OBJS += ../src/utils/os_$(CONFIG_OS).o 1991OBJS += ../src/utils/common.o 1992OBJS += ../src/utils/wpa_debug.o 1993endif 1994 1995libwpa_client.a: $(LIBCTRL) 1996 $(Q)rm -f $@ 1997 $(Q)$(AR) crs $@ $? 1998 @$(E) " AR " $@ 1999 cp $@ ../build 2000 2001libwpa_client.so: $(LIBCTRLSO) 2002 @$(E) " CC $@ ($^)" 2003 $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -fPIC $^ 2004 cp $@ ../build 2005 2006libwpa_test1: libwpa_test.o libwpa_client.a 2007 $(Q)$(LDO) $(LDFLAGS) -o libwpa_test1 libwpa_test.o libwpa_client.a $(LIBS_c) 2008 @$(E) " LD " $@ 2009 2010libwpa_test2: libwpa_test.o libwpa_client.so 2011 $(Q)$(LDO) $(LDFLAGS) -o libwpa_test2 libwpa_test.o -L. -lwpa_client $(LIBS_c) 2012 @$(E) " LD " $@ 2013 2014nfc_pw_token: $(OBJS_nfc) 2015 $(Q)$(LDO) $(LDFLAGS) -o nfc_pw_token $(OBJS_nfc) $(LIBS) 2016 @$(E) " LD " $@ 2017 2018win_if_list: win_if_list.c 2019 $(Q)$(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w) 2020 @$(E) " LD " $@ 2021 2022eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c 2023 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ 2024 -Deap_peer_psk_register=eap_peer_method_dynamic_init 2025 2026eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c 2027 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ 2028 -Deap_peer_pax_register=eap_peer_method_dynamic_init 2029 2030eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c 2031 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ 2032 -Deap_peer_sake_register=eap_peer_method_dynamic_init 2033 2034eap_wsc.so: ../src/eap_peer/eap_wsc.c ../src/eap_common/eap_wsc_common.c ../src/wps/wps.c 2035 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ 2036 -Deap_peer_wsc_register=eap_peer_method_dynamic_init 2037 2038eap_ikev2.so: ../src/eap_peer/eap_ikev2.c ../src/eap_peer/ikev2.c ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.c 2039 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ 2040 -Deap_peer_ikev2_register=eap_peer_method_dynamic_init 2041 2042eap_eke.so: ../src/eap_peer/eap_eke.c ../src/eap_common/eap_eke_common.c 2043 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ 2044 -Deap_peer_eke_register=eap_peer_method_dynamic_init 2045 2046%.so: %.c 2047 $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \ 2048 -D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init 2049 2050ifdef CONFIG_CODE_COVERAGE 2051%.o: %.c 2052 @$(E) " CC " $< 2053 $(Q)cd $(dir $@); $(CC) -c -o $(notdir $@) $(CFLAGS) $(notdir $<) 2054else 2055%.o: %.c 2056 $(Q)$(CC) -c -o $@ $(CFLAGS) $< 2057 @$(E) " CC " $< 2058endif 2059 2060%.service: %.service.in 2061 $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ 2062 @$(E) " sed" $< 2063 2064%@.service: %.service.arg.in 2065 $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ 2066 @$(E) " sed" $< 2067 2068wpa_supplicant.exe: wpa_supplicant 2069 mv -f $< $@ 2070wpa_cli.exe: wpa_cli 2071 mv -f $< $@ 2072wpa_passphrase.exe: wpa_passphrase 2073 mv -f $< $@ 2074win_if_list.exe: win_if_list 2075 mv -f $< $@ 2076eapol_test.exe: eapol_test 2077 mv -f $< $@ 2078 2079WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe 2080 2081windows-bin: $(WINALL) 2082 $(STRIP) $(WINALL) 2083 2084wpa_gui: 2085 @echo "wpa_gui has been removed - see wpa_gui-qt4 for replacement" 2086 2087wpa_gui-qt4/Makefile: 2088 qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro 2089 2090wpa_gui-qt4/lang/wpa_gui_de.qm: wpa_gui-qt4/lang/wpa_gui_de.ts 2091 lrelease wpa_gui-qt4/wpa_gui.pro 2092 2093wpa_gui-qt4: wpa_gui-qt4/Makefile wpa_gui-qt4/lang/wpa_gui_de.qm 2094 $(MAKE) -C wpa_gui-qt4 2095 2096FIPSDIR=/usr/local/ssl/fips-2.0 2097FIPSLD=$(FIPSDIR)/bin/fipsld 2098fips: 2099 $(MAKE) CC=$(FIPSLD) FIPSLD_CC="$(CC)" 2100 2101lcov-html: wpa_supplicant.gcda 2102 lcov -c -d .. > lcov.info 2103 genhtml lcov.info --output-directory lcov-html 2104 2105clean: 2106 $(MAKE) -C ../src clean 2107 $(MAKE) -C ./dbus clean 2108 rm -f core *~ *.o *.d *.gcno *.gcda *.gcov 2109 rm -f eap_*.so $(ALL) $(WINALL) eapol_test preauth_test 2110 rm -f wpa_priv 2111 rm -f nfc_pw_token 2112 rm -f lcov.info 2113 rm -rf lcov-html 2114 rm -f libwpa_client.a 2115 rm -f libwpa_client.so 2116 rm -f libwpa_test1 libwpa_test2 2117 2118-include $(OBJS:%.o=%.d) 2119