]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/hostapd/Makefile
This commit was generated by cvs2svn to compensate for changes in r162911,
[FreeBSD/FreeBSD.git] / contrib / hostapd / Makefile
1 CC=gcc
2 DIR_WPA_SUPPLICANT=.
3 DIR_HOSTAP=.
4
5 ifndef CFLAGS
6 CFLAGS = -MMD -O2 -Wall -g
7 endif
8
9 # define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to
10 # a file (undefine it, if you want to save in binary size)
11 CFLAGS += -DHOSTAPD_DUMP_STATE
12
13 # Include directories for CVS version
14 CFLAGS += -I. -I$(DIR_HOSTAP) -I../utils -I$(DIR_WPA_SUPPLICANT)
15
16 # Uncomment following line and set the path to your kernel tree include
17 # directory if your C library does not include all header files.
18 # CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
19
20 OBJS =  hostapd.o eloop.o ieee802_1x.o eapol_sm.o radius.o md5.o rc4.o \
21         common.o ieee802_11.o config.o ieee802_11_auth.o accounting.o \
22         sta_info.o radius_client.o sha1.o wpa.o aes_wrap.o ctrl_iface.o \
23         driver_conf.o
24
25 -include .config
26
27 ifdef CONFIG_IAPP
28 CFLAGS += -DCONFIG_IAPP
29 OBJS += iapp.o
30 endif
31
32 ifdef CONFIG_RSN_PREAUTH
33 CFLAGS += -DCONFIG_RSN_PREAUTH
34 CONFIG_L2_PACKET=y
35 endif
36
37 ifdef CONFIG_DRIVER_HOSTAP
38 CFLAGS += -DCONFIG_DRIVER_HOSTAP
39 OBJS += driver.o
40 endif
41
42 ifdef CONFIG_DRIVER_WIRED
43 CFLAGS += -DCONFIG_DRIVER_WIRED
44 OBJS += driver_wired.o
45 endif
46
47 ifdef CONFIG_DRIVER_MADWIFI
48 CFLAGS += -DCONFIG_DRIVER_MADWIFI
49 OBJS += driver_madwifi.o
50 CONFIG_L2_PACKET=y
51 endif
52
53 ifdef CONFIG_DRIVER_PRISM54
54 CFLAGS += -DCONFIG_DRIVER_PRISM54
55 OBJS += driver_prism54.o
56 endif
57
58 ifdef CONFIG_DRIVER_BSD
59 CFLAGS += -DCONFIG_DRIVER_BSD
60 OBJS += driver_bsd.o
61 CONFIG_L2_PACKET=y
62 CONFIG_DNET_PCAP=y
63 CONFIG_L2_FREEBSD=y
64 endif
65
66 ifdef CONFIG_DRIVER_TEST
67 CFLAGS += -DCONFIG_DRIVER_TEST
68 OBJS += driver_test.o
69 endif
70
71 ifdef CONFIG_L2_PACKET
72 ifdef CONFIG_DNET_PCAP
73 CFLAGS += -DUSE_DNET_PCAP
74 ifdef CONFIG_L2_FREEBSD
75 LIBS += -lpcap
76 OBJS += $(DIR_WPA_SUPPLICANT)/l2_packet_freebsd.o
77 else
78 LIBS += -ldnet -lpcap
79 OBJS += $(DIR_WPA_SUPPLICANT)/l2_packet_pcap.o
80 endif
81 else
82 OBJS += $(DIR_WPA_SUPPLICANT)/l2_packet_linux.o
83 endif
84 endif
85
86
87 ifdef CONFIG_EAP_MD5
88 CFLAGS += -DEAP_MD5
89 OBJS += eap_md5.o
90 endif
91
92 ifdef CONFIG_EAP_TLS
93 CFLAGS += -DEAP_TLS
94 OBJS += eap_tls.o
95 TLS_FUNCS=y
96 endif
97
98 ifdef CONFIG_EAP_PEAP
99 CFLAGS += -DEAP_PEAP
100 OBJS += eap_peap.o
101 TLS_FUNCS=y
102 CONFIG_EAP_TLV=y
103 CONFIG_EAP_MSCHAPV2=y
104 endif
105
106 ifdef CONFIG_EAP_TTLS
107 CFLAGS += -DEAP_TTLS
108 OBJS += eap_ttls.o
109 TLS_FUNCS=y
110 endif
111
112 ifdef CONFIG_EAP_MSCHAPV2
113 CFLAGS += -DEAP_MSCHAPv2
114 OBJS += eap_mschapv2.o
115 MS_FUNCS=y
116 endif
117
118 ifdef CONFIG_EAP_GTC
119 CFLAGS += -DEAP_GTC
120 OBJS += eap_gtc.o
121 endif
122
123 ifdef CONFIG_EAP_SIM
124 CFLAGS += -DEAP_SIM
125 OBJS += eap_sim.o $(DIR_WPA_SUPPLICANT)/eap_sim_common.o
126 # Example EAP-SIM interface for GSM authentication. This can be replaced with
127 # another file implementating the interface specified in eap_sim_db.h.
128 OBJS += eap_sim_db.o
129 endif
130
131 ifdef CONFIG_EAP_PAX
132 CFLAGS += -DEAP_PAX
133 OBJS += eap_pax.o $(DIR_WPA_SUPPLICANT)/eap_pax_common.o
134 endif
135
136 ifdef CONFIG_EAP_PSK
137 CFLAGS += -DEAP_PSK
138 OBJS += eap_psk.o $(DIR_WPA_SUPPLICANT)/eap_psk_common.o
139 endif
140
141 ifdef CONFIG_EAP_TLV
142 CFLAGS += -DEAP_TLV
143 OBJS += eap_tlv.o
144 endif
145
146 ifdef CONFIG_EAP
147 CFLAGS += -DEAP_SERVER
148 OBJS += eap.o eap_identity.o
149 endif
150
151 ifdef TLS_FUNCS
152 # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
153 CFLAGS += -DEAP_TLS_FUNCS
154 OBJS += eap_tls_common.o $(DIR_WPA_SUPPLICANT)/tls_openssl.o
155 LIBS += -lssl -lcrypto
156 LIBS_p += -lcrypto
157 else
158 OBJS += $(DIR_WPA_SUPPLICANT)/tls_none.o
159 endif
160
161 ifdef CONFIG_PKCS12
162 CFLAGS += -DPKCS12_FUNCS
163 endif
164
165 ifdef MS_FUNCS
166 ifndef TLS_FUNCS
167 LIBS += -lcrypto
168 endif
169 OBJS += $(DIR_WPA_SUPPLICANT)/ms_funcs.o $(DIR_WPA_SUPPLICANT)/crypto.o
170 endif
171
172 ifdef CONFIG_RADIUS_SERVER
173 CFLAGS += -DRADIUS_SERVER
174 OBJS += radius_server.o
175 endif
176
177 ifdef CONFIG_IPV6
178 CFLAGS += -DCONFIG_IPV6
179 endif
180
181 ALL=hostapd hostapd_cli
182
183 all: verify_config $(ALL)
184
185 verify_config:
186         @if [ ! -r .config ]; then \
187                 echo 'Building hostapd requires a configuration file'; \
188                 echo '(.config). See README for more instructions. You can'; \
189                 echo 'run "cp defconfig .config" to create an example'; \
190                 echo 'configuration.'; \
191                 exit 1; \
192         fi
193
194 install: all
195         for i in $(ALL); do cp $$i /usr/local/bin/$$i; done
196
197 hostapd: $(OBJS)
198         $(CC) -o hostapd $(OBJS) $(LIBS)
199
200 driver_conf.c: Makefile .config
201         rm -f driver_conf.c
202         echo '/* THIS FILE AUTOMATICALLY GENERATED, DO NOT EDIT! */' \
203                                                         > driver_conf.c
204         echo '#include <stdlib.h>'                      >> driver_conf.c
205         echo '#include <stdio.h>'                       >> driver_conf.c
206         echo '#include <sys/types.h>'                   >> driver_conf.c
207         echo '#include <netinet/in.h>'                  >> driver_conf.c
208         echo '#include "hostapd.h"'                     >> driver_conf.c
209         echo '#include "driver.h"'                      >> driver_conf.c
210 ifdef CONFIG_DRIVER_HOSTAP
211         echo "void hostap_driver_register(void);"       >> driver_conf.c
212 endif
213 ifdef CONFIG_DRIVER_WIRED
214         echo "void wired_driver_register(void);"        >> driver_conf.c
215 endif
216 ifdef CONFIG_DRIVER_MADWIFI
217         echo "void madwifi_driver_register(void);"      >> driver_conf.c
218 endif
219 ifdef CONFIG_DRIVER_PRISM54
220         echo "void prism54_driver_register(void);"      >> driver_conf.c
221 endif
222 ifdef CONFIG_DRIVER_BSD
223         echo "void bsd_driver_register(void);"          >> driver_conf.c
224 endif
225 ifdef CONFIG_DRIVER_TEST
226         echo "void test_driver_register(void);"         >> driver_conf.c
227 endif
228         echo 'void register_drivers(void) {'            >> driver_conf.c
229 ifdef CONFIG_DRIVER_HOSTAP
230         echo "hostap_driver_register();"                >> driver_conf.c
231 endif
232 ifdef CONFIG_DRIVER_WIRED
233         echo "wired_driver_register();"                 >> driver_conf.c
234 endif
235 ifdef CONFIG_DRIVER_MADWIFI
236         echo "madwifi_driver_register();"               >> driver_conf.c
237 endif
238 ifdef CONFIG_DRIVER_PRISM54
239         echo "prism54_driver_register();"               >> driver_conf.c
240 endif
241 ifdef CONFIG_DRIVER_BSD
242         echo "bsd_driver_register();"                   >> driver_conf.c
243 endif
244 ifdef CONFIG_DRIVER_TEST
245         echo "test_driver_register();"                  >> driver_conf.c
246 endif
247         echo '}'                                        >> driver_conf.c
248
249 hostapd_cli: hostapd_cli.o $(DIR_WPA_SUPPLICANT)/wpa_ctrl.o
250         $(CC) -o hostapd_cli hostapd_cli.o $(DIR_WPA_SUPPLICANT)/wpa_ctrl.o
251
252 clean:
253         rm -f core *~ *.o hostapd hostapd_cli *.d driver_conf.c
254
255 -include $(OBJS:%.o=%.d)