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