Update GnuTls to gnutls-2.6.4-1
[metze/wireshark/wip.git] / Makefile.nmake
1 ## Makefile for building wireshark.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
3 #
4 # $Id$
5
6 # We "Deploy using XCopy," which is described at
7 # http://msdn.microsoft.com/en-us/library/ms235291.aspx
8
9 include config.nmake
10 include <win32.mak>
11
12 ############### no need to modify below this line #########
13
14 CC = cl
15 LINK= link
16 BSCMAKE= bscmake
17
18 LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)
19
20 CFLAGS=-WX -DHAVE_CONFIG_H $(LOCAL_CFLAGS) $(GLIB_CFLAGS) /I. /Iwiretap \
21         $(ZLIB_CFLAGS) /I$(PCAP_DIR)\include \
22         $(AIRPCAP_CFLAGS) \
23         $(C_ARES_CFLAGS) $(ADNS_CFLAGS) $(PCRE_CFLAGS) $(GNUTLS_CFLAGS) \
24         $(LUA_CFLAGS) $(SMI_CFLAGS) $(GEOIP_CFLAGS) \
25         -D_U_="" -D_NEED_VAR_IMPORT_
26
27 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
28
29 .c.obj::
30         $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
31
32 PLATFORM_SRC = capture-wpcap.c capture_wpcap_packet.c
33
34 WTAP_PLUGIN_SOURCES = \
35        epan/plugins.c \
36        epan/report_err.c \
37        epan/filesystem.c
38
39 include Makefile.common
40
41 wireshark_OBJECTS = $(wireshark_SOURCES:.c=.obj)
42 tshark_OBJECTS = $(tshark_SOURCES:.c=.obj)
43 rawshark_OBJECTS = $(rawshark_SOURCES:.c=.obj)
44 ###text2pcap_OBJECTS = $(text2pcap_SOURCES:.c=.obj)
45 ###mergecap_OBJECTS = $(mergecap_SOURCES:.c=.obj)
46 editcap_OBJECTS = $(editcap_SOURCES:.c=.obj)
47 capinfos_OBJECTS = $(capinfos_SOURCES:.c=.obj)
48 dftest_OBJECTS = $(dftest_SOURCES:.c=.obj)
49 dumpcap_OBJECTS = $(dumpcap_SOURCES:.c=.obj)
50 randpkt_OBJECTS = $(randpkt_SOURCES:.c=.obj)
51
52 EXTRA_OBJECTS = \
53         getopt.obj      \
54         inet_ntop.obj   \
55         inet_pton.obj   \
56         mkstemp.obj     \
57         strptime.obj
58
59 wireshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
60         wsock32.lib user32.lib shell32.lib comctl32.lib \
61         $(HHC_LIBS) \
62         wsutil\libwsutil.lib \
63         $(GNUTLS_LIBS) \
64 !IFDEF ENABLE_LIBWIRESHARK
65         epan\libwireshark.lib \
66 !ELSE
67         epan\dissectors\dissectors.lib \
68         epan\wireshark.lib \
69         epan\crypt\airpdcap.lib \
70         epan\dfilter\dfilter.lib \
71         epan\ftypes\ftypes.lib \
72         $(C_ARES_LIBS) \
73         $(ADNS_LIBS) \
74         $(PCRE_LIBS) \
75         $(ZLIB_LIBS)
76 !ENDIF
77
78 tshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
79         wsock32.lib user32.lib \
80         $(GLIB_LIBS) \
81         wsutil\libwsutil.lib \
82         $(GNUTLS_LIBS) \
83 !IFDEF ENABLE_LIBWIRESHARK
84         epan\libwireshark.lib \
85 !ELSE
86         epan\dissectors\dissectors.lib \
87         epan\wireshark.lib \
88         epan\crypt\airpdcap.lib \
89         epan\dfilter\dfilter.lib \
90         epan\ftypes\ftypes.lib \
91         $(C_ARES_LIBS) \
92         $(ADNS_LIBS) \
93         $(PCRE_LIBS) \
94         $(ZLIB_LIBS)
95 !ENDIF
96
97 rawshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
98         wsock32.lib user32.lib \
99         $(GLIB_LIBS) \
100         wsutil\libwsutil.lib \
101         $(GNUTLS_LIBS) \
102 !IFDEF ENABLE_LIBWIRESHARK
103         epan\libwireshark.lib \
104 !ELSE
105         epan\dissectors\dissectors.lib \
106         epan\wireshark.lib \
107         epan\crypt\airpdcap.lib \
108         epan\dfilter\dfilter.lib \
109         epan\ftypes\ftypes.lib \
110         $(C_ARES_LIBS) \
111         $(ADNS_LIBS) \
112         $(PCRE_LIBS) \
113         $(ZLIB_LIBS)
114 !ENDIF
115
116 capinfos_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
117         wsock32.lib user32.lib shell32.lib \
118         wsutil\libwsutil.lib \
119         $(GLIB_LIBS)
120
121 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
122         wsock32.lib user32.lib shell32.lib \
123         wsutil\libwsutil.lib \
124         $(GLIB_LIBS)
125
126 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
127         wsock32.lib user32.lib \
128         wsutil\libwsutil.lib \
129         $(GLIB_LIBS)
130
131 text2pcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
132         wsock32.lib user32.lib \
133         wsutil\libwsutil.lib \
134         $(GLIB_LIBS)
135
136 dumpcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
137         wsock32.lib user32.lib \
138         wsutil\libwsutil.lib \
139         $(GLIB_LIBS) \
140         $(GNUTLS_LIBS)
141
142 dftest_LIBS=  wiretap\wiretap-$(WTAP_VERSION).lib \
143         wsock32.lib user32.lib \
144         $(GLIB_LIBS) \
145         wsutil\libwsutil.lib \
146         $(GNUTLS_LIBS) \
147 !IFDEF ENABLE_LIBWIRESHARK
148         epan\libwireshark.lib \
149 !ELSE
150         epan\dissectors\dissectors.lib \
151         epan\wireshark.lib \
152         epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
153         $(C_ARES_LIBS) \
154         $(ADNS_LIBS) \
155         $(PCRE_LIBS) \
156         $(ZLIB_LIBS) \
157         $(SMI_LIBS)
158 !ENDIF
159
160 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
161         user32.lib \
162         wsutil\libwsutil.lib \
163         $(GLIB_LIBS)
164
165 EXECUTABLES=wireshark.exe tshark.exe rawshark.exe \
166         capinfos.exe editcap.exe mergecap.exe text2pcap.exe randpkt.exe dumpcap.exe
167
168 RESOURCES=image\wireshark.res image\libwireshark.res image\tshark.res \
169         image\capinfos.res image\editcap.res image\mergecap.res \
170         image\text2pcap.res image\wiretap.res image\dumpcap.res \
171         image\rawshark.res image\libwsutil.res
172
173 LIBS_CHECK=_libs_check_
174
175 all: $(LIBS_CHECK) config.h tools image codecs $(C_ARES_DLL) $(ADNS_DLL) $(ZLIB_DLL) wsutil wiretap epan $(EXECUTABLES) $(RESOURCES) doc help install-all
176
177 packaging: all
178         cd packaging
179         cd nsis
180         $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
181         cd ..
182         cd ..
183
184 packaging_u3: all
185         cd packaging
186         cd u3
187         cd win32
188         $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
189         cd ..
190         cd ..
191         cd ..
192
193 packaging_papps: all
194         cd packaging
195         cd portableapps
196         cd win32
197         $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
198         cd ..
199         cd ..
200         cd ..
201
202 # use (info-)zip from cygwin to pack things
203 packaging_zip: all
204 !IFDEF MSVCR_DLL
205         xcopy "$(MSVCR_DLL)" $(INSTALL_DIR)
206 !ENDIF
207 !IFDEF VCREDIST_EXE
208         @echo Including vcredist_x86.exe -- your recipient may need to run it!
209         xcopy "$(VCREDIST_EXE)" $(INSTALL_DIR)
210 !ENDIF
211         rm -f wireshark.zip
212         zip -r -9 wireshark.zip $(INSTALL_DIR)/
213
214 wireshark.bsc: *.sbr epan\*.sbr epan\dfilter\*.sbr epan\ftypes\*.sbr epan\wslua\*.sbr epan\dissectors\*.sbr gtk\*.sbr wiretap\*.sbr
215         rm -f $@
216         $(BSCMAKE) @<<
217                 /o $@ $?
218 <<
219         xcopy $@ $(INSTALL_DIR)\ /d
220
221 $(RESOURCES): image
222
223 wiretap\wiretap-$(WTAP_VERSION).lib: image $(ZLIB_DLL) wiretap
224
225 wireshark.exe   : $(LIBS_CHECK) config.h svnversion.h $(wireshark_OBJECTS) getopt.obj inet_ntop.obj inet_pton.obj codecs epan gtk image\wireshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib codecs\codecs.lib gtk\libui.lib plugins
226         @echo Linking $@
227         $(LINK) @<<
228                 /OUT:wireshark.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:windows $(wireshark_LIBS) getopt.obj inet_ntop.obj inet_pton.obj $(GTK_LIBS) codecs\codecs.lib gtk\libui.lib $(wireshark_OBJECTS) image\wireshark.res
229 <<
230 !IF $(MSC_VER_REQUIRED) >= 1400
231         mt.exe -nologo -manifest "wireshark.exe.manifest" -outputresource:wireshark.exe;1
232 !ENDIF
233
234 tshark.exe      : $(LIBS_CHECK) config.h svnversion.h $(tshark_OBJECTS) getopt.obj inet_ntop.obj epan image\tshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins
235         @echo Linking $@
236         $(LINK) @<<
237                 /OUT:tshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console $(tshark_LIBS) $(tshark_OBJECTS) getopt.obj inet_ntop.obj image\tshark.res
238 <<
239 !IF $(MSC_VER_REQUIRED) >= 1400
240         mt.exe -nologo -manifest "tshark.exe.manifest" -outputresource:tshark.exe;1
241 !ENDIF
242
243 rawshark.exe    : $(LIBS_CHECK) config.h svnversion.h $(rawshark_OBJECTS) getopt.obj inet_ntop.obj epan image\rawshark.res wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib plugins
244         @echo Linking $@
245         $(LINK) @<<
246                 /OUT:rawshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console $(rawshark_LIBS) $(rawshark_OBJECTS) getopt.obj inet_ntop.obj image\rawshark.res
247 <<
248 !IF $(MSC_VER_REQUIRED) >= 1400
249         mt.exe -nologo -manifest "rawshark.exe.manifest" -outputresource:rawshark.exe;1
250 !ENDIF
251
252 # XXX: This makefile does not properly handle doing a 'nmake ... capinfos.exe' directly since some of the .objs
253 #      (e.g. epan\plugins.obj) must be built first using epan\Makefile.nmake (which happens for 'nmake ... all').
254 capinfos.exe    : $(LIBS_CHECK) config.h $(capinfos_OBJECTS) getopt.obj wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\capinfos.res
255         @echo Linking $@
256         $(LINK) @<<
257                 /OUT:capinfos.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(capinfos_OBJECTS) getopt.obj $(capinfos_LIBS) image\capinfos.res
258 <<
259 !IF $(MSC_VER_REQUIRED) >= 1400
260         mt.exe -nologo -manifest "capinfos.exe.manifest" -outputresource:capinfos.exe;1
261 !ENDIF
262
263 # XXX: This makefile does not properly handle doing a 'nmake ... editcap.exe' directly since some of the .objs
264 #      (e.g. epan\plugins.obj) must be built first using epan\Makefile.nmake (which happens for 'nmake ... all').
265 editcap.exe     : $(LIBS_CHECK) config.h $(editcap_OBJECTS) getopt.obj strptime.obj wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
266         @echo Linking $@
267         $(LINK) @<<
268                 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(editcap_OBJECTS) getopt.obj strptime.obj $(editcap_LIBS) image\editcap.res
269 <<
270 !IF $(MSC_VER_REQUIRED) >= 1400
271         mt.exe -nologo -manifest "editcap.exe.manifest" -outputresource:editcap.exe;1
272 !ENDIF
273
274 mergecap.exe    : $(LIBS_CHECK)  config.h svnversion.h mergecap.obj merge.obj getopt.obj wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
275         @echo Linking $@
276         $(LINK) @<<
277                 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj merge.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
278 <<
279 !IF $(MSC_VER_REQUIRED) >= 1400
280         mt.exe -nologo -manifest "mergecap.exe.manifest" -outputresource:mergecap.exe;1
281 !ENDIF
282
283 text2pcap.exe   : $(LIBS_CHECK) config.h text2pcap.obj text2pcap-scanner.obj getopt.obj wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib strptime.obj image\text2pcap.res
284         @echo Linking $@
285         $(LINK) @<<
286                 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj $(text2pcap_LIBS) strptime.obj image\text2pcap.res
287 <<
288 !IF $(MSC_VER_REQUIRED) >= 1400
289         mt.exe -nologo -manifest "text2pcap.exe.manifest" -outputresource:text2pcap.exe;1
290 !ENDIF
291
292 dftest.exe      : $(dftest_OBJECTS) epan
293         @echo Linking $@
294         $(LINK) @<<
295                 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS)
296 <<
297 !IF $(MSC_VER_REQUIRED) >= 1400
298         mt.exe -nologo -manifest "dftest.exe.manifest" -outputresource:dftest.exe;1
299 !ENDIF
300
301 randpkt.exe     : $(randpkt_OBJECTS) getopt.obj
302         @echo Linking $@
303         $(LINK) @<<
304                 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS) getopt.obj
305 <<
306 !IF $(MSC_VER_REQUIRED) >= 1400
307         mt.exe -nologo -manifest "randpkt.exe.manifest" -outputresource:randpkt.exe;1
308 !ENDIF
309
310 dumpcap.exe     : $(LIBS_CHECK) config.h svnversion.h $(dumpcap_OBJECTS) getopt.obj inet_ntop.obj mkstemp.obj wsutil\libwsutil.lib wiretap\wiretap-$(WTAP_VERSION).lib image\dumpcap.res
311         @echo Linking $@
312         $(LINK) @<<
313                 /OUT:dumpcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dumpcap_LIBS) $(dumpcap_OBJECTS) getopt.obj inet_ntop.obj mkstemp.obj image\dumpcap.res
314 <<
315 !IF $(MSC_VER_REQUIRED) >= 1400
316         mt.exe -nologo -manifest "dumpcap.exe.manifest" -outputresource:dumpcap.exe;1
317 !ENDIF
318
319
320 config.h        : config.h.win32 config.nmake
321         sed -e s/@VERSION@/$(VERSION)/ \
322             -e "s/@HAVE_C_ARES@/$(C_ARES_CONFIG)/" \
323             -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
324             -e "s/@HAVE_PCRE@/$(PCRE_CONFIG)/" \
325             -e "s/@HAVE_KFW@/$(KFW_CONFIG)/" \
326             -e "s/@HAVE_NETTLE@/$(NETTLE_CONFIG)/" \
327             -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
328             -e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
329             -e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
330             -e "s/@HAVE_PCAP_DATALINK_NAME_TO_VAL@/$(PCAP_DATALINK_NAME_TO_VAL_CONFIG)/" \
331             -e "s/@HAVE_PCAP_DATALINK_VAL_TO_NAME@/$(PCAP_DATALINK_VAL_TO_NAME_CONFIG)/" \
332             -e "s/@HAVE_PCAP_BREAKLOOP@/$(PCAP_BREAKLOOP_CONFIG)/" \
333             -e "s/@HAVE_REMOTE@/$(PCAP_HAVE_REMOTE_CONFIG)/" \
334             -e "s/@HAVE_PCAP_REMOTE@/$(PCAP_REMOTE_CONFIG)/" \
335             -e "s/@HAVE_PCAP_OPEN@/$(PCAP_OPEN_CONFIG)/" \
336         -e "s/@HAVE_PCAP_LIST_DATALINKS@/$(PCAP_LIST_DATALINKS_CONFIG)/" \
337         -e "s/@HAVE_PCAP_SET_DATALINK@/$(PCAP_SET_DATALINK_CONFIG)/" \
338             -e "s/@HAVE_PCAP_FINDALLDEVS_EX@/$(PCAP_FINDALLDEVS_EX_CONFIG)/" \
339             -e "s/@HAVE_PCAP_CREATESRCSTR@/$(PCAP_CREATESRCSTR_CONFIG)/" \
340             -e "s/@HAVE_PCAP_SETSAMPLING@/$(PCAP_SETSAMPLING_CONFIG)/" \
341             -e "s/@HAVE_LIBWIRESHARKDLL@/$(LIBWIRESHARK_CONFIG)/" \
342             -e "s/@WPCAP_CONSTIFIED@/$(WPCAP_CONSTIFIED_CONFIG)/" \
343             -e "s/@HAVE_LIBGNUTLS@/$(GNUTLS_CONFIG)/" \
344             -e "s/@HAVE_LIBGCRYPT@/$(LIBGCRYPT_CONFIG)/" \
345             -e "s/@HAVE_LUA@/$(LUA_CONFIG)/" \
346             -e "s/@HAVE_LUA_5_1@/$(LUA_VERSION)/" \
347             -e "s/@HAVE_AIRPCAP@/$(AIRPCAP_CONFIG)/" \
348             -e "s/@HAVE_AIRPDCAP@/$(AIRPDCAP_CONFIG)/" \
349             -e "s/@HAVE_LIBPORTAUDIO@/$(PORTAUDIO_CONFIG)/" \
350             -e "s/@PORTAUDIO_API_1@/$(PORTAUDIO_API_CONFIG)/" \
351             -e "s/@HAVE_SMI@/$(SMI_CONFIG)/" \
352             -e "s/@HAVE_GEOIP@/$(GEOIP_CONFIG)/" \
353             -e "s/@INET6@/$(INET6_CONFIG)/" \
354             < config.h.win32 > $@
355
356 ps.c    : rdps.exe print.ps
357         rdps print.ps ps.c
358
359
360 #
361 # Build the version string
362 #
363 !IF EXIST(".svn/entries")
364 SVNENTRIES = .svn/entries
365 !ELSE
366 SVNENTRIES =
367 !ENDIF
368 svnversion.h: $(SVNENTRIES)
369         rm -f svnversion.h
370         $(PERL) make-version.pl
371
372 #
373 # Build the short version of the authors file for the about dialog
374 #
375 AUTHORS-SHORT: AUTHORS make-authors-short.pl
376         $(PERL) perlnoutf.pl make-authors-short.pl < AUTHORS > AUTHORS-SHORT
377
378 #
379 # Build the short version of the authors file with formatting codes for
380 # the man page
381 #
382 AUTHORS-SHORT-FORMAT: AUTHORS-SHORT make-authors-format.pl
383     $(PERL) perlnoutf.pl make-authors-format.pl < AUTHORS-SHORT > AUTHORS-SHORT-FORMAT
384
385 #
386 # Build "tshark-tap-register.c", which contains a function
387 # "register_all_tap_listeners()"
388 # that calls the register routines for all TShark tap listeners.
389 #
390 # We do this by grepping through sources.
391 #
392 # Formatting conventions:  The name of the tap_listener_register_*
393 # routines must start in column zero, or must be preceded only by
394 # "void " starting in column zero, and must not be inside #if.
395 #
396 # The first argument is the name of the file to write.
397 # The second argument is the directory in which the source files live.
398 # All subsequent arguments are the files to scan.
399 #
400 tshark-tap-register.c: $(TSHARK_TAP_SRC) make-tapreg-dotc
401         @echo Making tshark-tap-register.c
402         @$(SH) make-tapreg-dotc tshark-tap-register.c . $(TSHARK_TAP_SRC)
403
404 text2pcap-scanner.c : text2pcap-scanner.l
405         $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
406
407 clean-local: clean-deps
408         rm -f $(wireshark_OBJECTS) $(tshark_OBJECTS) $(dumpcap_OBJECTS) $(rawshark_OBJECTS) \
409                 $(EXTRA_OBJECTS) $(EXECUTABLES) *.pdb *.exe.manifest \
410                 capinfos.obj editcap.obj mergecap.obj text2pcap.obj \
411                 nio-ie5.obj update.obj \
412                 text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
413                 rdps.pdb rdps.exe rdps.ilk config.h ps.c AUTHORS-SHORT \
414                 AUTHORS-SHORT-FORMAT $(LIBS_CHECK) \
415                 dftest.obj dftest.exe randpkt.obj randpkt.ext \
416                 doxygen.cfg \
417                 $(RESOURCES) libwireshark.dll wiretap-$(WTAP_VERSION).dll \
418                 libwsutil.dll \
419                 wireshark.bsc
420
421 clean: clean-local
422         cd asn1
423         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
424         cd ../wiretap
425         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
426         cd ../wsutil
427         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
428         cd ../codecs
429         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
430         cd ../gtk
431         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
432         cd ../epan
433         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
434         cd ../plugins
435         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
436         cd ../tools
437         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
438         cd ../image
439         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
440         cd ../doc
441         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
442         cd ../help
443         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
444         cd ../packaging/nsis
445         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
446         cd ../u3/win32
447         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
448         cd ../../portableapps/win32
449         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
450         cd ../../..
451
452 # "distclean" removes all files not part of the distribution.
453 # It does not remove generated files that are part of the distribution.
454 distclean-local: clean-local
455 !IFDEF ADNS_DIR
456 !IF "$(MSVC_VARIANT)" != "MSVC6"
457         rm -f $(ADNS_DLL) $(ADNS_LIBS)
458 !ENDIF
459 !ENDIF
460 !IFDEF ZLIB_DIR
461         rm -f $(ZLIB_DLL) $(ZLIB_DIR)\zlib1.dll.manifest \
462                 $(ZLIB_DIR)\include\zlib.h $(ZLIB_DIR)\include\zconf.h \
463                 $(ZLIB_DIR)\lib\zdll.lib
464 !ENDIF
465         rm -f config.h $(BUILT_SOURCES)
466
467 distclean: distclean-local
468         cd wiretap
469         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
470         cd ../wsutil
471         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
472         cd ../codecs
473         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
474         cd ../gtk
475         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
476         cd ../epan
477         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
478         cd ../plugins
479         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
480         cd ../tools
481         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
482         cd ../image
483         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
484         cd ../doc
485         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
486         cd ../help
487         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
488         cd ../packaging/nsis
489         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
490         cd ../u3/win32
491         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
492         cd ../../portableapps/win32
493         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
494         cd ../../..
495
496 # Make "maintainer-clean" only if you would like to remove ALL generated
497 # files.
498 # Be sure to have python and perl installed to regenerate them.
499 maintainer-clean-local: distclean-local
500         rm -f $(GENERATED_FILES)
501
502 maintainer-clean: maintainer-clean-local
503         cd wiretap
504         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
505         cd ../wsutil
506         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
507         cd ../codecs
508         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
509         cd ../gtk
510         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
511         cd ../epan
512         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
513         cd ../plugins
514         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
515         cd ../tools
516         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
517         cd ../image
518         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
519         cd ../doc
520         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
521         cd ../help
522         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
523         cd ../packaging/nsis
524         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
525         cd ../u3/win32
526         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
527         cd ../../portableapps/win32
528         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
529         cd ../../..
530
531 tools::
532         cd tools
533         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
534         cd ..
535
536 image::
537         cd image
538         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
539         cd ..
540
541 !IFDEF ADNS_DIR
542 # Non-MSVC6 variants have to avoid indirectly using msvcrt.dll,
543 # therefore compile the adns dll from source ADNS_DIR package.
544 # To avoid path problems, copy the adns sources to a temp dir,
545 # compile and copy the resulting files back to (source) ADNS_DIR
546 #
547 # Unfortunately:
548 # - we need to "patch" adns_dll.rep and adns_dll.rc (at least for MSVC2005EE)
549 # - on MSVC6 we can't easily rebuild, because iphlpapi.h is needed
550 #
551 $(ADNS_DLL):
552 !IF "$(MSVC_VARIANT)" == "MSVC6"
553         if not exist $(WIRESHARK_LIBS)\$(MSVC_VARIANT)\adns mkdir $(WIRESHARK_LIBS)\$(MSVC_VARIANT)\adns
554         copy $(ADNS_DIR)\adns_win32\lib\adns_dll.dll $(ADNS_DLL)
555         copy $(ADNS_DIR)\adns_win32\lib\adns_dll.lib $(ADNS_LIBS)
556 !ELSE
557         xcopy $(ADNS_DIR) adns.tmp /D /I /E /Y
558         copy adns_dll.dep adns.tmp\adns_win32\adns_dll
559         copy adns_dll.rc adns.tmp\adns_win32\adns_dll
560         cd adns.tmp\adns_win32\adns_dll
561         set CFG=adns_dll - Win32 Release
562         $(MAKE) /$(MAKEFLAGS) -f adns_dll.mak LOC="$(LOCAL_CFLAGS)"
563         cd ..\lib
564 !IF $(MSC_VER_REQUIRED) >= 1400
565         mt.exe -nologo -manifest "adns_dll.dll.manifest" -outputresource:adns_dll.dll;2
566 !ENDIF
567         if not exist $(WIRESHARK_LIBS)\$(MSVC_VARIANT)\adns mkdir $(WIRESHARK_LIBS)\$(MSVC_VARIANT)\adns
568         copy adns_dll.dll $(ADNS_DLL)
569         copy adns_dll.lib $(ADNS_LIBS)
570         cd ..\..\..
571         rm -r -f adns.tmp
572 !ENDIF
573 !ENDIF
574
575 !IFDEF ZLIB_DIR
576 # Non-MSVC6 variants have to avoid indirectly using msvcrt.dll,
577 # therefore compile the zlib dll from source ZLIB_DIR package.
578 # To avoid path problems, copy the zlib sources to a temp dir,
579 # compile and copy the resulting files back to (source) ZLIB_DIR
580 $(ZLIB_DLL):
581         xcopy $(ZLIB_DIR) zlib.tmp /D /I /E /Y
582         cd zlib.tmp
583         $(MAKE) /$(MAKEFLAGS) -f win32/Makefile.msc zlib1.dll LOC="$(LOCAL_CFLAGS)"
584         if not exist $(ZLIB_DIR) mkdir $(ZLIB_DIR)
585         if not exist $(ZLIB_DIR)\lib mkdir $(ZLIB_DIR)\lib
586         if not exist $(ZLIB_DIR)\include mkdir $(ZLIB_DIR)\include
587 !IF $(MSC_VER_REQUIRED) >= 1400
588         mt.exe -nologo -manifest "zlib1.dll.manifest" -outputresource:zlib1.dll;2
589 !ENDIF
590         copy zlib1.dll $(ZLIB_DIR)
591         copy zdll.lib $(ZLIB_DIR)\lib
592         copy zconf.h $(ZLIB_DIR)\include
593         copy zlib.h $(ZLIB_DIR)\include
594         cd ..
595         rm -r -f zlib.tmp
596 !ENDIF
597
598 wsutil::
599         cd wsutil
600         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
601         cd ..
602
603 wiretap::
604         cd wiretap
605         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
606         cd ..
607
608 codecs::
609         cd codecs
610         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
611         cd ..
612
613 gtk:: help config.h svnversion.h AUTHORS-SHORT doxygen
614         cd gtk
615         $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake libui.lib
616         cd ..
617
618 epan:: $(RESOURCES) $(ZLIB_DLL) wiretap\wiretap-$(WTAP_VERSION).lib $(BUILT_SOURCES) doxygen
619         cd epan
620         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
621         cd ..
622
623 plugins::
624         cd plugins
625         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
626         cd ..
627
628 doc::
629         cd doc
630         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
631         cd ..
632
633 help::
634         cd help
635         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
636         cd ..
637
638 doxygen.cfg: config.nmake doxygen.cfg.in
639         sed -e s/@VERSION@/$(VERSION)/ \
640             < doxygen.cfg.in > $@
641
642 doxygen-run:
643 !IFDEF DOXYGEN
644         $(DOXYGEN) doxygen.cfg
645 !ENDIF
646
647 doxygen: doxygen.cfg doxygen-run
648         
649
650 ################################################################################
651 # Prepare build environment by downloading and installing required libraries
652 ################################################################################
653
654 # The required tools to build Wireshark.
655 #
656 # The 'find' tool is available both in \WINNT\System32 and in cygwin's /usr/bin.
657 # We only need the cygwin version (for some shell scripts).
658 # In the PATH, System32 is before cygwin's dir, so explicitly check for /usr/bin/find.
659 REQUIRED_TOOLS=\
660         $(CC) \
661         $(LINK) \
662         nmake \
663 !IF $(MSC_VER_REQUIRED) >= 1400
664         mt \
665 !ENDIF
666         $(SH_PROG)      \
667         $(YACC) \
668         $(LEX)  \
669         env     \
670         grep    \
671         /usr/bin/find   \
672         $(PERL) \
673         $(PYTHON)       \
674         sed     \
675         unzip   \
676         wget
677
678 verify_tools:
679         @$(SH) tools\win32-setup.sh --appverify $(REQUIRED_TOOLS)
680
681 # Targets and etc used to verify or download libraries
682
683 !IFNDEF WIN32_SETUP_OPT
684 WIN32_SETUP_OPT=--download
685 !ENDIF
686
687 # Verify that the required library 'package' (zip) files have been downloaded.
688 # (It seems reasonable to assume that if the files have been downloaded
689 #  then they have been installed).
690 check_libs:
691         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake WIN32_SETUP_OPT=--libverify process_libs
692
693 # Verify library packages only if Makefile.nmake has been updated
694 #  (or dummy file doesn't exist because of 'make clean' or whatever)
695 # (To disable library verification when Makefile.nmake changes,
696 #  comment out the commands for the following target).
697 # touch is only called if libverify succeeds.
698 #  (One microsec is added to the makefile.nmake time since the time set by [cygwin ?] 'touch --reference' 
699 #   apparently has the nanosecs truncated from the reference file time [at least on Windows Vista]).
700 $(LIBS_CHECK): Makefile.nmake
701         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake WIN32_SETUP_OPT=--libverify process_libs
702         @touch --reference=Makefile.nmake -d "+0.000001 sec" $@
703
704 # Download (if needed) and install all the required libraries into WIRESHARK_LIBS.
705 # A clean_setup is done first to ensure that the target dirs don't
706 # contain old files remaining from a previous setup run.
707 setup: verify_tools clean_setup process_libs
708
709
710 # The process_libs target when invoked causes either a --libverify or a --download for all the required libraries.
711 # (The choice is determined by the value of the macro WIN32_SETUP_OPT).
712 process_libs:
713 !IF "$(WIN32_SETUP_OPT)" == "--libverify"
714     @$(SH) tools\win32-setup.sh --checktag "$(WIRESHARK_LIBS)"
715 !ENDIF
716     if not exist $(WIRESHARK_LIBS) md $(WIRESHARK_LIBS)
717 !IF "$(GTK_INST_VERSION)" == "2.14"
718         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
719                 glib gtk2.14/glib_2.18.4-1_win32.zip
720         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
721                 glib gtk2.14/glib-dev_2.18.4-1_win32.zip
722 !ELSEIF "$(GTK_INST_VERSION)" == "2.12"
723         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
724                 glib gtk2.12/glib_2.18.0-1_win32.zip
725         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
726                 glib gtk2.12/glib-dev_2.18.0-1_win32.zip
727 !ELSE
728 !ERROR ? Unknown or invalid GTK_INST_VERSION
729 !ENDIF
730 !IFDEF ICONV_DIR
731         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
732                 libiconv-1.9.1.bin.woe32 libiconv-1.9.1.bin.woe32.zip
733 !ENDIF
734         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
735                 gettext-runtime-0.17-1 gettext-runtime-0.17-1.zip
736 !IFDEF KFW_DIR
737         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
738                 kfw-2.5 kfw-2.5.zip
739 !ENDIF
740 !IFDEF PCAP_DIR
741         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
742                 . WpdPack_4_0_2.zip
743 !ENDIF
744 !IFDEF AIRPCAP_DIR
745         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
746                 AirPcap_Devpack_1_0_0_594 AirPcap_Devpack_1_0_0_594.zip
747 !ENDIF
748 !IFDEF C_ARES_DIR
749         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
750                 . c-ares-1.6.0ws.zip
751 !ENDIF
752 !IFDEF ADNS_DIR
753         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
754                 . adns-1.0-win32-05ws.zip
755 !ENDIF
756 !IFDEF PCRE_DIR
757         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
758                 pcre-7.0 pcre-7.0-bin.zip
759         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
760                 pcre-7.0 pcre-7.0-lib.zip
761 !ENDIF
762 !IFDEF ZLIB_DIR
763         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
764                 zlib123 zlib123ws.zip
765 !ENDIF
766 !IFDEF LUA_DIR
767         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
768                 lua5.1.4 lua5_1_4_Win32_dll9_lib.zip
769 !ENDIF
770
771 !IFDEF GNUTLS_DIR
772         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
773                 . gnutls-2.6.4-1.zip
774 !ENDIF
775 !IFDEF PORTAUDIO_DIR
776         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
777                 . portaudio_v19_2.zip
778 !ENDIF
779 !IFDEF SMI_DIR
780         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
781                 . libsmi-0.4.8.zip
782 !ENDIF
783 !IFDEF GEOIP_DIR
784         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
785                 . GeoIP-1.4.5ws.zip
786 !ENDIF
787
788 !IFDEF GTK_DIR
789 !IF "$(GTK_INST_VERSION)" == "2.14"
790         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
791                 gtk2 gtk2.14/gtk+_2.14.7-1_win32.zip
792         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
793                 gtk2 gtk2.14/gtk+-dev_2.14.7-1_win32.zip
794         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
795                 gtk2 gtk2.14/cairo_1.8.6-1_win32.zip
796         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
797                 gtk2 gtk2.14/cairo-dev_1.8.6-1_win32.zip
798         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
799                 gtk2 gtk2.14/atk_1.24.0-1_win32.zip
800         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
801                 gtk2 gtk2.14/atk-dev_1.24.0-1_win32.zip
802         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
803                 gtk2 gtk2.14/libpng_1.2.32-1_win32.zip
804         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
805                 gtk2 gtk2.14/tiff-3.8.2-1-bin.zip
806         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
807                 gtk2 gtk2.14/jpeg-6b-4-bin.zip
808 !ELSEIF "$(GTK_INST_VERSION)" == "2.12"
809         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
810                 gtk2 gtk2.12/gtk+-2.12.11.zip
811         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
812                 gtk2 gtk2.12/gtk+-dev-2.12.11.zip
813         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
814                 gtk2 gtk2.12/cairo-1.6.4-2.zip
815         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
816                 gtk2 gtk2.12/cairo-dev-1.6.4-2.zip
817         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
818                 gtk2 gtk2.12/atk-1.22.0.zip
819         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
820                 gtk2 gtk2.12/atk-dev-1.22.0.zip
821         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
822                 gtk2 gtk2.12/libpng-1.2.29.zip
823         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
824                 gtk2 gtk2.12/tiff-3.8.2-1-bin.zip
825         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
826                 gtk2 gtk2.12/jpeg-6b-4-bin.zip
827 !ELSE
828 !ERROR ? Unknown or invalid GTK_INST_VERSION
829 !ENDIF
830 !IF "$(PANGO_INST_VERSION)" == "1.22"
831         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
832                 gtk2 gtk2.14/pango_1.22.2-1_win32.zip
833         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
834                 gtk2 gtk2.14/pango-dev_1.22.2-1_win32.zip
835 !ELSE
836 !ERROR ? Unknown or invalid PANGO_INST_VERSION
837 !ENDIF
838 !ENDIF
839 !IFDEF HHC_DIR
840         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
841                 user-guide user-guide-24665.zip
842 !ENDIF
843 !IFDEF UPX
844         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
845                 . upx301w.zip
846 !ENDIF
847 !IFDEF NASM
848         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
849                 . nasm-2.02-win32.zip
850 !ENDIF
851 !IF "$(WIN32_SETUP_OPT)" == "--download"
852     @$(SH) tools\win32-setup.sh --settag "$(WIRESHARK_LIBS)"
853 !ENDIF
854         @echo.
855         @echo Wireshark is ready to build.
856
857 # Cleanup files installed by the setup target. It will not remove the
858 # downloaded zip files.
859 # WHEN UPDATING LIBRARY VERSIONS, KEEP ALSO ONE FORMER VERSION SO
860 # UPDATING REMOVES THE FORMER USER DIRS
861 clean_setup:
862     rm -r -f $(WIRESHARK_LIBS)/adns-1.0-win32-05ws
863     rm -r -f $(WIRESHARK_LIBS)/c-ares-1.5.3ws
864     rm -r -f $(WIRESHARK_LIBS)/c-ares-1.6.0ws
865     rm -r -f $(WIRESHARK_LIBS)/gettext-0.14.5
866     rm -r -f $(WIRESHARK_LIBS)/gettext-runtime-0.17
867     rm -r -f $(WIRESHARK_LIBS)/gettext-runtime-0.17-1
868     rm -r -f $(WIRESHARK_LIBS)/glib
869     rm -r -f $(WIRESHARK_LIBS)/gnutls-2.6.3-1
870     rm -r -f $(WIRESHARK_LIBS)/gnutls-2.6.4-1
871     rm -r -f $(WIRESHARK_LIBS)/gtk2
872     rm -r -f $(WIRESHARK_LIBS)/gtk+
873     rm -r -f $(WIRESHARK_LIBS)/gtk-wimp
874     rm -r -f $(WIRESHARK_LIBS)/kfw-2.5
875     rm -r -f $(WIRESHARK_LIBS)/libiconv-1.9.1.bin.woe32
876     rm -r -f $(WIRESHARK_LIBS)/lua5.1
877     rm -r -f $(WIRESHARK_LIBS)/lua5.1.4
878     rm -r -f $(WIRESHARK_LIBS)/libsmi-0.4.5
879     rm -r -f $(WIRESHARK_LIBS)/libsmi-0.4.8
880     rm -r -f $(WIRESHARK_LIBS)/nasm-2.00
881     rm -r -f $(WIRESHARK_LIBS)/nasm-2.02
882     rm -r -f $(WIRESHARK_LIBS)/pcre-6.4
883     rm -r -f $(WIRESHARK_LIBS)/pcre-7.0
884     rm -r -f $(WIRESHARK_LIBS)/portaudio_v19
885     rm -r -f $(WIRESHARK_LIBS)/portaudio_v19_2
886     rm -r -f $(WIRESHARK_LIBS)/user-guide
887     rm -r -f $(WIRESHARK_LIBS)/WpdPack
888     rm -r -f $(WIRESHARK_LIBS)/AirPcap_Devpack_1_0_0_594
889     rm -r -f $(WIRESHARK_LIBS)/zlib123
890     rm -r -f $(WIRESHARK_LIBS)/zlib123-dll
891     rm -r -f $(WIRESHARK_LIBS)/upx301w
892     rm -r -f $(WIRESHARK_LIBS)/GeoIP-1.4.5ws
893
894 ################################################################################
895 # Prepare the debug trees for running Wireshark/Tshark from there.
896 ################################################################################
897
898
899 # prepare debugging of Wireshark in INSTALL_DIR
900 debug-wireshark: wireshark.exe install-generated-files
901
902 # prepare debugging of tshark in INSTALL_DIR
903 debug-tshark: tshark.exe install-generated-files
904
905 # prepare debugging of rawshark in INSTALL_DIR
906 debug-rawshark: rawshark.exe install-generated-files
907
908 # prepare debugging of dumpcap in INSTALL_DIR
909 debug-dumpcap: dumpcap.exe install-generated-files
910
911
912 # install generated files (exe, "our" libs, ...)
913 install-generated-files:
914         set copycmd=/y
915         if not exist $(INSTALL_DIR) mkdir $(INSTALL_DIR)
916 !IF "$(MSVC_VARIANT)" == "MSVC2008"
917         xcopy "$(MSVCR_DLL)" $(INSTALL_DIR)\*.*
918 !ENDIF
919 !IFDEF ENABLE_LIBWIRESHARK
920         xcopy epan\libwireshark.dll $(INSTALL_DIR) /d
921 !ENDIF
922         xcopy ".\wiretap\wiretap-$(WTAP_VERSION).dll" $(INSTALL_DIR) /d
923         if exist ".\wiretap\wiretap-$(WTAP_VERSION).pdb" xcopy ".\wiretap\wiretap-$(WTAP_VERSION).pdb" $(INSTALL_DIR) /d
924         xcopy ".\epan\libwireshark.dll" $(INSTALL_DIR) /d
925         xcopy ".\wsutil\libwsutil.dll" $(INSTALL_DIR) /d
926         if exist ".\epan\libwireshark.pdb" xcopy ".\epan\libwireshark.pdb" $(INSTALL_DIR) /d
927         if exist wireshark.exe copy wireshark.exe $(INSTALL_DIR)\wireshark.exe
928         if exist wireshark.pdb copy wireshark.pdb $(INSTALL_DIR)\wireshark.pdb
929         if exist ".\docbook\user-guide.chm" xcopy ".\docbook\user-guide.chm" $(INSTALL_DIR) /d
930         if exist tshark.exe xcopy tshark.exe $(INSTALL_DIR) /d
931         if exist tshark.pdb xcopy tshark.pdb $(INSTALL_DIR) /d
932         if exist rawshark.exe xcopy rawshark.exe $(INSTALL_DIR) /d
933         if exist rawshark.exe.manifest xcopy rawshark.exe.manifest $(INSTALL_DIR) /d
934         if exist rawshark.pdb xcopy rawshark.pdb $(INSTALL_DIR) /d
935         if exist dumpcap.exe xcopy dumpcap.exe $(INSTALL_DIR) /d
936         if exist dumpcap.pdb xcopy dumpcap.pdb $(INSTALL_DIR) /d
937         if exist mergecap.exe xcopy mergecap.exe $(INSTALL_DIR) /d
938         if exist mergecap.pdb xcopy mergecap.pdb $(INSTALL_DIR) /d
939         if exist text2pcap.exe xcopy text2pcap.exe $(INSTALL_DIR) /d
940         if exist text2pcap.pdb xcopy text2pcap.pdb $(INSTALL_DIR) /d
941         if exist capinfos.exe xcopy capinfos.exe $(INSTALL_DIR) /d
942         if exist capinfos.pdb xcopy capinfos.pdb $(INSTALL_DIR) /d
943         if exist editcap.exe xcopy editcap.exe $(INSTALL_DIR) /d
944         if exist editcap.pdb xcopy editcap.pdb $(INSTALL_DIR) /d
945         xcopy ".\AUTHORS-SHORT" $(INSTALL_DIR) /d
946         xcopy ".\manuf" $(INSTALL_DIR) /d
947         xcopy ".\services" $(INSTALL_DIR) /d
948         xcopy ".\README" $(INSTALL_DIR) /d
949         xcopy ".\README.win32" $(INSTALL_DIR) /d
950         xcopy ".\AUTHORS-SHORT" $(INSTALL_DIR) /d
951         xcopy ".\COPYING" $(INSTALL_DIR) /d
952         copy ".\NEWS" $(INSTALL_DIR)\NEWS.txt
953         xcopy ".\cfilters" $(INSTALL_DIR) /d
954         xcopy ".\colorfilters" $(INSTALL_DIR) /d
955         xcopy ".\dfilters" $(INSTALL_DIR) /d
956         xcopy ".\smi_modules" $(INSTALL_DIR) /d
957 !IFDEF LUA_DIR
958         xcopy ".\epan\wslua\init.lua" $(INSTALL_DIR) /d
959         xcopy ".\epan\wslua\console.lua" $(INSTALL_DIR) /d
960 !ENDIF
961         xcopy doc\*.html $(INSTALL_DIR) /d
962         if not exist $(INSTALL_DIR)\help mkdir $(INSTALL_DIR)\help
963         xcopy ".\help\*.*" $(INSTALL_DIR)\help /d
964 # you can't reliably use xcopy to rename files "on the fly" (so copy first, then rename)
965         xcopy ".\help\faq.txt" $(INSTALL_DIR) /d
966         if exist $(INSTALL_DIR)\FAQ del $(INSTALL_DIR)\FAQ
967     ren $(INSTALL_DIR)\faq.txt FAQ 
968         if not exist $(INSTALL_DIR)\dtds mkdir $(INSTALL_DIR)\dtds
969         xcopy ".\dtds\*.*" $(INSTALL_DIR)\dtds /d
970         if not exist $(INSTALL_DIR)\asn1 mkdir $(INSTALL_DIR)\asn1
971         echo create empty asn1 default.tt file to prevent problems 2> $(INSTALL_DIR)\asn1\default.tt
972         if not exist $(INSTALL_DIR)\radius mkdir $(INSTALL_DIR)\radius
973         xcopy ".\radius\*.*" $(INSTALL_DIR)\radius /d
974         if not exist $(INSTALL_DIR)\diameter mkdir $(INSTALL_DIR)\diameter
975         xcopy ".\diameter\*.dtd" $(INSTALL_DIR)\diameter /d
976         xcopy ".\diameter\*.xml" $(INSTALL_DIR)\diameter /d
977         if not exist $(INSTALL_DIR)\tpncp mkdir $(INSTALL_DIR)\tpncp
978         xcopy ".\tpncp\*.dat" $(INSTALL_DIR)\tpncp /d
979         if not exist $(INSTALL_DIR)\wimaxasncp mkdir $(INSTALL_DIR)\wimaxasncp
980         xcopy ".\wimaxasncp\*.*" $(INSTALL_DIR)\wimaxasncp /d
981         if not exist $(INSTALL_DIR)\plugins mkdir $(INSTALL_DIR)\plugins
982         if not exist $(INSTALL_DIR)\plugins\$(VERSION) mkdir $(INSTALL_DIR)\plugins\$(VERSION)
983         cd plugins 
984         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake install-plugins 
985         cd .. 
986
987 # "install-all" will copy all files needed to run Wireshark/Tshark
988 # to the INSTALL_DIR, so you can run/debug Wireshark/Tshark from there.
989 install-all: install-generated-files
990         set copycmd=/y
991         if not exist $(INSTALL_DIR) mkdir $(INSTALL_DIR)
992         xcopy $(GTK_DIR)\bin\libgdk-win32-2.0-0.dll $(INSTALL_DIR) /d
993         xcopy $(GTK_DIR)\bin\libgdk_pixbuf-2.0-0.dll $(INSTALL_DIR) /d
994         xcopy $(GTK_DIR)\bin\libgtk-win32-2.0-0.dll $(INSTALL_DIR) /d
995         xcopy $(GTK_DIR)\bin\libatk-1.0-0.dll $(INSTALL_DIR) /d
996         xcopy $(GTK_DIR)\bin\libpango-1.0-0.dll $(INSTALL_DIR) /d
997         xcopy $(GTK_DIR)\bin\libpangowin32-1.0-0.dll $(INSTALL_DIR) /d
998         if not exist $(INSTALL_DIR)\etc mkdir $(INSTALL_DIR)\etc
999         if not exist $(INSTALL_DIR)\etc\gtk-2.0 mkdir $(INSTALL_DIR)\etc\gtk-2.0
1000         if not exist $(INSTALL_DIR)\etc\pango mkdir $(INSTALL_DIR)\etc\pango
1001         if not exist $(INSTALL_DIR)\lib mkdir $(INSTALL_DIR)\lib
1002         if not exist $(INSTALL_DIR)\lib\gtk-2.0 mkdir $(INSTALL_DIR)\lib\gtk-2.0
1003         if not exist $(INSTALL_DIR)\lib\gtk-2.0\modules mkdir $(INSTALL_DIR)\lib\gtk-2.0\modules
1004         if not exist $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR) mkdir $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)
1005         if not exist $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders mkdir $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders
1006 #       if not exist $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\immodules mkdir $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\immodules
1007         if not exist $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\engines mkdir $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\engines
1008 #       if not exist $(INSTALL_DIR)\lib\pango mkdir $(INSTALL_DIR)\lib\pango
1009 #       if not exist $(INSTALL_DIR)\lib\pango\$(PANGO_LIB_DIR) mkdir $(INSTALL_DIR)\lib\pango\$(PANGO_LIB_DIR)
1010 #       if not exist $(INSTALL_DIR)\lib\pango\$(PANGO_LIB_DIR)\modules mkdir $(INSTALL_DIR)\lib\pango\$(PANGO_LIB_DIR)\modules
1011         xcopy $(GTK_DIR)\etc\gtk-2.0\*.* $(INSTALL_DIR)\etc\gtk-2.0 /d
1012         xcopy $(GTK_DIR)\etc\pango\pango.* $(INSTALL_DIR)\etc\pango /d
1013         xcopy $(GTK_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders\libpixbufloader-*.dll $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders /d
1014         xcopy $(GTK_DIR)\lib\gtk-2.0\modules\libgail.dll $(INSTALL_DIR)\lib\gtk-2.0\modules /d
1015         xcopy $(GTK_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\engines\libpixmap.dll $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\engines /d
1016 #       xcopy $(GTK_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\immodules\im-*.dll $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\immodules /d
1017 #       xcopy $(GTK_DIR)\lib\pango\$(PANGO_LIB_DIR)\modules\pango-*.dll $(INSTALL_DIR)\lib\pango\$(PANGO_LIB_DIR)\modules /d
1018 !IFDEF NEED_LIBPNG_DLL
1019 #       xcopy $(GTK_DIR)\bin\libpng13.dll $(INSTALL_DIR) /d
1020         xcopy $(GTK_DIR)\bin\libpng12-0.dll $(INSTALL_DIR) /d
1021 !ENDIF
1022 !IFDEF NEED_LIBTIFF_DLL
1023         xcopy $(GTK_DIR)\bin\libtiff3.dll $(INSTALL_DIR) /d
1024 !ENDIF
1025 !IFDEF NEED_LIBJPEG_DLL
1026         xcopy $(GTK_DIR)\bin\jpeg62.dll $(INSTALL_DIR) /d
1027 !ENDIF
1028 !IFDEF NEED_CAIRO_DLL
1029         xcopy $(GTK_DIR)\bin\libcairo-2.dll $(INSTALL_DIR)  /d
1030         xcopy $(GTK_DIR)\bin\libpangocairo-1.0-0.dll $(INSTALL_DIR) /d
1031 !ENDIF
1032         if not exist $(INSTALL_DIR)\$(GTK_WIMP_DLLDST_DIR) mkdir $(INSTALL_DIR)\$(GTK_WIMP_DLLDST_DIR)
1033         xcopy "$(GTK_WIMP_DLLSRC_DIR)\libwimp.dll" $(INSTALL_DIR)\$(GTK_WIMP_DLLDST_DIR) /d
1034         if not exist $(INSTALL_DIR)\$(GTK_WIMP_RCDST_DIR) mkdir $(INSTALL_DIR)\$(GTK_WIMP_RCDST_DIR)
1035         xcopy "$(GTK_WIMP_RCSRC_DIR)\gtkrc" $(INSTALL_DIR)\$(GTK_WIMP_RCDST_DIR) /d
1036         xcopy $(GLIB_DIR)\bin\libgio-2.0-0.dll $(INSTALL_DIR) /d
1037         xcopy $(GLIB_DIR)\bin\libglib-2.0-0.dll $(INSTALL_DIR) /d
1038         xcopy $(GLIB_DIR)\bin\libgmodule-2.0-0.dll $(INSTALL_DIR) /d
1039         xcopy $(GLIB_DIR)\bin\libgobject-2.0-0.dll $(INSTALL_DIR) /d
1040 !IFDEF ICONV_DIR
1041         xcopy $(ICONV_DIR)\bin\iconv.dll $(INSTALL_DIR) /d
1042 !ENDIF
1043         xcopy $(GETTEXT_DIR)\bin\intl.dll $(INSTALL_DIR) /d
1044 !IFDEF ZLIB_DIR
1045         xcopy $(ZLIB_DLL) $(INSTALL_DIR) /d
1046 !ENDIF
1047 !IFDEF C_ARES_DIR
1048         xcopy $(C_ARES_DLL) $(INSTALL_DIR) /d
1049 !ENDIF
1050 !IFDEF ADNS_DIR
1051         xcopy $(ADNS_DLL) $(INSTALL_DIR) /d
1052 !ENDIF
1053 !IFDEF PCRE_DIR
1054         xcopy $(PCRE_DIR)\bin\pcre3.dll $(INSTALL_DIR) /d
1055         xcopy $(PCRE_DIR)\man\cat3\pcrepattern.3.txt $(INSTALL_DIR) /d
1056 !ENDIF
1057 !IFDEF KFW_DIR
1058         xcopy $(KFW_DIR)\bin\comerr32.dll $(INSTALL_DIR) /d
1059         xcopy $(KFW_DIR)\bin\krb5_32.dll $(INSTALL_DIR) /d
1060 !ENDIF
1061 !IFDEF GNUTLS_DIR
1062         xcopy $(GNUTLS_DIR)\bin\libgcrypt-11.dll $(INSTALL_DIR) /d
1063         xcopy $(GNUTLS_DIR)\bin\libgnutls-26.dll $(INSTALL_DIR) /d
1064         xcopy $(GNUTLS_DIR)\bin\libgnutls-extra-26.dll $(INSTALL_DIR) /d
1065         xcopy $(GNUTLS_DIR)\bin\libgnutls-openssl-26.dll $(INSTALL_DIR) /d
1066         xcopy $(GNUTLS_DIR)\bin\libgpg-error-0.dll $(INSTALL_DIR) /d
1067         xcopy $(GNUTLS_DIR)\bin\libtasn1-3.dll $(INSTALL_DIR) /d
1068 !ENDIF
1069 !IFDEF LUA_DIR
1070         xcopy "$(LUA_DIR)\lua5.1.dll" $(INSTALL_DIR) /d
1071 !ENDIF
1072 !IFDEF SMI_DIR
1073         if not exist $(INSTALL_DIR)\snmp mkdir $(INSTALL_DIR)\snmp
1074         if not exist $(INSTALL_DIR)\snmp\mibs mkdir $(INSTALL_DIR)\snmp\mibs
1075         xcopy "$(SMI_DIR)\lib\smi.dll" $(INSTALL_DIR) /d
1076         xcopy "$(SMI_DIR)\mibs\*" $(INSTALL_DIR)\snmp\mibs /d
1077 !ENDIF
1078
1079 clean-deps:
1080         rm -rf $(INSTALL_DIR)
1081         cd plugins
1082         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean-deps
1083         cd ..
1084
1085 checkapi_local:
1086         $(PERL) tools/checkAPIs.pl \
1087 #       $(wireshark_SOURCES) \
1088         $(TSHARK_TAP_SRC) \
1089 #       $(EXTRA_wireshark_SOURCES)
1090
1091 checkapi: checkapi_local
1092         cd wiretap
1093         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1094         cd ../codecs
1095         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1096         cd ../gtk
1097 ##      $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1098         cd ../epan
1099 ##      $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1100         cd ../epan/crypt
1101 ##      $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1102         cd ../dfilter
1103         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1104         cd ../ftypes
1105 ##      $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1106         cd ../wslua
1107 ##      $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1108         cd ../dissectors
1109         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1110         cd ..
1111         cd ../plugins
1112         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi
1113         cd ../wsutil
1114         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake checkapi