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