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