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