1 ifndef CC 2 CC=gcc 3 endif 4 5 ifndef CFLAGS 6 CFLAGS = -MMD -O2 -Wall -g 7 endif 8 9 CFLAGS += -I../src 10 CFLAGS += -I../src/utils 11 12 # Uncomment following line and set the path to your kernel tree include 13 # directory if your C library does not include all header files. 14 # CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include 15 16 -include .config 17 18 ifndef CONFIG_OS 19 ifdef CONFIG_NATIVE_WINDOWS 20 CONFIG_OS=win32 21 else 22 CONFIG_OS=unix 23 endif 24 endif 25 26 ifeq ($(CONFIG_OS), internal) 27 CFLAGS += -DOS_NO_C_LIB_DEFINES 28 endif 29 30 ifdef CONFIG_NATIVE_WINDOWS 31 CFLAGS += -DCONFIG_NATIVE_WINDOWS 32 LIBS += -lws2_32 33 endif 34 35 OBJS += main.o 36 OBJS += config_file.o 37 38 OBJS += ../src/ap/hostapd.o 39 OBJS += ../src/ap/wpa_auth_glue.o 40 OBJS += ../src/ap/drv_callbacks.o 41 OBJS += ../src/ap/ap_drv_ops.o 42 OBJS += ../src/ap/utils.o 43 OBJS += ../src/ap/authsrv.o 44 OBJS += ../src/ap/ieee802_1x.o 45 OBJS += ../src/ap/ap_config.o 46 OBJS += ../src/ap/ieee802_11_auth.o 47 OBJS += ../src/ap/sta_info.o 48 OBJS += ../src/ap/wpa_auth.o 49 OBJS += ../src/ap/tkip_countermeasures.o 50 OBJS += ../src/ap/ap_mlme.o 51 OBJS += ../src/ap/wpa_auth_ie.o 52 OBJS += ../src/ap/preauth_auth.o 53 OBJS += ../src/ap/pmksa_cache_auth.o 54 OBJS += ../src/ap/ieee802_11_shared.o 55 OBJS += ../src/ap/beacon.o 56 57 OBJS_c = hostapd_cli.o ../src/common/wpa_ctrl.o ../src/utils/os_$(CONFIG_OS).o 58 59 NEED_RC4=y 60 NEED_AES=y 61 NEED_MD5=y 62 NEED_SHA1=y 63 64 OBJS += ../src/drivers/drivers.o 65 CFLAGS += -DHOSTAPD 66 67 ifdef CONFIG_WPA_TRACE 68 CFLAGS += -DWPA_TRACE 69 OBJS += ../src/utils/trace.o 70 HOBJS += ../src/utils/trace.o 71 LDFLAGS += -rdynamic 72 CFLAGS += -funwind-tables 73 ifdef CONFIG_WPA_TRACE_BFD 74 CFLAGS += -DWPA_TRACE_BFD 75 LIBS += -lbfd 76 LIBS_c += -lbfd 77 LIBS_h += -lbfd 78 endif 79 endif 80 81 ifndef CONFIG_ELOOP 82 CONFIG_ELOOP=eloop 83 endif 84 OBJS += ../src/utils/$(CONFIG_ELOOP).o 85 OBJS_c += ../src/utils/$(CONFIG_ELOOP).o 86 OBJS += ../src/utils/common.o 87 OBJS += ../src/utils/wpa_debug.o 88 OBJS_c += ../src/utils/wpa_debug.o 89 OBJS += ../src/utils/wpabuf.o 90 OBJS += ../src/utils/os_$(CONFIG_OS).o 91 OBJS += ../src/utils/ip_addr.o 92 93 OBJS += ../src/common/ieee802_11_common.o 94 OBJS += ../src/common/wpa_common.o 95 96 OBJS += ../src/eapol_auth/eapol_auth_sm.o 97 98 99 ifndef CONFIG_NO_DUMP_STATE 100 # define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to 101 # a file (undefine it, if you want to save in binary size) 102 CFLAGS += -DHOSTAPD_DUMP_STATE 103 OBJS += dump_state.o 104 OBJS += ../src/eapol_auth/eapol_auth_dump.o 105 endif 106 107 ifdef CONFIG_NO_RADIUS 108 CFLAGS += -DCONFIG_NO_RADIUS 109 CONFIG_NO_ACCOUNTING=y 110 else 111 OBJS += ../src/radius/radius.o 112 OBJS += ../src/radius/radius_client.o 113 endif 114 115 ifdef CONFIG_NO_ACCOUNTING 116 CFLAGS += -DCONFIG_NO_ACCOUNTING 117 else 118 OBJS += ../src/ap/accounting.o 119 endif 120 121 ifdef CONFIG_NO_VLAN 122 CFLAGS += -DCONFIG_NO_VLAN 123 else 124 OBJS += ../src/ap/vlan_init.o 125 endif 126 127 ifdef CONFIG_NO_CTRL_IFACE 128 CFLAGS += -DCONFIG_NO_CTRL_IFACE 129 else 130 OBJS += ctrl_iface.o 131 OBJS += ../src/ap/ctrl_iface_ap.o 132 endif 133 134 OBJS += ../src/crypto/md5.o 135 136 CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX 137 138 ifdef CONFIG_IAPP 139 CFLAGS += -DCONFIG_IAPP 140 OBJS += ../src/ap/iapp.o 141 endif 142 143 ifdef CONFIG_RSN_PREAUTH 144 CFLAGS += -DCONFIG_RSN_PREAUTH 145 CONFIG_L2_PACKET=y 146 endif 147 148 ifdef CONFIG_PEERKEY 149 CFLAGS += -DCONFIG_PEERKEY 150 OBJS += ../src/ap/peerkey_auth.o 151 endif 152 153 ifdef CONFIG_IEEE80211W 154 CFLAGS += -DCONFIG_IEEE80211W 155 NEED_SHA256=y 156 NEED_AES_OMAC1=y 157 endif 158 159 ifdef CONFIG_IEEE80211R 160 CFLAGS += -DCONFIG_IEEE80211R 161 OBJS += ../src/ap/wpa_auth_ft.o 162 NEED_SHA256=y 163 NEED_AES_OMAC1=y 164 NEED_AES_UNWRAP=y 165 endif 166 167 ifdef CONFIG_IEEE80211N 168 CFLAGS += -DCONFIG_IEEE80211N 169 endif 170 171 include ../src/drivers/drivers.mak 172 OBJS += $(DRV_AP_OBJS) 173 CFLAGS += $(DRV_AP_CFLAGS) 174 LDFLAGS += $(DRV_AP_LDFLAGS) 175 LIBS += $(DRV_AP_LIBS) 176 177 ifdef CONFIG_L2_PACKET 178 ifdef CONFIG_DNET_PCAP 179 ifdef CONFIG_L2_FREEBSD 180 LIBS += -lpcap 181 OBJS += ../src/l2_packet/l2_packet_freebsd.o 182 else 183 LIBS += -ldnet -lpcap 184 OBJS += ../src/l2_packet/l2_packet_pcap.o 185 endif 186 else 187 OBJS += ../src/l2_packet/l2_packet_linux.o 188 endif 189 else 190 OBJS += ../src/l2_packet/l2_packet_none.o 191 endif 192 193 194 ifdef CONFIG_EAP_MD5 195 CFLAGS += -DEAP_SERVER_MD5 196 OBJS += ../src/eap_server/eap_server_md5.o 197 CHAP=y 198 endif 199 200 ifdef CONFIG_EAP_TLS 201 CFLAGS += -DEAP_SERVER_TLS 202 OBJS += ../src/eap_server/eap_server_tls.o 203 TLS_FUNCS=y 204 endif 205 206 ifdef CONFIG_EAP_PEAP 207 CFLAGS += -DEAP_SERVER_PEAP 208 OBJS += ../src/eap_server/eap_server_peap.o 209 OBJS += ../src/eap_common/eap_peap_common.o 210 TLS_FUNCS=y 211 CONFIG_EAP_MSCHAPV2=y 212 endif 213 214 ifdef CONFIG_EAP_TTLS 215 CFLAGS += -DEAP_SERVER_TTLS 216 OBJS += ../src/eap_server/eap_server_ttls.o 217 TLS_FUNCS=y 218 CHAP=y 219 endif 220 221 ifdef CONFIG_EAP_MSCHAPV2 222 CFLAGS += -DEAP_SERVER_MSCHAPV2 223 OBJS += ../src/eap_server/eap_server_mschapv2.o 224 MS_FUNCS=y 225 endif 226 227 ifdef CONFIG_EAP_GTC 228 CFLAGS += -DEAP_SERVER_GTC 229 OBJS += ../src/eap_server/eap_server_gtc.o 230 endif 231 232 ifdef CONFIG_EAP_SIM 233 CFLAGS += -DEAP_SERVER_SIM 234 OBJS += ../src/eap_server/eap_server_sim.o 235 CONFIG_EAP_SIM_COMMON=y 236 NEED_AES_CBC=y 237 endif 238 239 ifdef CONFIG_EAP_AKA 240 CFLAGS += -DEAP_SERVER_AKA 241 OBJS += ../src/eap_server/eap_server_aka.o 242 CONFIG_EAP_SIM_COMMON=y 243 NEED_SHA256=y 244 NEED_AES_CBC=y 245 endif 246 247 ifdef CONFIG_EAP_AKA_PRIME 248 CFLAGS += -DEAP_SERVER_AKA_PRIME 249 endif 250 251 ifdef CONFIG_EAP_SIM_COMMON 252 OBJS += ../src/eap_common/eap_sim_common.o 253 # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be 254 # replaced with another file implementating the interface specified in 255 # eap_sim_db.h. 256 OBJS += ../src/eap_server/eap_sim_db.o 257 NEED_FIPS186_2_PRF=y 258 endif 259 260 ifdef CONFIG_EAP_PAX 261 CFLAGS += -DEAP_SERVER_PAX 262 OBJS += ../src/eap_server/eap_server_pax.o ../src/eap_common/eap_pax_common.o 263 endif 264 265 ifdef CONFIG_EAP_PSK 266 CFLAGS += -DEAP_SERVER_PSK 267 OBJS += ../src/eap_server/eap_server_psk.o ../src/eap_common/eap_psk_common.o 268 NEED_AES_OMAC1=y 269 NEED_AES_ENCBLOCK=y 270 NEED_AES_EAX=y 271 endif 272 273 ifdef CONFIG_EAP_SAKE 274 CFLAGS += -DEAP_SERVER_SAKE 275 OBJS += ../src/eap_server/eap_server_sake.o ../src/eap_common/eap_sake_common.o 276 endif 277 278 ifdef CONFIG_EAP_GPSK 279 CFLAGS += -DEAP_SERVER_GPSK 280 OBJS += ../src/eap_server/eap_server_gpsk.o ../src/eap_common/eap_gpsk_common.o 281 ifdef CONFIG_EAP_GPSK_SHA256 282 CFLAGS += -DEAP_SERVER_GPSK_SHA256 283 endif 284 NEED_SHA256=y 285 NEED_AES_OMAC1=y 286 endif 287 288 ifdef CONFIG_EAP_PWD 289 CFLAGS += -DEAP_SERVER_PWD 290 OBJS += ../src/eap_server/eap_server_pwd.o ../src/eap_common/eap_pwd_common.o 291 NEED_SHA256=y 292 endif 293 294 ifdef CONFIG_EAP_VENDOR_TEST 295 CFLAGS += -DEAP_SERVER_VENDOR_TEST 296 OBJS += ../src/eap_server/eap_server_vendor_test.o 297 endif 298 299 ifdef CONFIG_EAP_FAST 300 CFLAGS += -DEAP_SERVER_FAST 301 OBJS += ../src/eap_server/eap_server_fast.o 302 OBJS += ../src/eap_common/eap_fast_common.o 303 TLS_FUNCS=y 304 NEED_T_PRF=y 305 NEED_AES_UNWRAP=y 306 endif 307 308 ifdef CONFIG_WPS 309 ifdef CONFIG_WPS2 310 CFLAGS += -DCONFIG_WPS2 311 endif 312 313 CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC 314 OBJS += ../src/utils/uuid.o 315 OBJS += ../src/ap/wps_hostapd.o 316 OBJS += ../src/eap_server/eap_server_wsc.o ../src/eap_common/eap_wsc_common.o 317 OBJS += ../src/wps/wps.o 318 OBJS += ../src/wps/wps_common.o 319 OBJS += ../src/wps/wps_attr_parse.o 320 OBJS += ../src/wps/wps_attr_build.o 321 OBJS += ../src/wps/wps_attr_process.o 322 OBJS += ../src/wps/wps_dev_attr.o 323 OBJS += ../src/wps/wps_enrollee.o 324 OBJS += ../src/wps/wps_registrar.o 325 NEED_DH_GROUPS=y 326 NEED_SHA256=y 327 NEED_BASE64=y 328 NEED_AES_CBC=y 329 NEED_MODEXP=y 330 CONFIG_EAP=y 331 332 ifdef CONFIG_WPS_UFD 333 CFLAGS += -DCONFIG_WPS_UFD 334 OBJS += ../src/wps/wps_ufd.o 335 NEED_WPS_OOB=y 336 endif 337 338 ifdef CONFIG_WPS_NFC 339 CFLAGS += -DCONFIG_WPS_NFC 340 OBJS += ../src/wps/ndef.o 341 OBJS += ../src/wps/wps_nfc.o 342 NEED_WPS_OOB=y 343 ifdef CONFIG_WPS_NFC_PN531 344 PN531_PATH ?= /usr/local/src/nfc 345 CFLAGS += -DCONFIG_WPS_NFC_PN531 346 CFLAGS += -I${PN531_PATH}/inc 347 OBJS += ../src/wps/wps_nfc_pn531.o 348 LIBS += ${PN531_PATH}/lib/wpsnfc.dll 349 LIBS += ${PN531_PATH}/lib/libnfc_mapping_pn53x.dll 350 endif 351 endif 352 353 ifdef NEED_WPS_OOB 354 CFLAGS += -DCONFIG_WPS_OOB 355 endif 356 357 ifdef CONFIG_WPS_UPNP 358 CFLAGS += -DCONFIG_WPS_UPNP 359 OBJS += ../src/wps/wps_upnp.o 360 OBJS += ../src/wps/wps_upnp_ssdp.o 361 OBJS += ../src/wps/wps_upnp_web.o 362 OBJS += ../src/wps/wps_upnp_event.o 363 OBJS += ../src/wps/wps_upnp_ap.o 364 OBJS += ../src/wps/upnp_xml.o 365 OBJS += ../src/wps/httpread.o 366 OBJS += ../src/wps/http_client.o 367 OBJS += ../src/wps/http_server.o 368 endif 369 370 ifdef CONFIG_WPS_STRICT 371 CFLAGS += -DCONFIG_WPS_STRICT 372 OBJS += ../src/wps/wps_validate.o 373 endif 374 375 ifdef CONFIG_WPS_TESTING 376 CFLAGS += -DCONFIG_WPS_TESTING 377 endif 378 379 endif 380 381 ifdef CONFIG_EAP_IKEV2 382 CFLAGS += -DEAP_SERVER_IKEV2 383 OBJS += ../src/eap_server/eap_server_ikev2.o ../src/eap_server/ikev2.o 384 OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o 385 NEED_DH_GROUPS=y 386 NEED_DH_GROUPS_ALL=y 387 NEED_MODEXP=y 388 NEED_CIPHER=y 389 endif 390 391 ifdef CONFIG_EAP_TNC 392 CFLAGS += -DEAP_SERVER_TNC 393 OBJS += ../src/eap_server/eap_server_tnc.o 394 OBJS += ../src/eap_server/tncs.o 395 NEED_BASE64=y 396 ifndef CONFIG_DRIVER_BSD 397 LIBS += -ldl 398 endif 399 endif 400 401 # Basic EAP functionality is needed for EAPOL 402 OBJS += eap_register.o 403 OBJS += ../src/eap_server/eap_server.o 404 OBJS += ../src/eap_common/eap_common.o 405 OBJS += ../src/eap_server/eap_server_methods.o 406 OBJS += ../src/eap_server/eap_server_identity.o 407 CFLAGS += -DEAP_SERVER_IDENTITY 408 409 ifdef CONFIG_EAP 410 CFLAGS += -DEAP_SERVER 411 endif 412 413 ifdef CONFIG_PKCS12 414 CFLAGS += -DPKCS12_FUNCS 415 endif 416 417 ifdef MS_FUNCS 418 OBJS += ../src/crypto/ms_funcs.o 419 NEED_DES=y 420 NEED_MD4=y 421 endif 422 423 ifdef CHAP 424 OBJS += ../src/eap_common/chap.o 425 endif 426 427 ifdef TLS_FUNCS 428 NEED_DES=y 429 # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS) 430 CFLAGS += -DEAP_TLS_FUNCS 431 OBJS += ../src/eap_server/eap_server_tls_common.o 432 NEED_TLS_PRF=y 433 endif 434 435 ifndef CONFIG_TLS 436 CONFIG_TLS=openssl 437 endif 438 439 ifdef CONFIG_TLSV11 440 CFLAGS += -DCONFIG_TLSV11 441 endif 442 443 ifdef CONFIG_TLSV12 444 CFLAGS += -DCONFIG_TLSV12 445 NEED_SHA256=y 446 endif 447 448 ifeq ($(CONFIG_TLS), openssl) 449 ifdef TLS_FUNCS 450 OBJS += ../src/crypto/tls_openssl.o 451 LIBS += -lssl 452 endif 453 OBJS += ../src/crypto/crypto_openssl.o 454 HOBJS += ../src/crypto/crypto_openssl.o 455 ifdef NEED_FIPS186_2_PRF 456 OBJS += ../src/crypto/fips_prf_openssl.o 457 endif 458 LIBS += -lcrypto 459 LIBS_h += -lcrypto 460 endif 461 462 ifeq ($(CONFIG_TLS), gnutls) 463 ifdef TLS_FUNCS 464 OBJS += ../src/crypto/tls_gnutls.o 465 LIBS += -lgnutls -lgpg-error 466 endif 467 OBJS += ../src/crypto/crypto_gnutls.o 468 HOBJS += ../src/crypto/crypto_gnutls.o 469 ifdef NEED_FIPS186_2_PRF 470 OBJS += ../src/crypto/fips_prf_gnutls.o 471 endif 472 LIBS += -lgcrypt 473 LIBS_h += -lgcrypt 474 CONFIG_INTERNAL_SHA256=y 475 CONFIG_INTERNAL_RC4=y 476 CONFIG_INTERNAL_DH_GROUP5=y 477 endif 478 479 ifeq ($(CONFIG_TLS), schannel) 480 ifdef TLS_FUNCS 481 OBJS += ../src/crypto/tls_schannel.o 482 endif 483 OBJS += ../src/crypto/crypto_cryptoapi.o 484 OBJS_p += ../src/crypto/crypto_cryptoapi.o 485 CONFIG_INTERNAL_SHA256=y 486 CONFIG_INTERNAL_RC4=y 487 CONFIG_INTERNAL_DH_GROUP5=y 488 endif 489 490 ifeq ($(CONFIG_TLS), nss) 491 ifdef TLS_FUNCS 492 OBJS += ../src/crypto/tls_nss.o 493 LIBS += -lssl3 494 endif 495 OBJS += ../src/crypto/crypto_nss.o 496 ifdef NEED_FIPS186_2_PRF 497 OBJS += ../src/crypto/fips_prf_nss.o 498 endif 499 LIBS += -lnss3 500 LIBS_h += -lnss3 501 CONFIG_INTERNAL_MD4=y 502 CONFIG_INTERNAL_DH_GROUP5=y 503 endif 504 505 ifeq ($(CONFIG_TLS), internal) 506 ifndef CONFIG_CRYPTO 507 CONFIG_CRYPTO=internal 508 endif 509 ifdef TLS_FUNCS 510 OBJS += ../src/crypto/crypto_internal-rsa.o 511 OBJS += ../src/crypto/tls_internal.o 512 OBJS += ../src/tls/tlsv1_common.o 513 OBJS += ../src/tls/tlsv1_record.o 514 OBJS += ../src/tls/tlsv1_cred.o 515 OBJS += ../src/tls/tlsv1_server.o 516 OBJS += ../src/tls/tlsv1_server_write.o 517 OBJS += ../src/tls/tlsv1_server_read.o 518 OBJS += ../src/tls/asn1.o 519 OBJS += ../src/tls/rsa.o 520 OBJS += ../src/tls/x509v3.o 521 OBJS += ../src/tls/pkcs1.o 522 OBJS += ../src/tls/pkcs5.o 523 OBJS += ../src/tls/pkcs8.o 524 NEED_SHA256=y 525 NEED_BASE64=y 526 NEED_TLS_PRF=y 527 ifdef CONFIG_TLSV12 528 NEED_TLS_PRF_SHA256=y 529 endif 530 NEED_MODEXP=y 531 NEED_CIPHER=y 532 CFLAGS += -DCONFIG_TLS_INTERNAL 533 CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER 534 endif 535 ifdef NEED_CIPHER 536 NEED_DES=y 537 OBJS += ../src/crypto/crypto_internal-cipher.o 538 endif 539 ifdef NEED_MODEXP 540 OBJS += ../src/crypto/crypto_internal-modexp.o 541 OBJS += ../src/tls/bignum.o 542 endif 543 ifeq ($(CONFIG_CRYPTO), libtomcrypt) 544 OBJS += ../src/crypto/crypto_libtomcrypt.o 545 LIBS += -ltomcrypt -ltfm 546 LIBS_h += -ltomcrypt -ltfm 547 CONFIG_INTERNAL_SHA256=y 548 CONFIG_INTERNAL_RC4=y 549 CONFIG_INTERNAL_DH_GROUP5=y 550 endif 551 ifeq ($(CONFIG_CRYPTO), internal) 552 OBJS += ../src/crypto/crypto_internal.o 553 NEED_AES_DEC=y 554 CFLAGS += -DCONFIG_CRYPTO_INTERNAL 555 ifdef CONFIG_INTERNAL_LIBTOMMATH 556 CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH 557 ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST 558 CFLAGS += -DLTM_FAST 559 endif 560 else 561 LIBS += -ltommath 562 LIBS_h += -ltommath 563 endif 564 CONFIG_INTERNAL_AES=y 565 CONFIG_INTERNAL_DES=y 566 CONFIG_INTERNAL_SHA1=y 567 CONFIG_INTERNAL_MD4=y 568 CONFIG_INTERNAL_MD5=y 569 CONFIG_INTERNAL_SHA256=y 570 CONFIG_INTERNAL_RC4=y 571 CONFIG_INTERNAL_DH_GROUP5=y 572 endif 573 ifeq ($(CONFIG_CRYPTO), cryptoapi) 574 OBJS += ../src/crypto/crypto_cryptoapi.o 575 OBJS_p += ../src/crypto/crypto_cryptoapi.o 576 CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI 577 CONFIG_INTERNAL_SHA256=y 578 CONFIG_INTERNAL_RC4=y 579 endif 580 endif 581 582 ifeq ($(CONFIG_TLS), none) 583 ifdef TLS_FUNCS 584 OBJS += ../src/crypto/tls_none.o 585 CFLAGS += -DEAP_TLS_NONE 586 CONFIG_INTERNAL_AES=y 587 CONFIG_INTERNAL_SHA1=y 588 CONFIG_INTERNAL_MD5=y 589 endif 590 OBJS += ../src/crypto/crypto_none.o 591 OBJS_p += ../src/crypto/crypto_none.o 592 CONFIG_INTERNAL_SHA256=y 593 CONFIG_INTERNAL_RC4=y 594 endif 595 596 ifndef TLS_FUNCS 597 OBJS += ../src/crypto/tls_none.o 598 ifeq ($(CONFIG_TLS), internal) 599 CONFIG_INTERNAL_AES=y 600 CONFIG_INTERNAL_SHA1=y 601 CONFIG_INTERNAL_MD5=y 602 CONFIG_INTERNAL_RC4=y 603 endif 604 endif 605 606 AESOBJS = # none so far 607 ifdef CONFIG_INTERNAL_AES 608 AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-enc.o 609 endif 610 611 AESOBJS += ../src/crypto/aes-wrap.o 612 ifdef NEED_AES_EAX 613 AESOBJS += ../src/crypto/aes-eax.o 614 NEED_AES_CTR=y 615 endif 616 ifdef NEED_AES_CTR 617 AESOBJS += ../src/crypto/aes-ctr.o 618 endif 619 ifdef NEED_AES_ENCBLOCK 620 AESOBJS += ../src/crypto/aes-encblock.o 621 endif 622 ifdef NEED_AES_OMAC1 623 AESOBJS += ../src/crypto/aes-omac1.o 624 endif 625 ifdef NEED_AES_UNWRAP 626 NEED_AES_DEC=y 627 AESOBJS += ../src/crypto/aes-unwrap.o 628 endif 629 ifdef NEED_AES_CBC 630 NEED_AES_DEC=y 631 AESOBJS += ../src/crypto/aes-cbc.o 632 endif 633 ifdef NEED_AES_DEC 634 ifdef CONFIG_INTERNAL_AES 635 AESOBJS += ../src/crypto/aes-internal-dec.o 636 endif 637 endif 638 ifdef NEED_AES 639 OBJS += $(AESOBJS) 640 endif 641 642 ifdef NEED_SHA1 643 SHA1OBJS += ../src/crypto/sha1.o 644 ifdef CONFIG_INTERNAL_SHA1 645 SHA1OBJS += ../src/crypto/sha1-internal.o 646 ifdef NEED_FIPS186_2_PRF 647 SHA1OBJS += ../src/crypto/fips_prf_internal.o 648 endif 649 endif 650 SHA1OBJS += ../src/crypto/sha1-pbkdf2.o 651 ifdef NEED_T_PRF 652 SHA1OBJS += ../src/crypto/sha1-tprf.o 653 endif 654 ifdef NEED_TLS_PRF 655 SHA1OBJS += ../src/crypto/sha1-tlsprf.o 656 endif 657 endif 658 659 ifdef NEED_SHA1 660 OBJS += $(SHA1OBJS) 661 endif 662 663 ifdef NEED_MD5 664 ifdef CONFIG_INTERNAL_MD5 665 OBJS += ../src/crypto/md5-internal.o 666 HOBJS += ../src/crypto/md5-internal.o 667 endif 668 endif 669 670 ifdef NEED_MD4 671 ifdef CONFIG_INTERNAL_MD4 672 OBJS += ../src/crypto/md4-internal.o 673 endif 674 endif 675 676 ifdef NEED_DES 677 ifdef CONFIG_INTERNAL_DES 678 OBJS += ../src/crypto/des-internal.o 679 endif 680 endif 681 682 ifdef NEED_RC4 683 ifdef CONFIG_INTERNAL_RC4 684 OBJS += ../src/crypto/rc4.o 685 endif 686 endif 687 688 ifdef NEED_SHA256 689 CFLAGS += -DCONFIG_SHA256 690 OBJS += ../src/crypto/sha256.o 691 ifdef CONFIG_INTERNAL_SHA256 692 OBJS += ../src/crypto/sha256-internal.o 693 endif 694 ifdef NEED_TLS_PRF_SHA256 695 OBJS += ../src/crypto/sha256-tlsprf.o 696 endif 697 endif 698 699 ifdef NEED_DH_GROUPS 700 OBJS += ../src/crypto/dh_groups.o 701 endif 702 ifdef NEED_DH_GROUPS_ALL 703 CFLAGS += -DALL_DH_GROUPS 704 endif 705 ifdef CONFIG_INTERNAL_DH_GROUP5 706 ifdef NEED_DH_GROUPS 707 OBJS += ../src/crypto/dh_group5.o 708 endif 709 endif 710 711 ifdef CONFIG_NO_RANDOM_POOL 712 CFLAGS += -DCONFIG_NO_RANDOM_POOL 713 else 714 OBJS += ../src/crypto/random.o 715 HOBJS += ../src/crypto/random.o 716 HOBJS += ../src/utils/eloop.o 717 HOBJS += $(SHA1OBJS) 718 HOBJS += ../src/crypto/md5.o 719 endif 720 721 ifdef CONFIG_RADIUS_SERVER 722 CFLAGS += -DRADIUS_SERVER 723 OBJS += ../src/radius/radius_server.o 724 endif 725 726 ifdef CONFIG_IPV6 727 CFLAGS += -DCONFIG_IPV6 728 endif 729 730 ifdef CONFIG_DRIVER_RADIUS_ACL 731 CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL 732 endif 733 734 ifdef CONFIG_FULL_DYNAMIC_VLAN 735 # define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges 736 # and vlan interfaces for the vlan feature. 737 CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN 738 endif 739 740 ifdef NEED_BASE64 741 OBJS += ../src/utils/base64.o 742 endif 743 744 ifdef NEED_AP_MLME 745 OBJS += ../src/ap/wmm.o 746 OBJS += ../src/ap/ap_list.o 747 OBJS += ../src/ap/ieee802_11.o 748 OBJS += ../src/ap/hw_features.o 749 CFLAGS += -DNEED_AP_MLME 750 endif 751 ifdef CONFIG_IEEE80211N 752 OBJS += ../src/ap/ieee802_11_ht.o 753 endif 754 755 ifdef CONFIG_P2P_MANAGER 756 CFLAGS += -DCONFIG_P2P_MANAGER 757 OBJS += ../src/ap/p2p_hostapd.o 758 endif 759 760 ifdef CONFIG_INTERWORKING 761 CFLAGS += -DCONFIG_INTERWORKING 762 endif 763 764 OBJS += ../src/drivers/driver_common.o 765 766 ifdef CONFIG_WPA_CLI_EDIT 767 OBJS_c += ../src/utils/edit.o 768 else 769 OBJS_c += ../src/utils/edit_simple.o 770 endif 771 772 ifdef CONFIG_NO_STDOUT_DEBUG 773 CFLAGS += -DCONFIG_NO_STDOUT_DEBUG 774 endif 775 776 ifdef CONFIG_DEBUG_FILE 777 CFLAGS += -DCONFIG_DEBUG_FILE 778 endif 779 780 ALL=hostapd hostapd_cli 781 782 all: verify_config $(ALL) 783 784 Q=@ 785 E=echo 786 ifeq ($(V), 1) 787 Q= 788 E=true 789 endif 790 791 %.o: %.c 792 $(Q)$(CC) -c -o $@ $(CFLAGS) $< 793 @$(E) " CC " $< 794 795 verify_config: 796 @if [ ! -r .config ]; then \ 797 echo 'Building hostapd requires a configuration file'; \ 798 echo '(.config). See README for more instructions. You can'; \ 799 echo 'run "cp defconfig .config" to create an example'; \ 800 echo 'configuration.'; \ 801 exit 1; \ 802 fi 803 804 install: all 805 mkdir -p $(DESTDIR)/usr/local/bin 806 for i in $(ALL); do cp -f $$i $(DESTDIR)/usr/local/bin/$$i; done 807 808 ../src/drivers/build.hostapd: 809 @if [ -f ../src/drivers/build.wpa_supplicant ]; then \ 810 $(MAKE) -C ../src/drivers clean; \ 811 fi 812 @touch ../src/drivers/build.hostapd 813 814 BCHECK=../src/drivers/build.hostapd 815 816 hostapd: $(BCHECK) $(OBJS) 817 $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) 818 @$(E) " LD " $@ 819 820 ifdef CONFIG_WPA_TRACE 821 OBJS_c += ../src/utils/trace.o 822 endif 823 hostapd_cli: $(OBJS_c) 824 $(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c) 825 @$(E) " LD " $@ 826 827 NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) ../src/crypto/md5.o 828 ifdef NEED_RC4 829 ifdef CONFIG_INTERNAL_RC4 830 NOBJS += ../src/crypto/rc4.o 831 endif 832 endif 833 ifdef CONFIG_INTERNAL_MD5 834 NOBJS += ../src/crypto/md5-internal.o 835 endif 836 NOBJS += ../src/crypto/crypto_openssl.o ../src/utils/os_$(CONFIG_OS).o 837 NOBJS += ../src/utils/wpa_debug.o 838 NOBJS += ../src/utils/wpabuf.o 839 ifdef CONFIG_WPA_TRACE 840 NOBJS += ../src/utils/trace.o 841 LIBS_n += -lbfd 842 endif 843 ifdef TLS_FUNCS 844 LIBS_n += -lcrypto 845 endif 846 847 HOBJS += hlr_auc_gw.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).o ../src/utils/wpabuf.o ../src/crypto/milenage.o 848 HOBJS += ../src/crypto/aes-encblock.o 849 ifdef CONFIG_INTERNAL_AES 850 HOBJS += ../src/crypto/aes-internal.o 851 HOBJS += ../src/crypto/aes-internal-enc.o 852 endif 853 854 nt_password_hash: $(NOBJS) 855 $(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n) 856 @$(E) " LD " $@ 857 858 hlr_auc_gw: $(HOBJS) 859 $(Q)$(CC) $(LDFLAGS) -o hlr_auc_gw $(HOBJS) $(LIBS_h) 860 @$(E) " LD " $@ 861 862 clean: 863 $(MAKE) -C ../src clean 864 rm -f core *~ *.o hostapd hostapd_cli nt_password_hash hlr_auc_gw 865 rm -f *.d 866 867 -include $(OBJS:%.o=%.d) 868