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 
     12 CFLAGS += -I../src
     13 CFLAGS += -I../src/crypto
     14 CFLAGS += -I../src/utils
     15 CFLAGS += -I../src/common
     16 CFLAGS += -I../src/rsn_supp
     17 
     18 ALL=wpa_supplicant wpa_passphrase wpa_cli
     19 
     20 all: verify_config $(ALL) dynamic_eap_methods
     21 
     22 verify_config:
     23 	@if [ ! -r .config ]; then \
     24 		echo 'Building wpa_supplicant requires a configuration file'; \
     25 		echo '(.config). See README for more instructions. You can'; \
     26 		echo 'run "cp defconfig .config" to create an example'; \
     27 		echo 'configuration.'; \
     28 		exit 1; \
     29 	fi
     30 
     31 mkconfig:
     32 	@if [ -e .config ]; then \
     33 		echo '.config exists - did not replace it'; \
     34 		exit 1; \
     35 	fi
     36 	echo CONFIG_DRIVER_HOSTAP=y >> .config
     37 	echo CONFIG_DRIVER_WEXT=y >> .config
     38 
     39 install: all
     40 	mkdir -p $(DESTDIR)$(BINDIR)
     41 	for i in $(ALL); do cp $$i $(DESTDIR)$(BINDIR)/$$i; done
     42 	$(MAKE) -C ../src install
     43 
     44 OBJS = config.o
     45 OBJS += ../src/utils/common.o
     46 OBJS += ../src/utils/wpa_debug.o
     47 OBJS += ../src/utils/wpabuf.o
     48 OBJS += ../src/crypto/md5.o
     49 OBJS += ../src/crypto/rc4.o
     50 OBJS += ../src/crypto/md4.o
     51 OBJS += ../src/crypto/sha1.o
     52 OBJS += ../src/crypto/des.o
     53 OBJS_p = wpa_passphrase.o
     54 OBJS_p += ../src/utils/common.o
     55 OBJS_p += ../src/utils/wpa_debug.o
     56 OBJS_p += ../src/crypto/md5.o
     57 OBJS_p += ../src/crypto/md4.o
     58 OBJS_p += ../src/crypto/sha1.o
     59 OBJS_p += ../src/crypto/des.o
     60 OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
     61 
     62 -include .config
     63 
     64 ifndef CONFIG_OS
     65 ifdef CONFIG_NATIVE_WINDOWS
     66 CONFIG_OS=win32
     67 else
     68 CONFIG_OS=unix
     69 endif
     70 endif
     71 
     72 ifeq ($(CONFIG_OS), internal)
     73 CFLAGS += -DOS_NO_C_LIB_DEFINES
     74 endif
     75 
     76 OBJS += ../src/utils/os_$(CONFIG_OS).o
     77 OBJS_p += ../src/utils/os_$(CONFIG_OS).o
     78 OBJS_c += ../src/utils/os_$(CONFIG_OS).o
     79 
     80 ifndef CONFIG_ELOOP
     81 CONFIG_ELOOP=eloop
     82 endif
     83 OBJS += ../src/utils/$(CONFIG_ELOOP).o
     84 
     85 
     86 ifdef CONFIG_EAPOL_TEST
     87 CFLAGS += -Werror -DEAPOL_TEST
     88 endif
     89 
     90 ifndef CONFIG_BACKEND
     91 CONFIG_BACKEND=file
     92 endif
     93 
     94 ifeq ($(CONFIG_BACKEND), file)
     95 OBJS += config_file.o
     96 ifndef CONFIG_NO_CONFIG_BLOBS
     97 NEED_BASE64=y
     98 endif
     99 CFLAGS += -DCONFIG_BACKEND_FILE
    100 endif
    101 
    102 ifeq ($(CONFIG_BACKEND), winreg)
    103 OBJS += config_winreg.o
    104 endif
    105 
    106 ifeq ($(CONFIG_BACKEND), none)
    107 OBJS += config_none.o
    108 endif
    109 
    110 ifdef CONFIG_NO_CONFIG_WRITE
    111 CFLAGS += -DCONFIG_NO_CONFIG_WRITE
    112 endif
    113 
    114 ifdef CONFIG_NO_CONFIG_BLOBS
    115 CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
    116 endif
    117 
    118 ifdef CONFIG_NO_SCAN_PROCESSING
    119 CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
    120 endif
    121 
    122 ifdef CONFIG_DRIVER_HOSTAP
    123 CFLAGS += -DCONFIG_DRIVER_HOSTAP
    124 OBJS_d += ../src/drivers/driver_hostap.o
    125 CONFIG_WIRELESS_EXTENSION=y
    126 endif
    127 
    128 ifdef CONFIG_DRIVER_WEXT
    129 CFLAGS += -DCONFIG_DRIVER_WEXT
    130 CONFIG_WIRELESS_EXTENSION=y
    131 endif
    132 
    133 ifdef CONFIG_DRIVER_NL80211
    134 CFLAGS += -DCONFIG_DRIVER_NL80211
    135 OBJS_d += ../src/drivers/driver_nl80211.o
    136 LIBS += -lnl
    137 ifdef CONFIG_CLIENT_MLME
    138 OBJS_d += ../src/drivers/radiotap.o
    139 endif
    140 endif
    141 
    142 ifdef CONFIG_DRIVER_PRISM54
    143 CFLAGS += -DCONFIG_DRIVER_PRISM54
    144 OBJS_d += ../src/drivers/driver_prism54.o
    145 CONFIG_WIRELESS_EXTENSION=y
    146 endif
    147 
    148 ifdef CONFIG_DRIVER_HERMES
    149 CFLAGS += -DCONFIG_DRIVER_HERMES
    150 OBJS_d += ../src/drivers/driver_hermes.o
    151 CONFIG_WIRELESS_EXTENSION=y
    152 endif
    153 
    154 ifdef CONFIG_DRIVER_MADWIFI
    155 CFLAGS += -DCONFIG_DRIVER_MADWIFI
    156 OBJS_d += ../src/drivers/driver_madwifi.o
    157 CONFIG_WIRELESS_EXTENSION=y
    158 endif
    159 
    160 ifdef CONFIG_DRIVER_ATMEL
    161 CFLAGS += -DCONFIG_DRIVER_ATMEL
    162 OBJS_d += ../src/drivers/driver_atmel.o
    163 CONFIG_WIRELESS_EXTENSION=y
    164 endif
    165 
    166 ifdef CONFIG_DRIVER_NDISWRAPPER
    167 CFLAGS += -DCONFIG_DRIVER_NDISWRAPPER
    168 OBJS_d += ../src/drivers/driver_ndiswrapper.o
    169 CONFIG_WIRELESS_EXTENSION=y
    170 endif
    171 
    172 ifdef CONFIG_DRIVER_RALINK
    173 CFLAGS += -DCONFIG_DRIVER_RALINK
    174 OBJS_d += ../src/drivers/driver_ralink.o
    175 endif
    176 
    177 ifdef CONFIG_DRIVER_BROADCOM
    178 CFLAGS += -DCONFIG_DRIVER_BROADCOM
    179 OBJS_d += ../src/drivers/driver_broadcom.o
    180 endif
    181 
    182 ifdef CONFIG_DRIVER_IPW
    183 CFLAGS += -DCONFIG_DRIVER_IPW
    184 OBJS_d += ../src/drivers/driver_ipw.o
    185 CONFIG_WIRELESS_EXTENSION=y
    186 endif
    187 
    188 ifdef CONFIG_DRIVER_BSD
    189 CFLAGS += -DCONFIG_DRIVER_BSD
    190 OBJS_d += ../src/drivers/driver_bsd.o
    191 ifndef CONFIG_L2_PACKET
    192 CONFIG_L2_PACKET=freebsd
    193 endif
    194 endif
    195 
    196 ifdef CONFIG_DRIVER_NDIS
    197 CFLAGS += -DCONFIG_DRIVER_NDIS
    198 OBJS_d += ../src/drivers/driver_ndis.o
    199 ifdef CONFIG_NDIS_EVENTS_INTEGRATED
    200 OBJS_d += ../src/drivers/driver_ndis_.o
    201 endif
    202 ifndef CONFIG_L2_PACKET
    203 CONFIG_L2_PACKET=pcap
    204 endif
    205 CONFIG_WINPCAP=y
    206 ifdef CONFIG_USE_NDISUIO
    207 CFLAGS += -DCONFIG_USE_NDISUIO
    208 endif
    209 endif
    210 
    211 ifdef CONFIG_DRIVER_WIRED
    212 CFLAGS += -DCONFIG_DRIVER_WIRED
    213 OBJS_d += ../src/drivers/driver_wired.o
    214 endif
    215 
    216 ifdef CONFIG_DRIVER_TEST
    217 CFLAGS += -DCONFIG_DRIVER_TEST
    218 OBJS_d += ../src/drivers/driver_test.o
    219 endif
    220 
    221 ifdef CONFIG_DRIVER_OSX
    222 CFLAGS += -DCONFIG_DRIVER_OSX
    223 OBJS_d += ../src/drivers/driver_osx.o
    224 LDFLAGS += -framework CoreFoundation
    225 LDFLAGS += -F/System/Library/PrivateFrameworks -framework Apple80211
    226 endif
    227 
    228 ifdef CONFIG_DRIVER_PS3
    229 CFLAGS += -DCONFIG_DRIVER_PS3 -m64
    230 OBJS_d += ../src/drivers/driver_ps3.o
    231 LDFLAGS += -m64
    232 endif
    233 
    234 ifdef CONFIG_DRIVER_IPHONE
    235 CFLAGS += -DCONFIG_DRIVER_IPHONE
    236 OBJS_d += ../src/drivers/driver_iphone.o
    237 OBJS_d += ../src/drivers/MobileApple80211.o
    238 LIBS += -framework CoreFoundation
    239 endif
    240 
    241 ifdef CONFIG_DRIVER_ROBOSWITCH
    242 CFLAGS += -DCONFIG_DRIVER_ROBOSWITCH
    243 OBJS_d += ../src/drivers/driver_roboswitch.o
    244 endif
    245 
    246 ifndef CONFIG_L2_PACKET
    247 CONFIG_L2_PACKET=linux
    248 endif
    249 
    250 OBJS_l2 += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o
    251 
    252 ifeq ($(CONFIG_L2_PACKET), pcap)
    253 ifdef CONFIG_WINPCAP
    254 CFLAGS += -DCONFIG_WINPCAP
    255 LIBS += -lwpcap -lpacket
    256 LIBS_w += -lwpcap
    257 else
    258 LIBS += -ldnet -lpcap
    259 endif
    260 endif
    261 
    262 ifeq ($(CONFIG_L2_PACKET), winpcap)
    263 LIBS += -lwpcap -lpacket
    264 LIBS_w += -lwpcap
    265 endif
    266 
    267 ifeq ($(CONFIG_L2_PACKET), freebsd)
    268 LIBS += -lpcap
    269 endif
    270 
    271 ifdef CONFIG_EAP_TLS
    272 # EAP-TLS
    273 ifeq ($(CONFIG_EAP_TLS), dyn)
    274 CFLAGS += -DEAP_TLS_DYNAMIC
    275 EAPDYN += ../src/eap_peer/eap_tls.so
    276 else
    277 CFLAGS += -DEAP_TLS
    278 OBJS += ../src/eap_peer/eap_tls.o
    279 OBJS_h += ../src/eap_server/eap_tls.o
    280 endif
    281 TLS_FUNCS=y
    282 CONFIG_IEEE8021X_EAPOL=y
    283 endif
    284 
    285 ifdef CONFIG_EAP_PEAP
    286 # EAP-PEAP
    287 ifeq ($(CONFIG_EAP_PEAP), dyn)
    288 CFLAGS += -DEAP_PEAP_DYNAMIC
    289 EAPDYN += ../src/eap_peer/eap_peap.so
    290 else
    291 CFLAGS += -DEAP_PEAP
    292 OBJS += ../src/eap_peer/eap_peap.o
    293 OBJS += ../src/eap_common/eap_peap_common.o
    294 OBJS_h += ../src/eap_server/eap_peap.o
    295 endif
    296 TLS_FUNCS=y
    297 CONFIG_IEEE8021X_EAPOL=y
    298 endif
    299 
    300 ifdef CONFIG_EAP_TTLS
    301 # EAP-TTLS
    302 ifeq ($(CONFIG_EAP_TTLS), dyn)
    303 CFLAGS += -DEAP_TTLS_DYNAMIC
    304 EAPDYN += ../src/eap_peer/eap_ttls.so
    305 else
    306 CFLAGS += -DEAP_TTLS
    307 OBJS += ../src/eap_peer/eap_ttls.o
    308 OBJS_h += ../src/eap_server/eap_ttls.o
    309 endif
    310 MS_FUNCS=y
    311 TLS_FUNCS=y
    312 CHAP=y
    313 CONFIG_IEEE8021X_EAPOL=y
    314 endif
    315 
    316 ifdef CONFIG_EAP_MD5
    317 # EAP-MD5
    318 ifeq ($(CONFIG_EAP_MD5), dyn)
    319 CFLAGS += -DEAP_MD5_DYNAMIC
    320 EAPDYN += ../src/eap_peer/eap_md5.so
    321 else
    322 CFLAGS += -DEAP_MD5
    323 OBJS += ../src/eap_peer/eap_md5.o
    324 OBJS_h += ../src/eap_server/eap_md5.o
    325 endif
    326 CHAP=y
    327 CONFIG_IEEE8021X_EAPOL=y
    328 endif
    329 
    330 # backwards compatibility for old spelling
    331 ifdef CONFIG_MSCHAPV2
    332 ifndef CONFIG_EAP_MSCHAPV2
    333 CONFIG_EAP_MSCHAPV2=y
    334 endif
    335 endif
    336 
    337 ifdef CONFIG_EAP_MSCHAPV2
    338 # EAP-MSCHAPv2
    339 ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
    340 CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
    341 EAPDYN += ../src/eap_peer/eap_mschapv2.so
    342 EAPDYN += ../src/eap_peer/mschapv2.so
    343 else
    344 CFLAGS += -DEAP_MSCHAPv2
    345 OBJS += ../src/eap_peer/eap_mschapv2.o
    346 OBJS += ../src/eap_peer/mschapv2.o
    347 OBJS_h += ../src/eap_server/eap_mschapv2.o
    348 endif
    349 MS_FUNCS=y
    350 CONFIG_IEEE8021X_EAPOL=y
    351 endif
    352 
    353 ifdef CONFIG_EAP_GTC
    354 # EAP-GTC
    355 ifeq ($(CONFIG_EAP_GTC), dyn)
    356 CFLAGS += -DEAP_GTC_DYNAMIC
    357 EAPDYN += ../src/eap_peer/eap_gtc.so
    358 else
    359 CFLAGS += -DEAP_GTC
    360 OBJS += ../src/eap_peer/eap_gtc.o
    361 OBJS_h += ../src/eap_server/eap_gtc.o
    362 endif
    363 CONFIG_IEEE8021X_EAPOL=y
    364 endif
    365 
    366 ifdef CONFIG_EAP_OTP
    367 # EAP-OTP
    368 ifeq ($(CONFIG_EAP_OTP), dyn)
    369 CFLAGS += -DEAP_OTP_DYNAMIC
    370 EAPDYN += ../src/eap_peer/eap_otp.so
    371 else
    372 CFLAGS += -DEAP_OTP
    373 OBJS += ../src/eap_peer/eap_otp.o
    374 endif
    375 CONFIG_IEEE8021X_EAPOL=y
    376 endif
    377 
    378 ifdef CONFIG_EAP_SIM
    379 # EAP-SIM
    380 ifeq ($(CONFIG_EAP_SIM), dyn)
    381 CFLAGS += -DEAP_SIM_DYNAMIC
    382 EAPDYN += ../src/eap_peer/eap_sim.so
    383 else
    384 CFLAGS += -DEAP_SIM
    385 OBJS += ../src/eap_peer/eap_sim.o
    386 OBJS_h += ../src/eap_server/eap_sim.o
    387 endif
    388 CONFIG_IEEE8021X_EAPOL=y
    389 CONFIG_EAP_SIM_COMMON=y
    390 endif
    391 
    392 ifdef CONFIG_EAP_LEAP
    393 # EAP-LEAP
    394 ifeq ($(CONFIG_EAP_LEAP), dyn)
    395 CFLAGS += -DEAP_LEAP_DYNAMIC
    396 EAPDYN += ../src/eap_peer/eap_leap.so
    397 else
    398 CFLAGS += -DEAP_LEAP
    399 OBJS += ../src/eap_peer/eap_leap.o
    400 endif
    401 MS_FUNCS=y
    402 CONFIG_IEEE8021X_EAPOL=y
    403 endif
    404 
    405 ifdef CONFIG_EAP_PSK
    406 # EAP-PSK
    407 ifeq ($(CONFIG_EAP_PSK), dyn)
    408 CFLAGS += -DEAP_PSK_DYNAMIC
    409 EAPDYN += ../src/eap_peer/eap_psk.so
    410 else
    411 CFLAGS += -DEAP_PSK
    412 OBJS += ../src/eap_peer/eap_psk.o ../src/eap_common/eap_psk_common.o
    413 OBJS_h += ../src/eap_server/eap_psk.o
    414 endif
    415 CONFIG_IEEE8021X_EAPOL=y
    416 NEED_AES=y
    417 endif
    418 
    419 ifdef CONFIG_EAP_AKA
    420 # EAP-AKA
    421 ifeq ($(CONFIG_EAP_AKA), dyn)
    422 CFLAGS += -DEAP_AKA_DYNAMIC
    423 EAPDYN += ../src/eap_peer/eap_aka.so
    424 else
    425 CFLAGS += -DEAP_AKA
    426 OBJS += ../src/eap_peer/eap_aka.o
    427 OBJS_h += ../src/eap_server/eap_aka.o
    428 endif
    429 CONFIG_IEEE8021X_EAPOL=y
    430 CONFIG_EAP_SIM_COMMON=y
    431 endif
    432 
    433 ifdef CONFIG_EAP_AKA_PRIME
    434 # EAP-AKA'
    435 ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
    436 CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
    437 else
    438 CFLAGS += -DEAP_AKA_PRIME
    439 endif
    440 NEED_SHA256=y
    441 endif
    442 
    443 ifdef CONFIG_EAP_SIM_COMMON
    444 OBJS += ../src/eap_common/eap_sim_common.o
    445 OBJS_h += ../src/eap_server/eap_sim_db.o
    446 NEED_AES=y
    447 NEED_FIPS186_2_PRF=y
    448 endif
    449 
    450 ifdef CONFIG_EAP_FAST
    451 # EAP-FAST
    452 ifeq ($(CONFIG_EAP_FAST), dyn)
    453 CFLAGS += -DEAP_FAST_DYNAMIC
    454 EAPDYN += ../src/eap_peer/eap_fast.so
    455 EAPDYN += ../src/eap_common/eap_fast_common.o
    456 else
    457 CFLAGS += -DEAP_FAST
    458 OBJS += ../src/eap_peer/eap_fast.o ../src/eap_peer/eap_fast_pac.o
    459 OBJS += ../src/eap_common/eap_fast_common.o
    460 OBJS_h += ../src/eap_server/eap_fast.o
    461 endif
    462 TLS_FUNCS=y
    463 CONFIG_IEEE8021X_EAPOL=y
    464 NEED_T_PRF=y
    465 endif
    466 
    467 ifdef CONFIG_EAP_PAX
    468 # EAP-PAX
    469 ifeq ($(CONFIG_EAP_PAX), dyn)
    470 CFLAGS += -DEAP_PAX_DYNAMIC
    471 EAPDYN += ../src/eap_peer/eap_pax.so
    472 else
    473 CFLAGS += -DEAP_PAX
    474 OBJS += ../src/eap_peer/eap_pax.o ../src/eap_common/eap_pax_common.o
    475 OBJS_h += ../src/eap_server/eap_pax.o
    476 endif
    477 CONFIG_IEEE8021X_EAPOL=y
    478 endif
    479 
    480 ifdef CONFIG_EAP_SAKE
    481 # EAP-SAKE
    482 ifeq ($(CONFIG_EAP_SAKE), dyn)
    483 CFLAGS += -DEAP_SAKE_DYNAMIC
    484 EAPDYN += ../src/eap_peer/eap_sake.so
    485 else
    486 CFLAGS += -DEAP_SAKE
    487 OBJS += ../src/eap_peer/eap_sake.o ../src/eap_common/eap_sake_common.o
    488 OBJS_h += ../src/eap_server/eap_sake.o
    489 endif
    490 CONFIG_IEEE8021X_EAPOL=y
    491 endif
    492 
    493 ifdef CONFIG_EAP_GPSK
    494 # EAP-GPSK
    495 ifeq ($(CONFIG_EAP_GPSK), dyn)
    496 CFLAGS += -DEAP_GPSK_DYNAMIC
    497 EAPDYN += ../src/eap_peer/eap_gpsk.so
    498 else
    499 CFLAGS += -DEAP_GPSK
    500 OBJS += ../src/eap_peer/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o
    501 OBJS_h += ../src/eap_server/eap_gpsk.o
    502 endif
    503 CONFIG_IEEE8021X_EAPOL=y
    504 ifdef CONFIG_EAP_GPSK_SHA256
    505 CFLAGS += -DEAP_GPSK_SHA256
    506 endif
    507 NEED_SHA256=y
    508 endif
    509 
    510 ifdef CONFIG_WPS
    511 # EAP-WSC
    512 CFLAGS += -DCONFIG_WPS -DEAP_WSC
    513 OBJS += wps_supplicant.o
    514 OBJS += ../src/utils/uuid.o
    515 OBJS += ../src/eap_peer/eap_wsc.o ../src/eap_common/eap_wsc_common.o
    516 OBJS += ../src/wps/wps.o
    517 OBJS += ../src/wps/wps_common.o
    518 OBJS += ../src/wps/wps_attr_parse.o
    519 OBJS += ../src/wps/wps_attr_build.o
    520 OBJS += ../src/wps/wps_attr_process.o
    521 OBJS += ../src/wps/wps_dev_attr.o
    522 OBJS += ../src/wps/wps_enrollee.o
    523 OBJS += ../src/wps/wps_registrar.o
    524 OBJS_h += ../src/eap_server/eap_wsc.o
    525 CONFIG_IEEE8021X_EAPOL=y
    526 NEED_DH_GROUPS=y
    527 NEED_SHA256=y
    528 NEED_BASE64=y
    529 NEED_CRYPTO=y
    530 NEED_80211_COMMON=y
    531 
    532 ifdef CONFIG_WPS_UPNP
    533 CFLAGS += -DCONFIG_WPS_UPNP
    534 OBJS += ../src/wps/wps_upnp.o
    535 OBJS += ../src/wps/wps_upnp_ssdp.o
    536 OBJS += ../src/wps/wps_upnp_web.o
    537 OBJS += ../src/wps/wps_upnp_event.o
    538 OBJS += ../src/wps/httpread.o
    539 endif
    540 
    541 endif
    542 
    543 ifdef CONFIG_EAP_IKEV2
    544 # EAP-IKEv2
    545 ifeq ($(CONFIG_EAP_IKEV2), dyn)
    546 CFLAGS += -DEAP_IKEV2_DYNAMIC
    547 EAPDYN += ../src/eap_peer/eap_ikev2.so ../src/eap_peer/ikev2.o
    548 EAPDYN += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
    549 else
    550 CFLAGS += -DEAP_IKEV2
    551 OBJS += ../src/eap_peer/eap_ikev2.o ../src/eap_peer/ikev2.o
    552 OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
    553 OBJS_h += ../src/eap_server/eap_ikev2.o
    554 OBJS_h += ../src/eap_server/ikev2.o
    555 endif
    556 CONFIG_IEEE8021X_EAPOL=y
    557 NEED_DH_GROUPS=y
    558 NEED_DH_GROUPS_ALL=y
    559 endif
    560 
    561 ifdef CONFIG_EAP_VENDOR_TEST
    562 ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
    563 CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
    564 EAPDYN += ../src/eap_peer/eap_vendor_test.so
    565 else
    566 CFLAGS += -DEAP_VENDOR_TEST
    567 OBJS += ../src/eap_peer/eap_vendor_test.o
    568 OBJS_h += ../src/eap_server/eap_vendor_test.o
    569 endif
    570 CONFIG_IEEE8021X_EAPOL=y
    571 endif
    572 
    573 ifdef CONFIG_EAP_TNC
    574 # EAP-TNC
    575 CFLAGS += -DEAP_TNC
    576 OBJS += ../src/eap_peer/eap_tnc.o
    577 OBJS += ../src/eap_peer/tncc.o
    578 NEED_BASE64=y
    579 ifndef CONFIG_NATIVE_WINDOWS
    580 ifndef CONFIG_DRIVER_BSD
    581 LIBS += -ldl
    582 endif
    583 endif
    584 endif
    585 
    586 ifdef CONFIG_IEEE8021X_EAPOL
    587 # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
    588 CFLAGS += -DIEEE8021X_EAPOL
    589 OBJS += ../src/eapol_supp/eapol_supp_sm.o ../src/eap_peer/eap.o ../src/eap_common/eap_common.o ../src/eap_peer/eap_methods.o
    590 ifdef CONFIG_DYNAMIC_EAP_METHODS
    591 CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
    592 LIBS += -ldl -rdynamic
    593 endif
    594 endif
    595 
    596 ifdef CONFIG_EAP_SERVER
    597 CFLAGS += -DEAP_SERVER
    598 OBJS_h += ../src/eap_server/eap.o
    599 OBJS_h += ../src/eap_server/eap_identity.o
    600 OBJS_h += ../src/eap_server/eap_methods.o
    601 endif
    602 
    603 ifdef CONFIG_RADIUS_CLIENT
    604 OBJS_h += ../src/utils/ip_addr.o
    605 OBJS_h += ../src/radius/radius.o
    606 OBJS_h += ../src/radius/radius_client.o
    607 endif
    608 
    609 ifdef CONFIG_AUTHENTICATOR
    610 OBJS_h += ../hostapd/eapol_sm.o
    611 OBJS_h += ../hostapd/ieee802_1x.o
    612 endif
    613 
    614 ifdef CONFIG_WPA_AUTHENTICATOR
    615 OBJS_h += ../hostapd/wpa.o
    616 OBJS_h += ../hostapd/wpa_auth_ie.o
    617 ifdef CONFIG_IEEE80211R
    618 OBJS_h += ../hostapd/wpa_ft.o
    619 endif
    620 ifdef CONFIG_PEERKEY
    621 OBJS_h += ../hostapd/peerkey.o
    622 endif
    623 endif
    624 
    625 ifdef CONFIG_PCSC
    626 # PC/SC interface for smartcards (USIM, GSM SIM)
    627 CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
    628 OBJS += ../src/utils/pcsc_funcs.o
    629 # -lpthread may not be needed depending on how pcsc-lite was configured
    630 ifdef CONFIG_NATIVE_WINDOWS
    631 #Once MinGW gets support for WinScard, -lwinscard could be used instead of the
    632 #dynamic symbol loading that is now used in pcsc_funcs.c
    633 #LIBS += -lwinscard
    634 else
    635 LIBS += -lpcsclite -lpthread
    636 endif
    637 endif
    638 
    639 ifdef CONFIG_SIM_SIMULATOR
    640 CFLAGS += -DCONFIG_SIM_SIMULATOR
    641 NEED_MILENAGE=y
    642 endif
    643 
    644 ifdef CONFIG_USIM_SIMULATOR
    645 CFLAGS += -DCONFIG_USIM_SIMULATOR
    646 NEED_MILENAGE=y
    647 endif
    648 
    649 ifdef NEED_MILENAGE
    650 OBJS += ../src/hlr_auc_gw/milenage.o
    651 endif
    652 
    653 ifndef CONFIG_TLS
    654 CONFIG_TLS=openssl
    655 endif
    656 
    657 ifeq ($(CONFIG_TLS), internal)
    658 ifndef CONFIG_CRYPTO
    659 CONFIG_CRYPTO=internal
    660 endif
    661 endif
    662 ifeq ($(CONFIG_CRYPTO), libtomcrypt)
    663 CFLAGS += -DCONFIG_INTERNAL_X509
    664 endif
    665 ifeq ($(CONFIG_CRYPTO), internal)
    666 CFLAGS += -DCONFIG_INTERNAL_X509
    667 endif
    668 
    669 
    670 ifdef TLS_FUNCS
    671 # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
    672 CFLAGS += -DEAP_TLS_FUNCS
    673 OBJS += ../src/eap_peer/eap_tls_common.o
    674 OBJS_h += ../src/eap_server/eap_tls_common.o
    675 NEED_TLS_PRF=y
    676 ifeq ($(CONFIG_TLS), openssl)
    677 CFLAGS += -DEAP_TLS_OPENSSL
    678 OBJS += ../src/crypto/tls_openssl.o
    679 LIBS += -lssl -lcrypto
    680 LIBS_p += -lcrypto
    681 endif
    682 ifeq ($(CONFIG_TLS), gnutls)
    683 OBJS += ../src/crypto/tls_gnutls.o
    684 LIBS += -lgnutls -lgcrypt -lgpg-error
    685 LIBS_p += -lgcrypt
    686 ifdef CONFIG_GNUTLS_EXTRA
    687 CFLAGS += -DCONFIG_GNUTLS_EXTRA
    688 LIBS += -lgnutls-extra
    689 endif
    690 endif
    691 ifeq ($(CONFIG_TLS), schannel)
    692 OBJS += ../src/crypto/tls_schannel.o
    693 endif
    694 ifeq ($(CONFIG_TLS), internal)
    695 OBJS += ../src/crypto/tls_internal.o
    696 OBJS += ../src/tls/tlsv1_common.o ../src/tls/tlsv1_record.o
    697 OBJS += ../src/tls/tlsv1_cred.o ../src/tls/tlsv1_client.o
    698 OBJS += ../src/tls/tlsv1_client_write.o ../src/tls/tlsv1_client_read.o
    699 OBJS += ../src/tls/asn1.o ../src/tls/rsa.o ../src/tls/x509v3.o
    700 OBJS_p += ../src/tls/asn1.o ../src/tls/rsa.o
    701 OBJS_p += ../src/crypto/rc4.o ../src/crypto/aes_wrap.o ../src/crypto/aes.o
    702 NEED_BASE64=y
    703 NEED_TLS_PRF=y
    704 CFLAGS += -DCONFIG_TLS_INTERNAL
    705 CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
    706 ifeq ($(CONFIG_CRYPTO), internal)
    707 endif
    708 ifeq ($(CONFIG_CRYPTO), libtomcrypt)
    709 LIBS += -ltomcrypt -ltfm
    710 LIBS_p += -ltomcrypt -ltfm
    711 endif
    712 endif
    713 ifeq ($(CONFIG_TLS), none)
    714 OBJS += ../src/crypto/tls_none.o
    715 CFLAGS += -DEAP_TLS_NONE
    716 CONFIG_INTERNAL_AES=y
    717 CONFIG_INTERNAL_SHA1=y
    718 CONFIG_INTERNAL_MD5=y
    719 CONFIG_INTERNAL_SHA256=y
    720 endif
    721 ifdef CONFIG_SMARTCARD
    722 ifndef CONFIG_NATIVE_WINDOWS
    723 ifneq ($(CONFIG_L2_PACKET), freebsd)
    724 LIBS += -ldl
    725 endif
    726 endif
    727 endif
    728 NEED_CRYPTO=y
    729 else
    730 OBJS += ../src/crypto/tls_none.o
    731 endif
    732 
    733 ifdef CONFIG_PKCS12
    734 CFLAGS += -DPKCS12_FUNCS
    735 endif
    736 
    737 ifdef CONFIG_SMARTCARD
    738 CFLAGS += -DCONFIG_SMARTCARD
    739 endif
    740 
    741 ifdef MS_FUNCS
    742 OBJS += ../src/crypto/ms_funcs.o
    743 NEED_CRYPTO=y
    744 endif
    745 
    746 ifdef CHAP
    747 OBJS += ../src/eap_common/chap.o
    748 endif
    749 
    750 ifdef NEED_CRYPTO
    751 ifndef TLS_FUNCS
    752 ifeq ($(CONFIG_TLS), openssl)
    753 LIBS += -lcrypto
    754 LIBS_p += -lcrypto
    755 endif
    756 ifeq ($(CONFIG_TLS), gnutls)
    757 LIBS += -lgcrypt
    758 LIBS_p += -lgcrypt
    759 endif
    760 ifeq ($(CONFIG_TLS), schannel)
    761 endif
    762 ifeq ($(CONFIG_TLS), internal)
    763 ifeq ($(CONFIG_CRYPTO), libtomcrypt)
    764 LIBS += -ltomcrypt -ltfm
    765 LIBS_p += -ltomcrypt -ltfm
    766 endif
    767 endif
    768 endif
    769 ifeq ($(CONFIG_TLS), openssl)
    770 OBJS += ../src/crypto/crypto_openssl.o
    771 OBJS_p += ../src/crypto/crypto_openssl.o
    772 CONFIG_INTERNAL_SHA256=y
    773 endif
    774 ifeq ($(CONFIG_TLS), gnutls)
    775 OBJS += ../src/crypto/crypto_gnutls.o
    776 OBJS_p += ../src/crypto/crypto_gnutls.o
    777 CONFIG_INTERNAL_SHA256=y
    778 endif
    779 ifeq ($(CONFIG_TLS), schannel)
    780 OBJS += ../src/crypto/crypto_cryptoapi.o
    781 OBJS_p += ../src/crypto/crypto_cryptoapi.o
    782 CONFIG_INTERNAL_SHA256=y
    783 endif
    784 ifeq ($(CONFIG_TLS), internal)
    785 ifeq ($(CONFIG_CRYPTO), libtomcrypt)
    786 OBJS += ../src/crypto/crypto_libtomcrypt.o
    787 OBJS_p += ../src/crypto/crypto_libtomcrypt.o
    788 CONFIG_INTERNAL_SHA256=y
    789 endif
    790 ifeq ($(CONFIG_CRYPTO), internal)
    791 OBJS += ../src/crypto/crypto_internal.o ../src/tls/bignum.o
    792 OBJS_p += ../src/crypto/crypto_internal.o ../src/tls/bignum.o
    793 CFLAGS += -DCONFIG_CRYPTO_INTERNAL
    794 ifdef CONFIG_INTERNAL_LIBTOMMATH
    795 CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
    796 ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
    797 CFLAGS += -DLTM_FAST
    798 endif
    799 else
    800 LIBS += -ltommath
    801 LIBS_p += -ltommath
    802 endif
    803 CONFIG_INTERNAL_AES=y
    804 CONFIG_INTERNAL_DES=y
    805 CONFIG_INTERNAL_SHA1=y
    806 CONFIG_INTERNAL_MD4=y
    807 CONFIG_INTERNAL_MD5=y
    808 CONFIG_INTERNAL_SHA256=y
    809 endif
    810 ifeq ($(CONFIG_CRYPTO), cryptoapi)
    811 OBJS += ../src/crypto/crypto_cryptoapi.o
    812 OBJS_p += ../src/crypto/crypto_cryptoapi.o
    813 CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
    814 CONFIG_INTERNAL_SHA256=y
    815 endif
    816 endif
    817 ifeq ($(CONFIG_TLS), none)
    818 OBJS += ../src/crypto/crypto_none.o
    819 OBJS_p += ../src/crypto/crypto_none.o
    820 CONFIG_INTERNAL_SHA256=y
    821 endif
    822 else
    823 CONFIG_INTERNAL_AES=y
    824 CONFIG_INTERNAL_SHA1=y
    825 CONFIG_INTERNAL_MD5=y
    826 endif
    827 
    828 ifdef CONFIG_INTERNAL_AES
    829 CFLAGS += -DINTERNAL_AES
    830 endif
    831 ifdef CONFIG_INTERNAL_SHA1
    832 CFLAGS += -DINTERNAL_SHA1
    833 endif
    834 ifdef CONFIG_INTERNAL_SHA256
    835 CFLAGS += -DINTERNAL_SHA256
    836 endif
    837 ifdef CONFIG_INTERNAL_MD5
    838 CFLAGS += -DINTERNAL_MD5
    839 endif
    840 ifdef CONFIG_INTERNAL_MD4
    841 CFLAGS += -DINTERNAL_MD4
    842 endif
    843 ifdef CONFIG_INTERNAL_DES
    844 CFLAGS += -DINTERNAL_DES
    845 endif
    846 
    847 ifdef CONFIG_IEEE80211R
    848 NEED_SHA256=y
    849 endif
    850 
    851 ifdef CONFIG_IEEE80211W
    852 CFLAGS += -DCONFIG_IEEE80211W
    853 NEED_SHA256=y
    854 endif
    855 
    856 ifdef NEED_SHA256
    857 OBJS += ../src/crypto/sha256.o
    858 CFLAGS += -DNEED_SHA256
    859 endif
    860 
    861 ifdef CONFIG_WIRELESS_EXTENSION
    862 OBJS_d += ../src/drivers/driver_wext.o
    863 endif
    864 
    865 ifdef CONFIG_CTRL_IFACE
    866 ifeq ($(CONFIG_CTRL_IFACE), y)
    867 ifdef CONFIG_NATIVE_WINDOWS
    868 CONFIG_CTRL_IFACE=named_pipe
    869 else
    870 CONFIG_CTRL_IFACE=unix
    871 endif
    872 endif
    873 CFLAGS += -DCONFIG_CTRL_IFACE
    874 ifeq ($(CONFIG_CTRL_IFACE), unix)
    875 CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
    876 endif
    877 ifeq ($(CONFIG_CTRL_IFACE), udp)
    878 CFLAGS += -DCONFIG_CTRL_IFACE_UDP
    879 endif
    880 ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
    881 CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
    882 endif
    883 OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o
    884 endif
    885 
    886 ifdef CONFIG_CTRL_IFACE_DBUS
    887 CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
    888 OBJS += ctrl_iface_dbus.o ctrl_iface_dbus_handlers.o dbus_dict_helpers.o
    889 ifndef DBUS_LIBS
    890 DBUS_LIBS := $(shell pkg-config --libs dbus-1)
    891 endif
    892 LIBS += $(DBUS_LIBS)
    893 ifndef DBUS_INCLUDE
    894 DBUS_INCLUDE := $(shell pkg-config --cflags dbus-1)
    895 endif
    896 dbus_version=$(subst ., ,$(shell pkg-config --modversion dbus-1))
    897 DBUS_VERSION_MAJOR=$(word 1,$(dbus_version))
    898 DBUS_VERSION_MINOR=$(word 2,$(dbus_version))
    899 ifeq ($(DBUS_VERSION_MAJOR),)
    900 DBUS_VERSION_MAJOR=0
    901 endif
    902 ifeq ($(DBUS_VERSION_MINOR),)
    903 DBUS_VERSION_MINOR=0
    904 endif
    905 DBUS_INCLUDE += -DDBUS_VERSION_MAJOR=$(DBUS_VERSION_MAJOR)
    906 DBUS_INCLUDE += -DDBUS_VERSION_MINOR=$(DBUS_VERSION_MINOR)
    907 CFLAGS += $(DBUS_INCLUDE)
    908 endif
    909 
    910 ifdef CONFIG_READLINE
    911 CFLAGS += -DCONFIG_READLINE
    912 LIBS_c += -lncurses -lreadline
    913 endif
    914 
    915 ifdef CONFIG_NATIVE_WINDOWS
    916 CFLAGS += -DCONFIG_NATIVE_WINDOWS
    917 LIBS += -lws2_32 -lgdi32 -lcrypt32
    918 LIBS_c += -lws2_32
    919 LIBS_p += -lws2_32 -lgdi32
    920 ifeq ($(CONFIG_CRYPTO), cryptoapi)
    921 LIBS_p += -lcrypt32
    922 endif
    923 endif
    924 
    925 ifdef CONFIG_NO_STDOUT_DEBUG
    926 CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
    927 ifndef CONFIG_CTRL_IFACE
    928 CFLAGS += -DCONFIG_NO_WPA_MSG
    929 endif
    930 endif
    931 
    932 ifdef CONFIG_IPV6
    933 # for eapol_test only
    934 CFLAGS += -DCONFIG_IPV6
    935 endif
    936 
    937 ifdef CONFIG_PEERKEY
    938 CFLAGS += -DCONFIG_PEERKEY
    939 endif
    940 
    941 ifdef CONFIG_IEEE80211R
    942 CFLAGS += -DCONFIG_IEEE80211R
    943 OBJS += ../src/rsn_supp/wpa_ft.o
    944 endif
    945 
    946 ifndef CONFIG_NO_WPA
    947 OBJS += ../src/rsn_supp/wpa.o
    948 OBJS += ../src/rsn_supp/preauth.o
    949 OBJS += ../src/rsn_supp/pmksa_cache.o
    950 OBJS += ../src/rsn_supp/peerkey.o
    951 OBJS += ../src/rsn_supp/wpa_ie.o
    952 OBJS += ../src/common/wpa_common.o
    953 NEED_AES=y
    954 else
    955 CFLAGS += -DCONFIG_NO_WPA -DCONFIG_NO_WPA2
    956 endif
    957 
    958 ifdef CONFIG_NO_WPA2
    959 CFLAGS += -DCONFIG_NO_WPA2
    960 endif
    961 
    962 ifdef CONFIG_NO_WPA_PASSPHRASE
    963 CFLAGS += -DCONFIG_NO_PBKDF2
    964 endif
    965 
    966 ifdef CONFIG_NO_AES_EXTRAS
    967 CFLAGS += -DCONFIG_NO_AES_WRAP
    968 CFLAGS += -DCONFIG_NO_AES_CTR -DCONFIG_NO_AES_OMAC1
    969 CFLAGS += -DCONFIG_NO_AES_EAX -DCONFIG_NO_AES_CBC
    970 CFLAGS += -DCONFIG_NO_AES_ENCRYPT
    971 CFLAGS += -DCONFIG_NO_AES_ENCRYPT_BLOCK
    972 endif
    973 
    974 ifdef NEED_AES
    975 OBJS += ../src/crypto/aes_wrap.o ../src/crypto/aes.o
    976 endif
    977 
    978 ifdef NEED_DH_GROUPS
    979 OBJS += ../src/crypto/dh_groups.o
    980 ifdef NEED_DH_GROUPS_ALL
    981 CFLAGS += -DALL_DH_GROUPS
    982 endif
    983 endif
    984 
    985 ifndef NEED_FIPS186_2_PRF
    986 CFLAGS += -DCONFIG_NO_FIPS186_2_PRF
    987 endif
    988 
    989 ifndef NEED_T_PRF
    990 CFLAGS += -DCONFIG_NO_T_PRF
    991 endif
    992 
    993 ifndef NEED_TLS_PRF
    994 CFLAGS += -DCONFIG_NO_TLS_PRF
    995 endif
    996 
    997 ifdef NEED_BASE64
    998 OBJS += ../src/utils/base64.o
    999 endif
   1000 
   1001 ifdef CONFIG_CLIENT_MLME
   1002 OBJS += mlme.o ../src/common/ieee802_11_common.o
   1003 CFLAGS += -DCONFIG_CLIENT_MLME
   1004 endif
   1005 
   1006 ifndef CONFIG_MAIN
   1007 CONFIG_MAIN=main
   1008 endif
   1009 
   1010 ifdef CONFIG_DEBUG_SYSLOG
   1011 CFLAGS += -DCONFIG_DEBUG_SYSLOG
   1012 endif
   1013 
   1014 ifdef CONFIG_DEBUG_FILE
   1015 CFLAGS += -DCONFIG_DEBUG_FILE
   1016 endif
   1017 
   1018 ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
   1019 CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
   1020 endif
   1021 
   1022 OBJS += ../src/drivers/scan_helpers.o
   1023 
   1024 OBJS_wpa_rm := ctrl_iface.o mlme.o ctrl_iface_unix.o
   1025 OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.o
   1026 ifdef CONFIG_AUTHENTICATOR
   1027 OBJS_wpa += tests/link_test.o
   1028 endif
   1029 OBJS_wpa += $(OBJS_l2)
   1030 OBJS += wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o
   1031 OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o ../src/radius/radius.o ../src/radius/radius_client.o
   1032 OBJS_t += ../src/utils/ip_addr.o
   1033 OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o
   1034 OBJS += $(CONFIG_MAIN).o
   1035 
   1036 ifdef CONFIG_PRIVSEP
   1037 OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o ../src/drivers/scan_helpers.o
   1038 OBJS_priv += $(OBJS_l2)
   1039 OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
   1040 OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
   1041 OBJS_priv += ../src/utils/common.o
   1042 OBJS_priv += ../src/utils/wpa_debug.o
   1043 OBJS_priv += ../src/utils/wpabuf.o
   1044 OBJS_priv += wpa_priv.o
   1045 ifdef CONFIG_DRIVER_TEST
   1046 OBJS_priv += ../src/crypto/sha1.o
   1047 OBJS_priv += ../src/crypto/md5.o
   1048 ifeq ($(CONFIG_TLS), openssl)
   1049 OBJS_priv += ../src/crypto/crypto_openssl.o
   1050 endif
   1051 ifeq ($(CONFIG_TLS), gnutls)
   1052 OBJS_priv += ../src/crypto/crypto_gnutls.o
   1053 endif
   1054 ifeq ($(CONFIG_TLS), internal)
   1055 ifeq ($(CONFIG_CRYPTO), libtomcrypt)
   1056 OBJS_priv += ../src/crypto/crypto_libtomcrypt.o
   1057 else
   1058 OBJS_priv += ../src/crypto/crypto_internal.o
   1059 endif
   1060 endif
   1061 endif # CONFIG_DRIVER_TEST
   1062 OBJS += ../src/l2_packet/l2_packet_privsep.o
   1063 OBJS += ../src/drivers/driver_privsep.o
   1064 EXTRA_progs += wpa_priv
   1065 else
   1066 OBJS += $(OBJS_d) ../src/drivers/drivers.o
   1067 OBJS += $(OBJS_l2)
   1068 endif
   1069 
   1070 ifdef CONFIG_NDIS_EVENTS_INTEGRATED
   1071 CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
   1072 OBJS += ../src/drivers/ndis_events.o
   1073 EXTRALIBS += -loleaut32 -lole32 -luuid
   1074 ifdef PLATFORMSDKLIB
   1075 EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
   1076 else
   1077 EXTRALIBS += WbemUuid.Lib
   1078 endif
   1079 endif
   1080 
   1081 ifndef LDO
   1082 LDO=$(CC)
   1083 endif
   1084 
   1085 dynamic_eap_methods: $(EAPDYN)
   1086 
   1087 wpa_priv: $(OBJS_priv)
   1088 	$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
   1089 
   1090 wpa_supplicant: .config $(OBJS) $(EXTRA_progs)
   1091 	$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
   1092 
   1093 eapol_test: .config $(OBJS_t)
   1094 	$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
   1095 
   1096 preauth_test: .config $(OBJS_t2) 
   1097 	$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
   1098 
   1099 wpa_passphrase: $(OBJS_p)
   1100 	$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p)
   1101 
   1102 wpa_cli: $(OBJS_c)
   1103 	$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
   1104 
   1105 link_test: $(OBJS) $(OBJS_h) tests/link_test.o
   1106 	$(LDO) $(LDFLAGS) -o link_test $(OBJS) $(OBJS_h) tests/link_test.o $(LIBS)
   1107 
   1108 test_wpa: $(OBJS_wpa) $(OBJS_h)
   1109 	$(LDO) $(LDFLAGS) -o test_wpa $(OBJS_wpa) $(LIBS)
   1110 
   1111 OBJSa=../src/tls/asn1_test.o ../src/tls/asn1.o ../src/tls/x509v3.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_unix.o \
   1112 	../src/crypto/crypto_$(CONFIG_CRYPTO).o ../src/crypto/md5.o ../src/crypto/sha1.o \
   1113 	../src/crypto/rc4.o ../src/crypto/des.o ../src/crypto/aes_wrap.o \
   1114 	../src/crypto/aes.o ../src/tls/bignum.o ../src/tls/rsa.o
   1115 asn1_test: $(OBJSa)
   1116 	$(LDO) $(LDFLAGS) -o asn1_test $(OBJSa)
   1117 
   1118 OBJSx=tests/test_x509v3.o ../src/tls/asn1.o ../src/tls/x509v3.o \
   1119 	../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_unix.o \
   1120 	../src/crypto/crypto_$(CONFIG_CRYPTO).o \
   1121 	../src/crypto/md5.o ../src/crypto/sha1.o ../src/crypto/aes.o \
   1122 	../src/crypto/rc4.o ../src/crypto/des.o ../src/crypto/aes_wrap.o \
   1123 	../src/crypto/sha256.o \
   1124 	../src/tls/bignum.o ../src/tls/rsa.o
   1125 test_x509v3: $(OBJSx)
   1126 	$(LDO) $(LDFLAGS) -o test_x509v3 $(OBJSx)
   1127 
   1128 win_if_list: win_if_list.c
   1129 	$(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
   1130 
   1131 eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c
   1132 	$(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
   1133 		-Deap_peer_psk_register=eap_peer_method_dynamic_init
   1134 
   1135 eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c
   1136 	$(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
   1137 		-Deap_peer_pax_register=eap_peer_method_dynamic_init
   1138 
   1139 eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c
   1140 	$(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
   1141 		-Deap_peer_sake_register=eap_peer_method_dynamic_init
   1142 
   1143 eap_wsc.so: ../src/eap_peer/eap_wsc.c ../src/eap_common/eap_wsc_common.c ../src/wps/wps.c
   1144 	$(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
   1145 		-Deap_peer_wsc_register=eap_peer_method_dynamic_init
   1146 
   1147 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
   1148 	$(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
   1149 		-Deap_peer_ikev2_register=eap_peer_method_dynamic_init
   1150 
   1151 %.so: %.c
   1152 	$(CC) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
   1153 		-D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
   1154 
   1155 Q=@
   1156 E=echo
   1157 ifeq ($(V), 1)
   1158 Q=
   1159 E=true
   1160 endif
   1161 
   1162 %.o: %.c
   1163 	$(Q)$(CC) -c -o $@ $(CFLAGS) $<
   1164 	@$(E) "  CC " $<
   1165 
   1166 wpa_supplicant.exe: wpa_supplicant
   1167 	mv -f $< $@
   1168 wpa_cli.exe: wpa_cli
   1169 	mv -f $< $@
   1170 wpa_passphrase.exe: wpa_passphrase
   1171 	mv -f $< $@
   1172 win_if_list.exe: win_if_list
   1173 	mv -f $< $@
   1174 eapol_test.exe: eapol_test
   1175 	mv -f $< $@
   1176 
   1177 WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe
   1178 
   1179 windows-bin: $(WINALL)
   1180 	$(STRIP) $(WINALL)
   1181 
   1182 wpa_gui/Makefile:
   1183 	qmake -o wpa_gui/Makefile wpa_gui/wpa_gui.pro 
   1184 
   1185 wpa_gui: wpa_gui/Makefile
   1186 	$(MAKE) -C wpa_gui
   1187 
   1188 wpa_gui-qt4/Makefile:
   1189 	qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro 
   1190 
   1191 wpa_gui-qt4: wpa_gui-qt4/Makefile
   1192 	$(MAKE) -C wpa_gui-qt4
   1193 
   1194 TEST_MS_FUNCS_OBJS = ../src/crypto/crypto_openssl.o ../src/crypto/sha1.o ../src/crypto/md5.o \
   1195 	../src/utils/os_unix.o ../src/crypto/rc4.o tests/test_ms_funcs.o
   1196 test-ms_funcs: $(TEST_MS_FUNCS_OBJS)
   1197 	$(LDO) $(LDFLAGS) -o $@ $(TEST_MS_FUNCS_OBJS) $(LIBS) -lcrypto
   1198 	./test-ms_funcs
   1199 	rm test-ms_funcs
   1200 
   1201 TEST_SHA1_OBJS = ../src/crypto/sha1.o ../src/crypto/md5.o tests/test_sha1.o #../src/crypto/crypto_openssl.o
   1202 test-sha1: $(TEST_SHA1_OBJS)
   1203 	$(LDO) $(LDFLAGS) -o $@ $(TEST_SHA1_OBJS) $(LIBS)
   1204 	./test-sha1
   1205 	rm test-sha1
   1206 
   1207 TEST_SHA256_OBJS = ../src/crypto/sha256.o ../src/crypto/md5.o tests/test_sha256.o ../src/utils/os_unix.o ../src/crypto/crypto_openssl.o
   1208 test-sha256: $(TEST_SHA256_OBJS)
   1209 	$(LDO) $(LDFLAGS) -o $@ $(TEST_SHA256_OBJS) $(LIBS)
   1210 	./test-sha256
   1211 	rm test-sha256
   1212 
   1213 TEST_AES_OBJS = ../src/crypto/aes_wrap.o ../src/crypto/aes.o tests/test_aes.o
   1214 test-aes: $(TEST_AES_OBJS)
   1215 	$(LDO) $(LDFLAGS) -o $@ $(TEST_AES_OBJS) $(LIBS)
   1216 	./test-aes
   1217 	rm test-aes
   1218 
   1219 TEST_EAP_SIM_COMMON_OBJS = ../src/crypto/sha1.o ../src/crypto/md5.o \
   1220 	../src/crypto/aes_wrap.o ../src/utils/common.o ../src/utils/os_unix.o \
   1221 	../src/utils/wpa_debug.o ../src/crypto/aes.o \
   1222 	tests/test_eap_sim_common.o
   1223 test-eap_sim_common: $(TEST_EAP_SIM_COMMON_OBJS)
   1224 	$(LDO) $(LDFLAGS) -o $@ $(TEST_AES_OBJS) $(LIBS)
   1225 	./test-eap_sim_common
   1226 	rm test-eap_sim_common
   1227 
   1228 TEST_MD4_OBJS = ../src/crypto/md4.o tests/test_md4.o #../src/crypto/crypto_openssl.o
   1229 test-md4: $(TEST_MD4_OBJS)
   1230 	$(LDO) $(LDFLAGS) -o $@ $(TEST_MD4_OBJS) $(LIBS)
   1231 	./test-md4
   1232 	rm test-md4
   1233 
   1234 TEST_MD5_OBJS = ../src/crypto/md5.o tests/test_md5.o #../src/crypto/crypto_openssl.o
   1235 test-md5: $(TEST_MD5_OBJS)
   1236 	$(LDO) $(LDFLAGS) -o $@ $(TEST_MD5_OBJS) $(LIBS)
   1237 	./test-md5
   1238 	rm test-md5
   1239 
   1240 tests: test-ms_funcs test-sha1 test-aes test-eap_sim_common test-md4 test-md5
   1241 
   1242 clean:
   1243 	$(MAKE) -C ../src clean
   1244 	rm -f core *~ *.o *.d eap_*.so $(ALL) $(WINALL) eapol_test preauth_test
   1245 	rm -f wpa_priv
   1246 
   1247 %.eps: %.fig
   1248 	fig2dev -L eps $*.fig $*.eps
   1249 
   1250 %.png: %.fig
   1251 	fig2dev -L png -m 3 $*.fig | pngtopnm | pnmscale 0.4 | pnmtopng \
   1252 		> $*.png
   1253 
   1254 docs-pics: doc/wpa_supplicant.png doc/wpa_supplicant.eps
   1255 
   1256 docs: docs-pics
   1257 	(cd ..; doxygen wpa_supplicant/doc/doxygen.full; cd wpa_supplicant)
   1258 	$(MAKE) -C doc/latex
   1259 	cp doc/latex/refman.pdf wpa_supplicant-devel.pdf
   1260 
   1261 docs-fast: docs-pics
   1262 	(cd ..; doxygen wpa_supplicant/doc/doxygen.fast; cd wpa_supplicant)
   1263 
   1264 clean-docs:
   1265 	rm -rf doc/latex doc/html
   1266 	rm -f doc/wpa_supplicant.{eps,png} wpa_supplicant-devel.pdf
   1267 
   1268 -include $(OBJS:%.o=%.d)
   1269