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