From Andrew Feren (bug 2462):
[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 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 $(ADNS_DLL) $(ZLIB_DLL) wiretap epan $(EXECUTABLES) $(RESOURCES) doc install-all
147
148 packaging: all
149         cd packaging
150         cd nsis
151         $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
152         cd ..
153         cd ..
154
155 packaging_u3: all
156         cd packaging
157         cd u3
158         cd win32
159         $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
160         cd ..
161         cd ..
162         cd ..
163
164 packaging_papps: all
165         cd packaging
166         cd portableapps
167         cd win32
168         $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
169         cd ..
170         cd ..
171         cd ..
172
173 # use (info-)zip from cygwin to pack things
174 packaging_zip: all
175 !IFDEF MSVCR_DLL
176         xcopy "$(MSVCR_DLL)" $(INSTALL_DIR)
177 !ENDIF
178 !IFDEF VCREDIST_EXE
179         @echo Including vcredist_x86.exe -- your recipient may need to run it!
180         xcopy "$(VCREDIST_EXE)" $(INSTALL_DIR)
181 !ENDIF
182         rm -f wireshark.zip
183         zip -r -9 wireshark.zip $(INSTALL_DIR)/
184
185
186 $(RESOURCES): image
187
188 wiretap\wiretap-$(WTAP_VERSION).lib: image $(ZLIB_DLL) wiretap
189
190 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
191         @echo Linking $@
192         $(LINK) @<<
193                 /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
194 <<
195 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
196         mt.exe -nologo -manifest "wireshark.exe.manifest" -outputresource:wireshark.exe;1
197 !ENDIF
198
199 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
200         @echo Linking $@
201         $(LINK) @<<
202                 /OUT:tshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console $(tshark_LIBS) $(tshark_OBJECTS) getopt.obj inet_ntop.obj image\tshark.res
203 <<
204 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
205         mt.exe -nologo -manifest "tshark.exe.manifest" -outputresource:tshark.exe;1
206 !ENDIF
207
208 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
209         @echo Linking $@
210         $(LINK) @<<
211                 /OUT:rawshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /LARGEADDRESSAWARE /SUBSYSTEM:console $(rawshark_LIBS) $(rawshark_OBJECTS) getopt.obj inet_ntop.obj image\rawshark.res
212 <<
213
214 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
215         @echo Linking $@
216         $(LINK) @<<
217                 /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
218 <<
219 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
220         mt.exe -nologo -manifest "capinfos.exe.manifest" -outputresource:capinfos.exe;1
221 !ENDIF
222
223 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
224         @echo Linking $@
225         $(LINK) @<<
226                 /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
227 <<
228 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
229         mt.exe -nologo -manifest "editcap.exe.manifest" -outputresource:editcap.exe;1
230 !ENDIF
231
232 mergecap.exe    : $(LIBS_CHECK)  config.h svnversion.h mergecap.obj merge.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
233         @echo Linking $@
234         $(LINK) @<<
235                 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj merge.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
236 <<
237 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
238         mt.exe -nologo -manifest "mergecap.exe.manifest" -outputresource:mergecap.exe;1
239 !ENDIF
240
241 text2pcap.exe   : $(LIBS_CHECK) config.h text2pcap.obj text2pcap-scanner.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib strptime.obj image\text2pcap.res
242         @echo Linking $@
243         $(LINK) @<<
244                 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj $(text2pcap_LIBS) strptime.obj image\text2pcap.res
245 <<
246 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
247         mt.exe -nologo -manifest "text2pcap.exe.manifest" -outputresource:text2pcap.exe;1
248 !ENDIF
249
250 dftest.exe      : $(dftest_OBJECTS) epan
251         @echo Linking $@
252         $(LINK) @<<
253                 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS)
254 <<
255 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
256         mt.exe -nologo -manifest "dftest.exe.manifest" -outputresource:dftest.exe;1
257 !ENDIF
258
259 randpkt.exe     : $(randpkt_OBJECTS) getopt.obj
260         @echo Linking $@
261         $(LINK) @<<
262                 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS) getopt.obj
263 <<
264 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
265         mt.exe -nologo -manifest "randpkt.exe.manifest" -outputresource:randpkt.exe;1
266 !ENDIF
267
268 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
269         @echo Linking $@
270         $(LINK) @<<
271                 /OUT:dumpcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dumpcap_LIBS) $(dumpcap_OBJECTS) getopt.obj inet_ntop.obj mkstemp.obj image\dumpcap.res
272 <<
273 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
274         mt.exe -nologo -manifest "dumpcap.exe.manifest" -outputresource:dumpcap.exe;1
275 !ENDIF
276
277
278 config.h        : config.h.win32 config.nmake
279         sed -e s/@VERSION@/$(VERSION)/ \
280             -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
281             -e "s/@HAVE_PCRE@/$(PCRE_CONFIG)/" \
282             -e "s/@HAVE_KFW@/$(KFW_CONFIG)/" \
283             -e "s/@HAVE_NETTLE@/$(NETTLE_CONFIG)/" \
284             -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
285             -e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
286             -e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
287             -e "s/@HAVE_PCAP_DATALINK_NAME_TO_VAL@/$(PCAP_DATALINK_NAME_TO_VAL_CONFIG)/" \
288             -e "s/@HAVE_PCAP_DATALINK_VAL_TO_NAME@/$(PCAP_DATALINK_VAL_TO_NAME_CONFIG)/" \
289             -e "s/@HAVE_PCAP_BREAKLOOP@/$(PCAP_BREAKLOOP_CONFIG)/" \
290             -e "s/@HAVE_REMOTE@/$(PCAP_HAVE_REMOTE_CONFIG)/" \
291             -e "s/@HAVE_PCAP_REMOTE@/$(PCAP_REMOTE_CONFIG)/" \
292             -e "s/@HAVE_PCAP_OPEN@/$(PCAP_OPEN_CONFIG)/" \
293             -e "s/@HAVE_PCAP_FINDALLDEVS_EX@/$(PCAP_FINDALLDEVS_EX_CONFIG)/" \
294             -e "s/@HAVE_PCAP_CREATESRCSTR@/$(PCAP_CREATESRCSTR_CONFIG)/" \
295             -e "s/@HAVE_PCAP_SETSAMPLING@/$(PCAP_SETSAMPLING_CONFIG)/" \
296             -e "s/@HAVE_LIBWIRESHARKDLL@/$(LIBWIRESHARK_CONFIG)/" \
297             -e "s/@WPCAP_CONSTIFIED@/$(WPCAP_CONSTIFIED_CONFIG)/" \
298             -e "s/@HAVE_LIBGNUTLS@/$(GNUTLS_CONFIG)/" \
299             -e "s/@HAVE_LIBGCRYPT@/$(LIBGCRYPT_CONFIG)/" \
300             -e "s/@HAVE_LUA@/$(LUA_CONFIG)/" \
301             -e "s/@HAVE_LUA_5_1@/$(LUA_VERSION)/" \
302             -e "s/@HAVE_AIRPCAP@/$(AIRPCAP_CONFIG)/" \
303             -e "s/@HAVE_AIRPDCAP@/$(AIRPDCAP_CONFIG)/" \
304             -e "s/@HAVE_LIBPORTAUDIO@/$(PORTAUDIO_CONFIG)/" \
305             -e "s/@PORTAUDIO_API_1@/$(PORTAUDIO_API_CONFIG)/" \
306             -e "s/@HAVE_SMI@/$(SMI_CONFIG)/" \
307             < config.h.win32 > $@
308
309 ps.c    : rdps.exe print.ps
310         rdps print.ps ps.c
311
312
313 #
314 # Build the version string
315 #
316 !IF EXIST(".svn/entries")
317 SVNENTRIES = .svn/entries
318 !ELSE
319 SVNENTRIES =
320 !ENDIF
321 svnversion.h: $(SVNENTRIES)
322         rm -f svnversion.h
323         $(PERL) make-version.pl
324
325 #
326 # Build the short version of the authors file for the about dialog
327 #
328 AUTHORS-SHORT: AUTHORS make-authors-short.pl
329         $(PERL) perlnoutf.pl make-authors-short.pl < AUTHORS > AUTHORS-SHORT
330
331 #
332 # Build the short version of the authors file with formatting codes for
333 # the man page
334 #
335 AUTHORS-SHORT-FORMAT: AUTHORS-SHORT make-authors-format.pl
336     $(PERL) perlnoutf.pl make-authors-format.pl < AUTHORS-SHORT > AUTHORS-SHORT-FORMAT
337
338 #
339 # Build "tshark-tap-register.c", which contains a function
340 # "register_all_tap_listeners()"
341 # that calls the register routines for all TShark tap listeners.
342 #
343 # We do this by grepping through sources.
344 #
345 # Formatting conventions:  The name of the tap_listener_register_*
346 # routines must start in column zero, or must be preceded only by
347 # "void " starting in column zero, and must not be inside #if.
348 #
349 # The first argument is the name of the file to write.
350 # The second argument is the directory in which the source files live.
351 # All subsequent arguments are the files to scan.
352 #
353 tshark-tap-register.c: $(TSHARK_TAP_SRC) make-tapreg-dotc
354         @echo Making tshark-tap-register.c
355         @$(SH) make-tapreg-dotc tshark-tap-register.c . $(TSHARK_TAP_SRC)
356
357 text2pcap-scanner.c : text2pcap-scanner.l
358         $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
359
360 clean-local: clean-deps
361         rm -f $(wireshark_OBJECTS) $(tshark_OBJECTS) $(dumpcap_OBJECTS) $(rawshark_OBJECTS) \
362                 $(EXTRA_OBJECTS) $(EXECUTABLES) *.pdb *.exe.manifest \
363                 capinfos.obj editcap.obj mergecap.obj text2pcap.obj \
364                 nio-ie5.obj update.obj \
365                 text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
366                 rdps.pdb rdps.exe rdps.ilk config.h ps.c AUTHORS-SHORT \
367                 AUTHORS-SHORT-FORMAT $(LIBS_CHECK) \
368                 dftest.obj dftest.exe randpkt.obj randpkt.ext \
369                 doxygen.cfg \
370                 $(RESOURCES) libwireshark.dll wiretap-$(WTAP_VERSION).dll
371
372 clean: clean-local
373         cd asn1
374         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
375         cd ..
376         cd wiretap
377         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
378         cd ../codecs
379         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
380         cd ../gtk
381         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
382         cd ../epan
383         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
384         cd ../plugins
385         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
386         cd ../tools
387         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
388         cd ../image
389         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
390         cd ../doc
391         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
392         cd ../help
393         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
394         cd ../packaging/nsis
395         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
396         cd ../u3/win32
397         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
398         cd ../../portableapps/win32
399         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
400         cd ../../..
401
402 # "distclean" removes all files not part of the distribution.
403 # It does not remove generated files that are part of the distribution.
404 distclean-local: clean-local
405 !IFDEF ADNS_DIR
406 !IF "$(MSVC_VARIANT)" != "MSVC6"
407         rm -f $(ADNS_DLL) $(ADNS_LIBS)
408 !ENDIF
409 !ENDIF
410 !IFDEF ZLIB_DIR
411         rm -f $(ZLIB_DLL) $(ZLIB_DIR)\zlib1.dll.manifest \
412                 $(ZLIB_DIR)\include\zlib.h $(ZLIB_DIR)\include\zconf.h \
413                 $(ZLIB_DIR)\lib\zdll.lib
414 !ENDIF
415         rm -f config.h $(BUILT_SOURCES)
416
417 distclean: distclean-local
418         cd wiretap
419         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
420         cd ../codecs
421         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
422         cd ../gtk
423         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
424         cd ../epan
425         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
426         cd ../plugins
427         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
428         cd ../tools
429         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
430         cd ../image
431         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
432         cd ../doc
433         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
434         cd ../help
435         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
436         cd ../packaging/nsis
437         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
438         cd ../u3/win32
439         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
440         cd ../../portableapps/win32
441         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
442         cd ../../..
443
444 # Make "maintainer-clean" only if you would like to remove ALL generated
445 # files.
446 # Be sure to have python and perl installed to regenerate them.
447 maintainer-clean-local: distclean-local
448         rm -f $(GENERATED_FILES)
449
450 maintainer-clean: maintainer-clean-local
451         cd wiretap
452         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
453         cd ../codecs
454         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
455         cd ../gtk
456         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
457         cd ../epan
458         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
459         cd ../plugins
460         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
461         cd ../tools
462         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
463         cd ../image
464         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
465         cd ../doc
466         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
467         cd ../help
468         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
469         cd ../packaging/nsis
470         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
471         cd ../u3/win32
472         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
473         cd ../../portableapps/win32
474         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
475         cd ../../..
476
477 tools::
478         cd tools
479         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
480         cd ..
481
482 image::
483         cd image
484         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
485         cd ..
486
487 !IFDEF ADNS_DIR
488 # Non-MSVC6 variants have to avoid indirectly using msvcrt.dll,
489 # therefore compile the adns dll from source ADNS_DIR package.
490 # To avoid path problems, copy the adns sources to a temp dir,
491 # compile and copy the resulting files back to (source) ADNS_DIR
492 #
493 # Unfortunately:
494 # - we need to "patch" adns_dll.rep and adns_dll.rc (at least for MSVC2005EE)
495 # - on MSVC6 we can't easily rebuild, because iphlpapi.h is needed
496
497 $(ADNS_DLL):
498 !IF "$(MSVC_VARIANT)" == "MSVC6"
499         if not exist $(WIRESHARK_LIBS)\$(MSVC_VARIANT)\adns mkdir $(WIRESHARK_LIBS)\$(MSVC_VARIANT)\adns
500         copy $(ADNS_DIR)\adns_win32\lib\adns_dll.dll $(ADNS_DLL)
501         copy $(ADNS_DIR)\adns_win32\lib\adns_dll.lib $(ADNS_LIBS)
502 !ELSE
503         xcopy $(ADNS_DIR) adns.tmp /D /I /E /Y
504         copy adns_dll.dep adns.tmp\adns_win32\adns_dll
505         copy adns_dll.rc adns.tmp\adns_win32\adns_dll
506         cd adns.tmp\adns_win32\adns_dll
507         set CFG=adns_dll - Win32 Release
508         $(MAKE) /$(MAKEFLAGS) -f adns_dll.mak LOC="-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE"
509 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
510         cd ..\lib
511         mt.exe -nologo -manifest "adns_dll.dll.manifest" -outputresource:adns_dll.dll;2
512 !ENDIF
513         if not exist $(WIRESHARK_LIBS)\$(MSVC_VARIANT)\adns mkdir $(WIRESHARK_LIBS)\$(MSVC_VARIANT)\adns
514         copy adns_dll.dll $(ADNS_DLL)
515         copy adns_dll.lib $(ADNS_LIBS)
516         cd ..\..\..
517         rm -r -f adns.tmp
518 !ENDIF
519 !ENDIF
520
521 !IFDEF ZLIB_DIR
522 # Non-MSVC6 variants have to avoid indirectly using msvcrt.dll,
523 # therefore compile the zlib dll from source ZLIB_DIR package.
524 # To avoid path problems, copy the zlib sources to a temp dir,
525 # compile and copy the resulting files back to (source) ZLIB_DIR
526 $(ZLIB_DLL):
527         xcopy $(ZLIB_DIR) zlib.tmp /D /I /E /Y
528         cd zlib.tmp
529         $(MAKE) /$(MAKEFLAGS) -f win32/Makefile.msc zlib1.dll LOC="-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE"
530         if not exist $(ZLIB_DIR) mkdir $(ZLIB_DIR)
531         if not exist $(ZLIB_DIR)\lib mkdir $(ZLIB_DIR)\lib
532         if not exist $(ZLIB_DIR)\include mkdir $(ZLIB_DIR)\include
533 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
534         mt.exe -nologo -manifest "zlib1.dll.manifest" -outputresource:zlib1.dll;2
535 !ENDIF
536         copy zlib1.dll $(ZLIB_DIR)
537         copy zdll.lib $(ZLIB_DIR)\lib
538         copy zconf.h $(ZLIB_DIR)\include
539         copy zlib.h $(ZLIB_DIR)\include
540         cd ..
541     rm -r -f zlib.tmp
542 !ENDIF
543
544
545 wiretap::
546         cd wiretap
547         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
548         cd ..
549
550 codecs::
551         cd codecs
552         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
553         cd ..
554
555 gtk:: help config.h svnversion.h AUTHORS-SHORT doxygen
556         cd gtk
557         $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake libui.lib
558         cd ..
559
560 epan:: $(RESOURCES) $(ZLIB_DLL) wiretap\wiretap-$(WTAP_VERSION).lib $(BUILT_SOURCES) doxygen
561         cd epan
562         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
563         cd ..
564
565 plugins::
566         cd plugins
567         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
568         cd ..
569
570 doc::
571         cd doc
572         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
573         cd ..
574
575 help::
576         cd help
577         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
578         cd ..
579
580 doxygen.cfg: config.nmake doxygen.cfg.in
581         sed -e s/@VERSION@/$(VERSION)/ \
582             < doxygen.cfg.in > $@
583
584 doxygen-run:
585 !IFDEF DOXYGEN
586         $(DOXYGEN) doxygen.cfg
587 !ENDIF
588
589 doxygen: doxygen.cfg doxygen-run
590
591 ################################################################################
592 # Prepare build environment by downloading and installing required libraries
593 ################################################################################
594
595 # The required tools to build Wireshark.
596 #
597 # The 'find' tool is available both in \WINNT\System32 and in cygwin's /usr/bin.
598 # We only need the cygwin version (for some shell scripts).
599 # In the PATH, System32 is before cygwin's dir, so explicitly check for /usr/bin/find.
600 REQUIRED_TOOLS=\
601         $(CC) \
602         $(LINK) \
603         nmake \
604         $(SH_PROG)      \
605         $(YACC) \
606         $(LEX)  \
607         env     \
608         grep    \
609         /usr/bin/find   \
610         $(PERL) \
611         $(PYTHON)       \
612         sed     \
613         unzip   \
614         wget
615
616 verify_tools:
617         @$(SH) tools\win32-setup.sh --appverify $(REQUIRED_TOOLS)
618
619 # Targets and etc used to verify or download libraries
620
621 !IFNDEF WIN32_SETUP_OPT
622 WIN32_SETUP_OPT=--download
623 !ENDIF
624
625 # Verify that the required library 'package' (zip) files have been downloaded.
626 # (It seems reasonable to assume that if the files have been downloaded
627 #  then they have been installed).
628 check_libs:
629         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake WIN32_SETUP_OPT=--libverify process_libs
630
631 # Verify library packages only if Makefile.nmake has been updated
632 #  (or dummy file doesn't exist because of 'make clean' or whatever)
633 # (To disable library verification when Makefile.nmake changes,
634 #  comment out the commands for the following target).
635 # touch is only called if libverify succeeds
636 $(LIBS_CHECK): Makefile.nmake
637         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake WIN32_SETUP_OPT=--libverify process_libs
638         @touch --reference=Makefile.nmake $@
639
640 # Download (if needed) and install all the required libraries into WIRESHARK_LIBS.
641 # A clean_setup is done first to ensure that the target dirs don't
642 # contain old files remaining from a previous setup run.
643 setup: verify_tools clean_setup process_libs
644
645
646 # The process_libs target when invoked causes either a --libverify or a --download for all the required libraries.
647 # (The choice is determined by the value of the macro WIN32_SETUP_OPT).
648 process_libs:
649     if not exist $(WIRESHARK_LIBS) md $(WIRESHARK_LIBS)
650 !IF "$(GTK_INST_VERSION)" == "2.12"
651         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
652                 glib gtk2.12/glib-2.16.1.zip
653         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
654                 glib gtk2.12/glib-dev-2.16.1.zip
655 !ELSEIF "$(GTK_INST_VERSION)" == "2.10"
656         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
657                 glib gtk2.10/glib-2.12.13.zip
658         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
659                 glib gtk2.10/glib-dev-2.12.13.zip
660 !ELSE
661 !ERROR ? Unknown or invalid GTK_INST_VERSION
662 !ENDIF
663 !IFDEF ICONV_DIR
664         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
665                 libiconv-1.9.1.bin.woe32 libiconv-1.9.1.bin.woe32.zip
666 !ENDIF
667         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
668                 gettext-runtime-0.17-1 gettext-runtime-0.17-1.zip
669 !IFDEF KFW_DIR
670         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
671                 kfw-2.5 kfw-2.5.zip
672 !ENDIF
673 !IFDEF PCAP_DIR
674         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
675                 . WpdPack_3_1.zip
676 !ENDIF
677 !IFDEF AIRPCAP_DIR
678         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
679                 AirPcap_Devpack_1_0_0_594 AirPcap_Devpack_1_0_0_594.zip
680 !ENDIF
681 !IFDEF ADNS_DIR
682         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
683                 . adns-1.0-win32-05.zip
684 !ENDIF
685 !IFDEF PCRE_DIR
686         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
687                 pcre-7.0 pcre-7.0-bin.zip
688         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
689                 pcre-7.0 pcre-7.0-lib.zip
690 !ENDIF
691 !IFDEF ZLIB_DIR
692         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
693                 zlib123 zlib123.zip
694 !ENDIF
695 !IFDEF LUA_DIR
696         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
697                 . lua5_1_dll.zip
698 !ENDIF
699
700 !IFDEF GNUTLS_DIR
701         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
702                 . gnutls-1.6.1-1.zip
703 !ENDIF
704 !IFDEF PORTAUDIO_DIR
705         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
706                 . portaudio_v19.zip
707 !ENDIF
708 !IFDEF SMI_DIR
709         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
710                 . libsmi-0.4.5.zip
711 !ENDIF
712
713 !IFDEF GTK_DIR
714 !IF "$(GTK_INST_VERSION)" == "2.12"
715         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
716                 gtk2 gtk2.12/gtk+-2.12.9.zip
717         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
718                 gtk2 gtk2.12/gtk+-dev-2.12.9.zip
719         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
720                 gtk2 gtk2.12/cairo-1.4.14.zip
721         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
722                 gtk2 gtk2.12/cairo-dev-1.4.14.zip
723         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
724                 gtk2 gtk2.12/atk-1.22.0.zip
725         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
726                 gtk2 gtk2.12/atk-dev-1.22.0.zip
727         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
728                 gtk2 gtk2.12/libpng-1.2.8-bin.zip
729         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
730                 gtk2 gtk2.12/tiff-3.8.2-1-bin.zip
731         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
732                 gtk2 gtk2.12/jpeg-6b-4-bin.zip
733 !ELSEIF "$(GTK_INST_VERSION)" == "2.10"
734         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
735                 gtk2 gtk2.10/gtk+-2.10.14.zip
736         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
737                 gtk2 gtk2.10/gtk+-dev-2.10.14.zip
738         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
739                 gtk2 gtk2.10/cairo-1.4.8.zip
740         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
741                 gtk2 gtk2.10/cairo-dev-1.4.8.zip
742         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
743                 gtk2 gtk2.10/atk-1.18.0.zip
744         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
745                 gtk2 gtk2.10/atk-dev-1.18.0.zip
746         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
747                 gtk2 gtk2.10/libpng-1.2.8-bin.zip
748 !ELSE
749 !ERROR ? Unknown or invalid GTK_INST_VERSION
750 !ENDIF
751 !IF "$(PANGO_INST_VERSION)" == "1.20"
752         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
753                 gtk2 gtk2.12/pango-1.20.0.zip
754         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
755                 gtk2 gtk2.12/pango-dev-1.20.0.zip
756 !ELSEIF "$(PANGO_INST_VERSION)" == "1.16"
757         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
758                 gtk2 gtk2.10/pango-1.16.4.zip
759         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
760                 gtk2 gtk2.10/pango-dev-1.16.4.zip
761 !ELSE
762 !ERROR ? Unknown or invalid PANGO_INST_VERSION
763 !ENDIF
764 !ENDIF
765 !IFDEF GTK_WIMP_DIR
766         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
767                 gtk-wimp gtk-wimp/gtk-wimp-0.7.0-bin.zip
768 !ENDIF
769 !IFDEF HHC_DIR
770         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
771                 user-guide user-guide-24665.zip
772 !ENDIF
773 !IFDEF UPX
774         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
775                 . upx301w.zip
776 !ENDIF
777 !IFDEF NASM
778         @$(SH) tools\win32-setup.sh "$(WIN32_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
779                 . nasm-2.00-win32.zip
780 !ENDIF
781         @echo.
782         @echo Wireshark is ready to build.
783
784 # Cleanup files installed by the setup target. It will not remove the
785 # downloaded zip files.
786 # WHEN UPDATING LIBRARY VERSIONS, KEEP ALSO ONE FORMER VERSION SO
787 # UPDATING REMOVES THE FORMER USER DIRS
788 clean_setup:
789     rm -r -f $(WIRESHARK_LIBS)/adns-1.0-win32-05
790     rm -r -f $(WIRESHARK_LIBS)/gettext-0.14.5
791     rm -r -f $(WIRESHARK_LIBS)/gettext-runtime-0.17
792     rm -r -f $(WIRESHARK_LIBS)/gettext-runtime-0.17-1
793     rm -r -f $(WIRESHARK_LIBS)/glib
794     rm -r -f $(WIRESHARK_LIBS)/gnutls-1.6.1-1
795     rm -r -f $(WIRESHARK_LIBS)/gtk2
796     rm -r -f $(WIRESHARK_LIBS)/gtk+
797     rm -r -f $(WIRESHARK_LIBS)/gtk-wimp
798     rm -r -f $(WIRESHARK_LIBS)/kfw-2.5
799     rm -r -f $(WIRESHARK_LIBS)/libiconv-1.9.1.bin.woe32
800     rm -r -f $(WIRESHARK_LIBS)/lua5.1
801     rm -r -f $(WIRESHARK_LIBS)/libsmi-0.4.5
802     rm -r -f $(WIRESHARK_LIBS)/nasm-2.00
803     rm -r -f $(WIRESHARK_LIBS)/pcre-6.4
804     rm -r -f $(WIRESHARK_LIBS)/pcre-7.0
805     rm -r -f $(WIRESHARK_LIBS)/portaudio_v18_1
806     rm -r -f $(WIRESHARK_LIBS)/portaudio_v19
807     rm -r -f $(WIRESHARK_LIBS)/user-guide
808     rm -r -f $(WIRESHARK_LIBS)/WpdPack
809     rm -r -f $(WIRESHARK_LIBS)/AirPcap_Devpack_1_0_0_594
810     rm -r -f $(WIRESHARK_LIBS)/zlib123
811     rm -r -f $(WIRESHARK_LIBS)/zlib123-dll
812     rm -r -f $(WIRESHARK_LIBS)/upx301w
813
814 ################################################################################
815 # Prepare the debug trees for running Wireshark/Tshark from there.
816 ################################################################################
817
818
819 # prepare debugging of Wireshark in INSTALL_DIR
820 debug-wireshark: wireshark.exe install-generated-files
821
822 # prepare debugging of tshark in INSTALL_DIR
823 debug-tshark: tshark.exe install-generated-files
824
825 # prepare debugging of rawshark in INSTALL_DIR
826 debug-rawshark: rawshark.exe install-generated-files
827
828 # prepare debugging of dumpcap in INSTALL_DIR
829 debug-dumpcap: dumpcap.exe install-generated-files
830
831
832 # install generated files (exe, "our" libs, ...)
833 install-generated-files:
834         set copycmd=/y
835 !IF "$(MSVC_VARIANT)" == "MSVC2008EE"
836         xcopy "$(MSVCR_DLL)" $(INSTALL_DIR)
837 !ENDIF
838         if not exist $(INSTALL_DIR) mkdir $(INSTALL_DIR)
839 !IFDEF ENABLE_LIBWIRESHARK
840         xcopy epan\libwireshark.dll $(INSTALL_DIR) /d
841 !ENDIF
842         xcopy ".\wiretap\wiretap-$(WTAP_VERSION).dll" $(INSTALL_DIR) /d
843         if exist ".\wiretap\wiretap-$(WTAP_VERSION).pdb" xcopy ".\wiretap\wiretap-$(WTAP_VERSION).pdb" $(INSTALL_DIR) /d
844         xcopy ".\epan\libwireshark.dll" $(INSTALL_DIR) /d
845         if exist ".\epan\libwireshark.pdb" xcopy ".\epan\libwireshark.pdb" $(INSTALL_DIR) /d
846         if exist wireshark.exe copy wireshark.exe $(INSTALL_DIR)\wireshark.exe
847         if exist wireshark.pdb copy wireshark.pdb $(INSTALL_DIR)\wireshark.pdb
848         if exist ".\docbook\user-guide.chm" xcopy ".\docbook\user-guide.chm" $(INSTALL_DIR) /d
849         if exist tshark.exe xcopy tshark.exe $(INSTALL_DIR) /d
850         if exist tshark.pdb xcopy tshark.pdb $(INSTALL_DIR) /d
851         if exist rawshark.exe xcopy rawshark.exe $(INSTALL_DIR) /d
852         if exist rawshark.exe.manifest xcopy rawshark.exe.manifest $(INSTALL_DIR) /d
853         if exist rawshark.pdb xcopy rawshark.pdb $(INSTALL_DIR) /d
854         if exist dumpcap.exe xcopy dumpcap.exe $(INSTALL_DIR) /d
855         if exist dumpcap.pdb xcopy dumpcap.pdb $(INSTALL_DIR) /d
856         if exist mergecap.exe xcopy mergecap.exe $(INSTALL_DIR) /d
857         if exist mergecap.pdb xcopy mergecap.pdb $(INSTALL_DIR) /d
858         if exist text2pcap.exe xcopy text2pcap.exe $(INSTALL_DIR) /d
859         if exist text2pcap.pdb xcopy text2pcap.pdb $(INSTALL_DIR) /d
860         if exist capinfos.exe xcopy capinfos.exe $(INSTALL_DIR) /d
861         if exist capinfos.pdb xcopy capinfos.pdb $(INSTALL_DIR) /d
862         if exist editcap.exe xcopy editcap.exe $(INSTALL_DIR) /d
863         if exist editcap.pdb xcopy editcap.pdb $(INSTALL_DIR) /d
864         xcopy ".\AUTHORS-SHORT" $(INSTALL_DIR) /d
865         xcopy ".\manuf" $(INSTALL_DIR) /d
866         xcopy ".\services" $(INSTALL_DIR) /d
867         xcopy ".\FAQ" $(INSTALL_DIR) /d
868         xcopy ".\README" $(INSTALL_DIR) /d
869         xcopy ".\README.win32" $(INSTALL_DIR) /d
870         xcopy ".\AUTHORS-SHORT" $(INSTALL_DIR) /d
871         xcopy ".\COPYING" $(INSTALL_DIR) /d
872         copy ".\NEWS" $(INSTALL_DIR)\NEWS.txt
873         xcopy ".\cfilters" $(INSTALL_DIR) /d
874         xcopy ".\colorfilters" $(INSTALL_DIR) /d
875         xcopy ".\dfilters" $(INSTALL_DIR) /d
876         xcopy ".\smi_modules" $(INSTALL_DIR) /d
877 !IFDEF LUA_DIR
878         xcopy ".\epan\wslua\init.lua" $(INSTALL_DIR) /d
879         xcopy ".\epan\wslua\console.lua" $(INSTALL_DIR) /d
880 !ENDIF
881         xcopy doc\*.html $(INSTALL_DIR) /d
882         if not exist $(INSTALL_DIR)\help mkdir $(INSTALL_DIR)\help
883         xcopy ".\help\*.*" $(INSTALL_DIR)\help /d
884         if not exist $(INSTALL_DIR)\dtds mkdir $(INSTALL_DIR)\dtds
885         xcopy ".\dtds\*.*" $(INSTALL_DIR)\dtds /d
886         if not exist $(INSTALL_DIR)\asn1 mkdir $(INSTALL_DIR)\asn1
887         echo create empty asn1 default.tt file to prevent problems 2> $(INSTALL_DIR)\asn1\default.tt
888         if not exist $(INSTALL_DIR)\radius mkdir $(INSTALL_DIR)\radius
889         xcopy ".\radius\*.*" $(INSTALL_DIR)\radius /d
890         if not exist $(INSTALL_DIR)\diameter mkdir $(INSTALL_DIR)\diameter
891         xcopy ".\diameter\*.dtd" $(INSTALL_DIR)\diameter /d
892         xcopy ".\diameter\*.xml" $(INSTALL_DIR)\diameter /d
893         if not exist $(INSTALL_DIR)\tpncp mkdir $(INSTALL_DIR)\tpncp
894         xcopy ".\tpncp\*.dat" $(INSTALL_DIR)\tpncp /d
895         if not exist $(INSTALL_DIR)\wimaxasncp mkdir $(INSTALL_DIR)\wimaxasncp
896         xcopy ".\wimaxasncp\*.*" $(INSTALL_DIR)\wimaxasncp /d
897         if not exist $(INSTALL_DIR)\plugins mkdir $(INSTALL_DIR)\plugins
898         if not exist $(INSTALL_DIR)\plugins\$(VERSION) mkdir $(INSTALL_DIR)\plugins\$(VERSION)
899         xcopy ".\plugins\agentx\agentx.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
900         xcopy ".\plugins\artnet\artnet.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
901         xcopy ".\plugins\asn1\asn1.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
902         xcopy ".\plugins\ciscosm\ciscosm.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
903         xcopy ".\plugins\docsis\docsis.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
904         xcopy ".\plugins\enttec\enttec.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
905         xcopy ".\plugins\ethercat\ethercat.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
906         xcopy ".\plugins\giop\coseventcomm.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
907         xcopy ".\plugins\giop\cosnaming.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
908         xcopy ".\plugins\giop\parlay.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
909         xcopy ".\plugins\giop\tango.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
910         xcopy ".\plugins\gryphon\gryphon.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
911         xcopy ".\plugins\infiniband\infiniband.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
912         xcopy ".\plugins\irda\irda.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
913         xcopy ".\plugins\lwres\lwres.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
914         xcopy ".\plugins\m2m\m2m.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
915         xcopy ".\plugins\mate\mate.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
916         xcopy ".\plugins\opcua\opcua.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
917         xcopy ".\plugins\opsi\opsi.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
918         xcopy ".\plugins\pcli\pcli.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
919         xcopy ".\plugins\profinet\profinet.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
920         xcopy ".\plugins\rlm\rlm.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
921         xcopy ".\plugins\rtnet\rtnet.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
922         xcopy ".\plugins\rudp\rudp.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
923         xcopy ".\plugins\sbus\sbus.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
924         xcopy ".\plugins\stats_tree\stats_tree.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
925         xcopy ".\plugins\unistim\unistim.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
926         xcopy ".\plugins\v5ua\v5ua.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
927         xcopy ".\plugins\wimax\wimax.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
928         xcopy ".\plugins\wimaxasncp\wimaxasncp.dll" $(INSTALL_DIR)\plugins\$(VERSION) /d
929         if exist custom-install.bat custom-install $(INSTALL_DIR) $(VERSION)
930
931 # "install-all" will copy all files needed to run Wireshark/Tshark
932 # to the INSTALL_DIR, so you can run/debug Wireshark/Tshark from there.
933 install-all: install-generated-files
934         set copycmd=/y
935         if not exist $(INSTALL_DIR) mkdir $(INSTALL_DIR)
936         xcopy $(GTK_DIR)\bin\libgdk-win32-2.0-0.dll $(INSTALL_DIR) /d
937         xcopy $(GTK_DIR)\bin\libgdk_pixbuf-2.0-0.dll $(INSTALL_DIR) /d
938         xcopy $(GTK_DIR)\bin\libgtk-win32-2.0-0.dll $(INSTALL_DIR) /d
939         xcopy $(GTK_DIR)\bin\libatk-1.0-0.dll $(INSTALL_DIR) /d
940         xcopy $(GTK_DIR)\bin\libpango-1.0-0.dll $(INSTALL_DIR) /d
941         xcopy $(GTK_DIR)\bin\libpangowin32-1.0-0.dll $(INSTALL_DIR) /d
942         if not exist $(INSTALL_DIR)\etc mkdir $(INSTALL_DIR)\etc
943         if not exist $(INSTALL_DIR)\etc\gtk-2.0 mkdir $(INSTALL_DIR)\etc\gtk-2.0
944         if not exist $(INSTALL_DIR)\etc\pango mkdir $(INSTALL_DIR)\etc\pango
945         if not exist $(INSTALL_DIR)\lib mkdir $(INSTALL_DIR)\lib
946         if not exist $(INSTALL_DIR)\lib\gtk-2.0 mkdir $(INSTALL_DIR)\lib\gtk-2.0
947         if not exist $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR) mkdir $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)
948         if not exist $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders mkdir $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders
949         if not exist $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\immodules mkdir $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\immodules
950         if not exist $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\immodules mkdir $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\engines
951 #       if not exist $(INSTALL_DIR)\lib\pango mkdir $(INSTALL_DIR)\lib\pango
952 #       if not exist $(INSTALL_DIR)\lib\pango\$(PANGO_LIB_DIR) mkdir $(INSTALL_DIR)\lib\pango\$(PANGO_LIB_DIR)
953 #       if not exist $(INSTALL_DIR)\lib\pango\$(PANGO_LIB_DIR)\modules mkdir $(INSTALL_DIR)\lib\pango\$(PANGO_LIB_DIR)\modules
954         xcopy $(GTK_DIR)\etc\gtk-2.0\*.* $(INSTALL_DIR)\etc\gtk-2.0 /d
955         xcopy $(GTK_DIR)\etc\pango\pango.* $(INSTALL_DIR)\etc\pango /d
956         xcopy $(GTK_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders\libpixbufloader-*.dll $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\loaders /d
957         xcopy $(GTK_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\immodules\im-*.dll $(INSTALL_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\immodules /d
958 #       xcopy $(GTK_DIR)\lib\pango\$(PANGO_LIB_DIR)\modules\pango-*.dll $(INSTALL_DIR)\lib\pango\$(PANGO_LIB_DIR)\modules /d
959 !IFDEF NEED_LIBPNG_DLL
960         xcopy $(GTK_DIR)\bin\libpng13.dll $(INSTALL_DIR) /d
961 !ENDIF
962 !IFDEF NEED_LIBTIFF_DLL
963         xcopy $(GTK_DIR)\bin\libtiff3.dll $(INSTALL_DIR) /d
964 !ENDIF
965 !IFDEF NEED_LIBJPEG_DLL
966         xcopy $(GTK_DIR)\bin\jpeg62.dll $(INSTALL_DIR) /d
967 !ENDIF
968 !IFDEF NEED_CAIRO_DLL
969         xcopy $(GTK_DIR)\bin\libcairo-2.dll $(INSTALL_DIR)  /d
970         xcopy $(GTK_DIR)\bin\libpangocairo-1.0-0.dll $(INSTALL_DIR) /d
971 !ENDIF
972 !IFDEF GTK_WIMP_DIR
973         if not exist $(INSTALL_DIR)\$(GTK_WIMP_DLLDST_DIR) mkdir $(INSTALL_DIR)\$(GTK_WIMP_DLLDST_DIR)
974         xcopy "$(GTK_WIMP_DLLSRC_DIR)\libwimp.dll" $(INSTALL_DIR)\$(GTK_WIMP_DLLDST_DIR) /d
975         if not exist $(INSTALL_DIR)\$(GTK_WIMP_RCDST_DIR) mkdir $(INSTALL_DIR)\$(GTK_WIMP_RCDST_DIR)
976         xcopy "$(GTK_WIMP_RCSRC_DIR)\gtkrc" $(INSTALL_DIR)\$(GTK_WIMP_RCDST_DIR) /d
977 !ENDIF
978         xcopy $(GLIB_DIR)\bin\libglib-2.0-0.dll $(INSTALL_DIR) /d
979         xcopy $(GLIB_DIR)\bin\libgobject-2.0-0.dll $(INSTALL_DIR) /d
980         xcopy $(GLIB_DIR)\bin\libgmodule-2.0-0.dll $(INSTALL_DIR) /d
981 !IFDEF ICONV_DIR
982         xcopy $(ICONV_DIR)\bin\iconv.dll $(INSTALL_DIR) /d
983 !ENDIF
984         xcopy $(GETTEXT_DIR)\bin\intl.dll $(INSTALL_DIR) /d
985 !IFDEF ZLIB_DIR
986         xcopy $(ZLIB_DLL) $(INSTALL_DIR) /d
987 !ENDIF
988 !IFDEF ADNS_DIR
989         xcopy $(ADNS_DLL) $(INSTALL_DIR) /d
990 !ENDIF
991 !IFDEF PCRE_DIR
992         xcopy $(PCRE_DIR)\bin\pcre3.dll $(INSTALL_DIR) /d
993         xcopy $(PCRE_DIR)\man\cat3\pcrepattern.3.txt $(INSTALL_DIR) /d
994 !ENDIF
995 !IFDEF KFW_DIR
996         xcopy $(KFW_DIR)\bin\comerr32.dll $(INSTALL_DIR) /d
997         xcopy $(KFW_DIR)\bin\krb5_32.dll $(INSTALL_DIR) /d
998 !ENDIF
999 !IFDEF GNUTLS_DIR
1000         xcopy $(GNUTLS_DIR)\bin\libgcrypt-11.dll $(INSTALL_DIR) /d
1001         xcopy $(GNUTLS_DIR)\bin\libgnutls-13.dll $(INSTALL_DIR) /d
1002         xcopy $(GNUTLS_DIR)\bin\libgnutls-extra-13.dll $(INSTALL_DIR) /d
1003         xcopy $(GNUTLS_DIR)\bin\libgnutls-openssl-13.dll $(INSTALL_DIR) /d
1004         xcopy $(GNUTLS_DIR)\bin\libgpg-error-0.dll $(INSTALL_DIR) /d
1005         xcopy $(GNUTLS_DIR)\bin\libtasn1-3.dll $(INSTALL_DIR) /d
1006 !ENDIF
1007 !IFDEF LUA_DIR
1008         xcopy "$(LUA_DIR)\lib\dll\lua5.1.dll" $(INSTALL_DIR) /d
1009 !ENDIF
1010 !IFDEF SMI_DIR
1011         if not exist $(INSTALL_DIR)\snmp mkdir $(INSTALL_DIR)\snmp
1012         if not exist $(INSTALL_DIR)\snmp\mibs mkdir $(INSTALL_DIR)\snmp\mibs
1013         xcopy "$(SMI_DIR)\lib\smi.dll" $(INSTALL_DIR) /d
1014         xcopy "$(SMI_DIR)\mibs\*" $(INSTALL_DIR)\snmp\mibs /d
1015 !ENDIF
1016
1017 clean-deps:
1018         rm -rf $(INSTALL_DIR)
1019         cd plugins
1020         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean-deps
1021         cd ..
1022