1# Makefile for Microsoft nmake to build wpa_supplicant
2
3# This can be run in Visual Studio 2005 Command Prompt
4
5# Note: Make sure that cl.exe is configured to include Platform SDK
6# include and lib directories (vsvars32.bat)
7
8all: wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe wpasvc.exe win_if_list.exe
9
10# Root directory for WinPcap developer's pack
11# (http://www.winpcap.org/install/bin/WpdPack_3_1.zip)
12WINPCAPDIR=C:\dev\WpdPack
13
14# Root directory for OpenSSL
15# (http://www.openssl.org/source/openssl-0.9.8a.tar.gz)
16# Build and installed following instructions in INSTALL.W32
17# Note: If EAP-FAST is included in the build, OpenSSL needs to be patched to
18# support it (openssl-tls-extensions.patch)
19# Alternatively, see README-Windows.txt for information about binary
20# installation package for OpenSSL.
21OPENSSLDIR=C:\dev\openssl
22
23CC = cl
24OBJDIR = objs
25
26CFLAGS = /DCONFIG_NATIVE_WINDOWS
27CFLAGS = $(CFLAGS) /DCONFIG_NDIS_EVENTS_INTEGRATED
28CFLAGS = $(CFLAGS) /DCONFIG_ANSI_C_EXTRA
29CFLAGS = $(CFLAGS) /DCONFIG_WINPCAP
30CFLAGS = $(CFLAGS) /DIEEE8021X_EAPOL
31CFLAGS = $(CFLAGS) /DPKCS12_FUNCS
32CFLAGS = $(CFLAGS) /DEAP_MD5
33CFLAGS = $(CFLAGS) /DEAP_TLS
34CFLAGS = $(CFLAGS) /DEAP_MSCHAPv2
35CFLAGS = $(CFLAGS) /DEAP_PEAP
36CFLAGS = $(CFLAGS) /DEAP_TTLS
37CFLAGS = $(CFLAGS) /DEAP_GTC
38CFLAGS = $(CFLAGS) /DEAP_OTP
39CFLAGS = $(CFLAGS) /DEAP_SIM
40CFLAGS = $(CFLAGS) /DEAP_LEAP
41CFLAGS = $(CFLAGS) /DEAP_PSK
42CFLAGS = $(CFLAGS) /DEAP_AKA
43#CFLAGS = $(CFLAGS) /DEAP_FAST
44CFLAGS = $(CFLAGS) /DEAP_PAX
45CFLAGS = $(CFLAGS) /DEAP_TNC
46CFLAGS = $(CFLAGS) /DPCSC_FUNCS
47CFLAGS = $(CFLAGS) /DCONFIG_CTRL_IFACE
48CFLAGS = $(CFLAGS) /DCONFIG_CTRL_IFACE_NAMED_PIPE
49CFLAGS = $(CFLAGS) /DCONFIG_DRIVER_NDIS
50CFLAGS = $(CFLAGS) /I..\src /I..\src\utils
51CFLAGS = $(CFLAGS) /I.
52CFLAGS = $(CFLAGS) /DWIN32
53CFLAGS = $(CFLAGS) /Fo$(OBJDIR)\\ /c
54CFLAGS = $(CFLAGS) /W3
55
56#CFLAGS = $(CFLAGS) /WX
57
58# VS 2005 complains about lot of deprecated string functions; let's ignore them
59# at least for now since snprintf and strncpy can be used in a safe way
60CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE
61
62OBJS = \
63	$(OBJDIR)\os_win32.obj \
64	$(OBJDIR)\eloop_win.obj \
65	$(OBJDIR)\sha1.obj \
66	$(OBJDIR)\sha1-tlsprf.obj \
67	$(OBJDIR)\sha1-pbkdf2.obj \
68	$(OBJDIR)\md5.obj \
69	$(OBJDIR)\aes-cbc.obj \
70	$(OBJDIR)\aes-ctr.obj \
71	$(OBJDIR)\aes-eax.obj \
72	$(OBJDIR)\aes-encblock.obj \
73	$(OBJDIR)\aes-omac1.obj \
74	$(OBJDIR)\aes-unwrap.obj \
75	$(OBJDIR)\aes-wrap.obj \
76	$(OBJDIR)\common.obj \
77	$(OBJDIR)\wpa_debug.obj \
78	$(OBJDIR)\wpabuf.obj \
79	$(OBJDIR)\wpa_supplicant.obj \
80	$(OBJDIR)\wpa.obj \
81	$(OBJDIR)\wpa_common.obj \
82	$(OBJDIR)\wpa_ie.obj \
83	$(OBJDIR)\preauth.obj \
84	$(OBJDIR)\pmksa_cache.obj \
85	$(OBJDIR)\eapol_supp_sm.obj \
86	$(OBJDIR)\eap.obj \
87	$(OBJDIR)\eap_common.obj \
88	$(OBJDIR)\chap.obj \
89	$(OBJDIR)\eap_methods.obj \
90	$(OBJDIR)\eap_md5.obj \
91	$(OBJDIR)\eap_tls.obj \
92	$(OBJDIR)\eap_tls_common.obj \
93	$(OBJDIR)\eap_mschapv2.obj \
94	$(OBJDIR)\mschapv2.obj \
95	$(OBJDIR)\eap_peap.obj \
96	$(OBJDIR)\eap_peap_common.obj \
97	$(OBJDIR)\eap_ttls.obj \
98	$(OBJDIR)\eap_gtc.obj \
99	$(OBJDIR)\eap_otp.obj \
100	$(OBJDIR)\eap_leap.obj \
101	$(OBJDIR)\eap_sim.obj \
102	$(OBJDIR)\eap_sim_common.obj \
103	$(OBJDIR)\eap_aka.obj \
104	$(OBJDIR)\eap_pax.obj \
105	$(OBJDIR)\eap_pax_common.obj \
106	$(OBJDIR)\eap_psk.obj \
107	$(OBJDIR)\eap_psk_common.obj \
108	$(OBJDIR)\eap_tnc.obj \
109	$(OBJDIR)\tncc.obj \
110	$(OBJDIR)\base64.obj \
111	$(OBJDIR)\ctrl_iface.obj \
112	$(OBJDIR)\ctrl_iface_named_pipe.obj \
113	$(OBJDIR)\driver_ndis.obj \
114	$(OBJDIR)\driver_ndis_.obj \
115	$(OBJDIR)\scan_helpers.obj \
116	$(OBJDIR)\events.obj \
117	$(OBJDIR)\blacklist.obj \
118	$(OBJDIR)\scan.obj \
119	$(OBJDIR)\wpas_glue.obj \
120	$(OBJDIR)\eap_register.obj \
121	$(OBJDIR)\config.obj \
122	$(OBJDIR)\l2_packet_winpcap.obj \
123	$(OBJDIR)\tls_openssl.obj \
124	$(OBJDIR)\ms_funcs.obj \
125	$(OBJDIR)\crypto_openssl.obj \
126	$(OBJDIR)\fips_prf_openssl.obj \
127	$(OBJDIR)\pcsc_funcs.obj \
128	$(OBJDIR)\notify.obj \
129	$(OBJDIR)\ndis_events.obj
130
131# OBJS = $(OBJS) $(OBJDIR)\eap_fast.obj
132
133OBJS_t = $(OBJS) \
134	$(OBJDIR)\eapol_test.obj \
135	$(OBJDIR)\radius.obj \
136	$(OBJDIR)\radius_client.obj \
137	$(OBJDIR)\config_file.obj $(OBJDIR)\base64.obj
138
139OBJS_t2 = $(OBJS) \
140	$(OBJDIR)\preauth_test.obj \
141	$(OBJDIR)\config_file.obj $(OBJDIR)\base64.obj
142
143OBJS2 = $(OBJDIR)\drivers.obj \
144	$(OBJDIR)\config_file.obj \
145	$(OBJS2) $(OBJDIR)\main.obj
146
147OBJS3 = $(OBJDIR)\drivers.obj \
148	$(OBJDIR)\config_winreg.obj \
149	$(OBJS3) $(OBJDIR)\main_winsvc.obj
150
151OBJS_c = \
152	$(OBJDIR)\os_win32.obj \
153	$(OBJDIR)\wpa_cli.obj \
154	$(OBJDIR)\wpa_ctrl.obj \
155	$(OBJDIR)\common.obj
156
157OBJS_p = \
158	$(OBJDIR)\os_win32.obj \
159	$(OBJDIR)\common.obj \
160	$(OBJDIR)\wpa_debug.obj \
161	$(OBJDIR)\wpabuf.obj \
162	$(OBJDIR)\sha1.obj \
163	$(OBJDIR)\md5.obj \
164	$(OBJDIR)\crypto_openssl.obj \
165	$(OBJDIR)\sha1-pbkdf2.obj \
166	$(OBJDIR)\wpa_passphrase.obj
167
168LIBS = wbemuuid.lib libcmt.lib kernel32.lib uuid.lib ole32.lib oleaut32.lib \
169	ws2_32.lib Advapi32.lib Crypt32.lib Winscard.lib \
170	Packet.lib wpcap.lib \
171	libeay32.lib ssleay32.lib
172# If using Win32 OpenSSL binary installation from Shining Light Productions,
173# replace the last line with this for dynamic libraries
174#	libeay32MT.lib ssleay32MT.lib
175# and this for static libraries
176#	libeay32MT.lib ssleay32MT.lib Gdi32.lib User32.lib
177
178CFLAGS = $(CFLAGS) /I"$(WINPCAPDIR)/Include" /I"$(OPENSSLDIR)\include"
179LFLAGS = /libpath:"$(WINPCAPDIR)\Lib" /libpath:"$(OPENSSLDIR)\lib"
180
181wpa_supplicant.exe: $(OBJDIR) $(OBJS) $(OBJS2)
182	link.exe /out:wpa_supplicant.exe $(LFLAGS) $(OBJS) $(OBJS2) $(LIBS)
183
184wpasvc.exe: $(OBJDIR) $(OBJS) $(OBJS3)
185	link.exe /out:wpasvc.exe $(LFLAGS) $(OBJS) $(OBJS3) $(LIBS)
186
187wpa_cli.exe: $(OBJDIR) $(OBJS_c)
188	link.exe /out:wpa_cli.exe $(LFLAGS) $(OBJS_c) $(LIBS)
189
190wpa_passphrase.exe: $(OBJDIR) $(OBJS_p)
191	link.exe /out:wpa_passphrase.exe $(LFLAGS) $(OBJS_p) $(LIBS)
192
193eapol_test.exe: $(OBJDIR) $(OBJS_t)
194	link.exe /out:eapol_test.exe $(LFLAGS) $(OBJS_t) $(LIBS)
195
196preauth_test.exe: $(OBJDIR) $(OBJS_t2)
197	link.exe /out:preauth_test.exe $(LFLAGS) $(OBJS_t2) $(LIBS)
198
199win_if_list.exe: $(OBJDIR) $(OBJDIR)\win_if_list.obj
200	link.exe /out:win_if_list.exe $(LFLAGS) $(OBJDIR)\win_if_list.obj $(LIBS)
201
202
203{..\src\utils}.c{$(OBJDIR)}.obj::
204	$(CC) $(CFLAGS) $<
205
206{..\src\common}.c{$(OBJDIR)}.obj::
207	$(CC) $(CFLAGS) $<
208
209{..\src\rsn_supp}.c{$(OBJDIR)}.obj::
210	$(CC) $(CFLAGS) $<
211
212{..\src\eapol_supp}.c{$(OBJDIR)}.obj::
213	$(CC) $(CFLAGS) $<
214
215{..\src\crypto}.c{$(OBJDIR)}.obj::
216	$(CC) $(CFLAGS) $<
217
218{..\src\eap_peer}.c{$(OBJDIR)}.obj::
219	$(CC) $(CFLAGS) $<
220
221{..\src\eap_common}.c{$(OBJDIR)}.obj::
222	$(CC) $(CFLAGS) $<
223
224{..\src\drivers}.c{$(OBJDIR)}.obj::
225	$(CC) $(CFLAGS) $<
226
227{..\src\l2_packet}.c{$(OBJDIR)}.obj::
228	$(CC) $(CFLAGS) $<
229
230{.\}.c{$(OBJDIR)}.obj::
231	$(CC) $(CFLAGS) $<
232
233{.\}.cpp{$(OBJDIR)}.obj::
234	$(CC) $(CFLAGS) $<
235
236$(OBJDIR):
237	if not exist "$(OBJDIR)" mkdir "$(OBJDIR)"
238
239clean:
240	erase $(OBJDIR)\*.obj wpa_supplicant.exe
241