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