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