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