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