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