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