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