Do it properly now: "ipx || stx" -> "ipx || spx"
[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=-DHAVE_CONFIG_H $(LOCAL_CFLAGS) $(GLIB_CFLAGS) /I. /Iwiretap \
17         $(ZLIB_CFLAGS) /I$(PCAP_DIR)\include \
18         /I$(NET_SNMP_DIR)\include /I$(NET_SNMP_DIR)\win32 \
19         $(ADNS_CFLAGS) $(PCRE_CFLAGS) $(GNUTLS_CFLAGS) $(LUA_CFLAGS) \
20         -D_U_="" -D_NEED_VAR_IMPORT_
21
22 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
23
24 .c.obj::
25         $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
26
27 PLATFORM_SRC = capture-wpcap.c capture_wpcap_packet.c
28
29 include Makefile.common
30
31 wireshark_OBJECTS = $(wireshark_SOURCES:.c=.obj)
32 tshark_OBJECTS = $(tshark_SOURCES:.c=.obj)
33 dftest_OBJECTS = $(dftest_SOURCES:.c=.obj)
34
35 dumpcap_OBJECTS = $(dumpcap_SOURCES:.c=.obj)
36
37 randpkt_OBJECTS = $(randpkt_SOURCES:.c=.obj)
38
39 command_line_OBJECTS = 
40
41 #setargv.obj
42
43 EXTRA_OBJECTS = \
44 #       snprintf.obj    \
45 #       strerror.obj    \
46         mkstemp.obj     \
47         strptime.obj
48
49 wireshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
50         wsock32.lib user32.lib shell32.lib comctl32.lib \
51         $(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib \
52 !IFDEF HHC_DIR
53         $(HHC_DIR)\lib\htmlhelp.lib \
54 !ENDIF
55 !IFDEF ENABLE_LIBWIRESHARK
56         epan\libwireshark.lib \
57 !ELSE
58         epan\dissectors\dissectors.lib \
59         epan\wireshark.lib \
60         epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
61         $(ADNS_LIBS) \
62         $(PCRE_LIBS) \
63         $(ZLIB_LIBS) \
64         $(GNUTLS_LIBS) 
65 !ENDIF
66 #       $(PCAP_DIR)\lib\wpcap.lib
67
68 tshark_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
69         wsock32.lib user32.lib \
70         $(GLIB_LIBS) \
71         $(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib \
72 !IFDEF ENABLE_LIBWIRESHARK
73         epan\libwireshark.lib \
74 !ELSE
75         epan\dissectors\dissectors.lib \
76         epan\wireshark.lib \
77         epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
78         $(ADNS_LIBS) \
79         $(PCRE_LIBS) \
80         $(ZLIB_LIBS) \
81         $(GNUTLS_LIBS)
82 !ENDIF
83
84 capinfos_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
85         wsock32.lib user32.lib \
86         $(GLIB_LIBS)
87
88 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
89         wsock32.lib user32.lib \
90         $(GLIB_LIBS)
91
92 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
93         wsock32.lib user32.lib \
94         $(GLIB_LIBS)
95
96 dumpcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
97         wsock32.lib user32.lib \
98         $(GLIB_LIBS)
99
100 dftest_LIBS=  wiretap\wiretap-$(WTAP_VERSION).lib \
101         wsock32.lib user32.lib \
102         $(GLIB_LIBS) \
103         $(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib \
104 !IFDEF ENABLE_LIBWIRESHARK
105         epan\libwireshark.lib \
106 !ELSE
107         epan\dissectors\dissectors.lib \
108         epan\wireshark.lib \
109         epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
110         $(ADNS_LIBS) \
111         $(PCRE_LIBS) \
112         $(ZLIB_LIBS) \
113         $(GNUTLS_LIBS)  
114 !ENDIF
115
116 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
117         user32.lib \
118         $(GLIB_LIBS) \
119         $(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib
120
121 EXECUTABLES=wireshark.exe wireshark-gtk2.exe tshark.exe \
122         capinfos.exe editcap.exe mergecap.exe text2pcap.exe randpkt.exe dumpcap.exe
123
124 RESOURCES=image\wireshark.res image\libwireshark.res image\tshark.res \
125         image\capinfos.res image\editcap.res image\mergecap.res \
126         image\text2pcap.res image\wiretap.res image\dumpcap.res
127
128 all: config.h tools image wiretap epan $(EXECUTABLES) $(RESOURCES) doc
129
130 packaging: all
131         cd packaging
132         cd nsis
133         nmake -f makefile.nmake
134         cd ..
135         cd ..
136
137 separate_packaging: all
138         cd packaging
139         cd nsis
140 !IFDEF GTK1_DIR
141         nmake -f makefile.nmake GTK1_ONLY="USE"
142 !ENDIF
143 !IFDEF GTK2_DIR
144         nmake -f makefile.nmake GTK2_ONLY="USE"
145 !ENDIF
146         cd ..
147         cd ..
148
149 $(RESOURCES): image
150
151 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
152
153 !IFNDEF GTK1_DIR
154 wireshark.exe   : 
155 !ELSE
156 wireshark.exe   : config.h svnversion.h $(wireshark_OBJECTS) $(command_line_OBJECTS) epan gtk image\wireshark.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
157         @echo Linking $@
158         $(LINK) @<<
159                 /OUT:wireshark.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(wireshark_LIBS) $(GTK1_LIBS) gtk\libui.lib $(wireshark_OBJECTS) image\wireshark.res
160 <<
161 !ENDIF
162
163 !IFNDEF GTK2_DIR
164 wireshark-gtk2.exe      : 
165 !ELSE
166 wireshark-gtk2.exe      : config.h svnversion.h $(wireshark_OBJECTS) $(command_line_OBJECTS) epan gtk2 image\wireshark.res wiretap\wiretap-$(WTAP_VERSION).lib gtk2.tmp\libui.lib plugins
167         @echo Linking $@
168         $(LINK) @<<
169                 /OUT:wireshark-gtk2.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(wireshark_LIBS) $(GTK2_LIBS) gtk2.tmp\libui.lib $(wireshark_OBJECTS) image\wireshark.res
170 <<
171 !ENDIF
172
173 tshark.exe      : config.h svnversion.h $(tshark_OBJECTS) $(command_line_OBJECTS) epan image\tshark.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
174         @echo Linking $@
175         $(LINK) @<<
176                 /OUT:tshark.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tshark_LIBS) $(tshark_OBJECTS) $(command_line_OBJECTS) image\tshark.res
177 <<
178
179 capinfos.exe    : config.h capinfos.obj getopt.obj $(command_line_OBJECTS) wiretap\wiretap-$(WTAP_VERSION).lib image\capinfos.res
180         @echo Linking $@
181         $(LINK) @<<
182                 /OUT:capinfos.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console capinfos.obj getopt.obj $(command_line_OBJECTS) $(capinfos_LIBS) image\capinfos.res
183 <<
184
185 editcap.exe     : config.h editcap.obj getopt.obj strptime.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
186         @echo Linking $@
187         $(LINK) @<<
188                 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj strptime.obj $(command_line_OBJECTS) $(editcap_LIBS) image\editcap.res
189 <<
190
191 mergecap.exe    : config.h svnversion.h mergecap.obj merge.obj getopt.obj $(command_line_OBJECTS) wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
192         @echo Linking $@
193         $(LINK) @<<
194                 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj merge.obj getopt.obj $(command_line_OBJECTS) $(mergecap_LIBS) image\mergecap.res
195 <<
196
197 text2pcap.exe   : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj $(command_line_OBJECTS) image\text2pcap.res
198         @echo Linking $@
199         $(LINK) @<<
200                 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj $(command_line_OBJECTS) image\text2pcap.res
201 <<
202
203 dftest.exe      : $(dftest_OBJECTS) epan
204         @echo Linking $@
205         $(LINK) @<<
206                 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS)
207 <<
208
209 randpkt.exe     : $(randpkt_OBJECTS) $(command_line_OBJECTS)
210         @echo Linking $@
211         $(LINK) @<<
212                 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS) $(command_line_OBJECTS)
213 <<
214
215 dumpcap.exe     : config.h svnversion.h $(dumpcap_OBJECTS) getopt.obj mkstemp.obj $(command_line_OBJECTS) wiretap\wiretap-$(WTAP_VERSION).lib image\dumpcap.res 
216         @echo Linking $@
217         $(LINK) @<<
218                 /OUT:dumpcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dumpcap_LIBS) $(dumpcap_OBJECTS) getopt.obj mkstemp.obj $(command_line_OBJECTS) image\dumpcap.res
219 <<
220
221
222 config.h        : config.h.win32 config.nmake
223         sed -e s/@VERSION@/$(VERSION)/ \
224             -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
225             -e "s/@HAVE_PCRE@/$(PCRE_CONFIG)/" \
226             -e "s/@HAVE_NETTLE@/$(NETTLE_CONFIG)/" \
227             -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
228             -e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
229             -e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
230             -e "s/@HAVE_PCAP_DATALINK_NAME_TO_VAL@/$(PCAP_DATALINK_NAME_TO_VAL_CONFIG)/" \
231             -e "s/@HAVE_PCAP_DATALINK_VAL_TO_NAME@/$(PCAP_DATALINK_VAL_TO_NAME_CONFIG)/" \
232             -e "s/@HAVE_PCAP_BREAKLOOP@/$(PCAP_BREAKLOOP_CONFIG)/" \
233             -e "s/@HAVE_LIBWIRESHARKDLL@/$(LIBWIRESHARK_CONFIG)/" \
234             -e "s/@WPCAP_CONSTIFIED@/$(WPCAP_CONSTIFIED_CONFIG)/" \
235             -e "s/@HAVE_GNUTLS@/$(GNUTLS_CONFIG)/" \
236             -e "s/@HAVE_LUA@/$(LUA_CONFIG)/" \
237             -e "s/@HAVE_LUA_5_1@/$(LUA_VERSION)/" \
238             < config.h.win32 > $@
239
240 ps.c    : rdps.exe print.ps
241         rdps print.ps ps.c
242
243
244 #
245 # Build the version string
246 #
247 svnversion.h:
248         $(PERL) make-version.pl
249
250 #
251 # Build the short version of the authors file for the about dialog
252 #
253 AUTHORS-SHORT: AUTHORS make-authors-short.pl
254         $(PERL) perlnoutf.pl make-authors-short.pl < AUTHORS > AUTHORS-SHORT
255
256 #
257 # Build the short version of the authors file with formatting codes for
258 # the man page
259 #
260 AUTHORS-SHORT-FORMAT: AUTHORS-SHORT make-authors-format.pl
261     $(PERL) perlnoutf.pl make-authors-format.pl < AUTHORS-SHORT > AUTHORS-SHORT-FORMAT
262
263 #
264 # Build "tshark-tap-register.c", which contains a function 
265 # "register_all_tap_listeners()"
266 # that calls the register routines for all tehtereal tap listeners.
267 #
268 # We do this by grepping through sources.
269 #
270 # Formatting conventions:  The name of the tap_listener_register_* 
271 # routines must start in column zero, or must be preceded only by 
272 # "void " starting in column zero, and must not be inside #if.
273 #
274 # The first argument is the name of the file to write.
275 # The second argument is the directory in which the source files live.
276 # All subsequent arguments are the files to scan.
277 #
278 tshark-tap-register.c: $(TSHARK_TAP_SRC) make-tapreg-dotc
279         @echo Making tshark-tap-register.c
280         @$(SH) make-tapreg-dotc tshark-tap-register.c . $(TSHARK_TAP_SRC)
281
282 text2pcap-scanner.c : text2pcap-scanner.l
283         $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
284
285 gtk2_distclean:
286         rm -f gtk2.tmp/*.*
287         if exist gtk2.tmp rmdir gtk2.tmp
288
289 clean: gtk2_distclean
290         rm -f $(wireshark_OBJECTS) $(tshark_OBJECTS) $(EXTRA_OBJECTS) \
291                 $(EXECUTABLES) $(PDB_FILE) \
292                 capinfos.obj editcap.obj mergecap.obj text2pcap.obj getopt.obj\
293                 text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
294                 rdps.pdb rdps.exe rdps.ilk config.h ps.c AUTHORS-SHORT \
295                 AUTHORS-SHORT-FORMAT \
296                 dftest.obj dftest.exe randpkt.obj randpkt.ext dumpcap.obj \
297                 doxygen.cfg \
298                 $(RESOURCES) libwireshark.dll wiretap-$(WTAP_VERSION).dll
299         cd asn1
300         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
301         cd ..
302         cd wiretap
303         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
304         cd ../gtk
305         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
306         cd ../epan
307         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
308         cd ../plugins
309         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
310         cd ../tools
311         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
312         cd ../image
313         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
314         cd ../doc
315         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
316         cd ../help
317         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
318         cd ../packaging/nsis
319         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
320         cd ../..
321
322 # "distclean" removes all files not part of the distribution.
323 # It does not remove generated files that are part of the distribution.
324 distclean: clean gtk2_distclean
325         rm -f config.h $(BUILT_SOURCES)
326         cd wiretap
327         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
328         cd ../gtk
329         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
330         cd ../epan
331         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
332         cd ../plugins
333         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
334         cd ../tools
335         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
336         cd ../image
337         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
338         cd ../doc
339         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
340         cd ../help
341         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
342         cd ../packaging/nsis
343         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
344         cd ../..
345
346 # Make "maintainer-clean" only if you would like to remove ALL generated
347 # files.
348 # Be sure to have python and perl installed to regenerate them.
349 maintainer-clean: distclean
350         rm -f $(GENERATED_FILES)
351         cd wiretap
352         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
353         cd ../gtk
354         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
355         cd ../epan
356         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
357         cd ../plugins
358         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
359         cd ../tools
360         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
361         cd ../image
362         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
363         cd ../doc
364         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
365         cd ../help
366         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
367         cd ../packaging/nsis
368         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
369         cd ../..
370
371 tools::
372         cd tools
373         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
374         cd ..
375
376 image::
377         cd image
378         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
379         cd ..
380
381 wiretap::
382         cd wiretap
383         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
384         cd ..
385
386 gtk:: help config.h svnversion.h AUTHORS-SHORT doxygen
387         cd gtk
388         $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK1_CFLAGS)" GTK_LIBS="$(GTK1_LIBS)" libui.lib
389         cd ..
390
391 # copy all required files to gtk2.tmp (but only when newer than existing) and compile in that dir
392 gtk2:: help config.h svnversion.h AUTHORS-SHORT
393         if not exist gtk2.tmp mkdir gtk2.tmp
394         cd gtk
395         set copycmd=/y
396         xcopy Makefile.* ..\gtk2.tmp /d
397         xcopy *.c        ..\gtk2.tmp /d
398         xcopy *.h        ..\gtk2.tmp /d
399         cd ..\gtk2.tmp
400         $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK2_CFLAGS)" GTK_LIBS="$(GTK2_LIBS)" libui.lib
401         cd ..
402
403 epan:: $(RESOURCES) $(BUILT_SOURCES) doxygen
404         cd epan
405         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
406         cd ..
407
408 plugins::
409         cd plugins
410         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
411         cd ..
412
413 doc::
414         cd doc
415         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
416         cd ..
417
418 help::
419         cd help
420         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
421         cd ..
422
423 doxygen.cfg: config.nmake doxygen.cfg.in
424         sed -e s/@VERSION@/$(VERSION)/ \
425             < doxygen.cfg.in > $@
426
427 doxygen-run:
428 !IFDEF DOXYGEN
429         $(DOXYGEN) doxygen.cfg
430 !ENDIF
431
432 doxygen: doxygen.cfg doxygen-run
433
434 ################################################################################
435 # Prepare build environment by downloading and installing required libraries
436 ################################################################################
437
438 # The required tools to build Ethereal.
439 #
440 # The 'find' tool is available both in \WINNT\System32 and in cygwin's /usr/bin.
441 # We only need the cygwin version (for some shell scripts).
442 # In the PATH, System32 is before cygwin's dir, so explicitly check for /usr/bin/find.
443 REQUIRED_TOOLS=\
444         $(CC) \
445         $(LINK) \
446         nmake \
447         $(SH)   \
448         $(YACC) \
449         $(LEX)  \
450         env     \
451         grep    \
452         /usr/bin/find   \
453         $(PERL) \
454         $(PYTHON)       \
455         sed     \
456         unzip   \
457         wget
458
459 verify_tools:
460         @$(SH) tools\win32-setup.sh --appverify $(REQUIRED_TOOLS)
461
462 # Download and install all the required libraries into WIRESHARK_LIBS.
463 # If you used this setup target before, consider doing a clean_setup.
464 setup: verify_tools
465 !IF "$(GTK2_INST_VERSION)" == "2.8"
466         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
467                 glib gtk2.8/glib-2.8.4-20051212.zip
468         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
469                 glib gtk2.8/glib-dev-2.8.4-20051212.zip
470 !ELSEIF "$(GTK2_INST_VERSION)" == "2.6"
471         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
472                 glib gtk2.6/glib-2.6.6.zip
473         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
474                 glib gtk2.6/glib-dev-2.6.6.zip
475 !ELSEIF "$(GTK2_INST_VERSION)" == "2.4"
476         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
477                 glib gtk2.4/glib-2.4.7.zip
478         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
479                 glib gtk2.4/glib-dev-2.4.7.zip
480 !ELSE
481         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
482                 glib glib-2.2.3-20040116.zip
483         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
484                 glib glib-dev-2.2.3-20040116.zip
485 !ENDIF
486 !IFDEF GTK1_DIR
487         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
488                 gtk+ gtk+-1.3.0-20030717.zip
489         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
490                 gtk+ gtk+-dev-1.3.0-20030115.zip
491 !ENDIF
492         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
493                 libiconv-1.9.1.bin.woe32 libiconv-1.9.1.bin.woe32.zip
494         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
495                 gettext-runtime-0.13.1 gettext-runtime-0.13.1.zip
496 !IFDEF NET_SNMP_DIR
497         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
498                 . net-snmp-5.2.2.zip
499 !ENDIF
500 !IFDEF PCAP_DIR
501         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
502                 . WpdPack_3_1.zip
503 !ENDIF
504 !IFDEF ADNS_DIR
505         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
506                 . adns-1.0-win32-05.zip
507 !ENDIF
508 !IFDEF PCRE_DIR
509         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
510                 pcre-6.4 pcre-6.4-bin.zip
511         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
512                 pcre-6.4 pcre-6.4-lib.zip
513 !ENDIF
514 !IFDEF ZLIB_DIR
515         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
516                 zlib123-dll zlib123-dll.zip
517 !ENDIF
518 !IFDEF LUA_DIR
519         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
520                 . lua5_1_vc6.zip
521 !ENDIF
522 !IFDEF GTK2_DIR
523 !IF "$(GTK2_INST_VERSION)" == "2.8"
524         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
525                 gtk2 gtk2.8/gtk+-2.8.9.zip
526         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
527                 gtk2 gtk2.8/gtk+-dev-2.8.9.zip
528         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
529                 gtk2 gtk2.8/cairo-1.0.2.zip
530         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
531                 gtk2 gtk2.8/cairo-dev-1.0.2.zip
532         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
533                 gtk2 gtk2.8/atk-1.10.3.zip
534         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
535                 gtk2 gtk2.8/atk-dev-1.10.3.zip
536         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
537                 gtk2 gtk2.8/libpng-1.2.8-bin.zip
538 !ELSEIF "$(GTK2_INST_VERSION)" == "2.6"
539         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
540                 gtk2 gtk2.6/gtk+-2.6.9.zip
541         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
542                 gtk2 gtk2.6/gtk+-dev-2.6.9.zip
543         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
544                 gtk2 gtk2.6/atk-1.9.0.zip
545         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
546                 gtk2 gtk2.6/atk-dev-1.9.0.zip
547 !ELSEIF "$(GTK2_INST_VERSION)" == "2.4"
548         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
549                 gtk2 gtk2.4/gtk+-2.4.14.zip
550         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
551                 gtk2 gtk2.4/gtk+-dev-2.4.14.zip
552         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
553                 gtk2 gtk2.4/atk-1.6.0.zip
554         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
555                 gtk2 gtk2.4/atk-dev-1.6.0.zip
556 !ELSE
557         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
558                 gtk2 gtk2/gtk+-2.2.4-20040124.zip
559         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
560                 gtk2 gtk2/gtk+-dev-2.2.4-20040124.zip
561         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
562                 gtk2 gtk2/atk-1.4.0.zip
563         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
564                 gtk2 gtk2/atk-dev-1.4.0.zip
565 !ENDIF
566 !IF "$(PANGO_INST_VERSION)" == "1.10"
567         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
568                 gtk2 gtk2.8/pango-1.10.1.zip
569         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
570                 gtk2 gtk2.8/pango-dev-1.10.1.zip
571 !ELSEIF "$(PANGO_INST_VERSION)" == "1.8"
572         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
573                 gtk2 gtk2.6/pango-1.8.2.zip
574         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
575                 gtk2 gtk2.6/pango-dev-1.8.2.zip
576 !ELSEIF "$(PANGO_INST_VERSION)" == "1.4"
577         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
578                 gtk2 gtk2.4/pango-1.4.1.zip
579         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
580                 gtk2 gtk2.4/pango-dev-1.4.1.zip
581 !ELSE
582         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
583                 gtk2 gtk2/pango-1.2.5-20040124.zip
584         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
585                 gtk2 gtk2/pango-dev-1.2.5-20040124.zip
586 !ENDIF
587 !ENDIF
588 !IFDEF GTK_WIMP_DIR
589         @$(SH) tools\win32-setup.sh --download "$(WIRESHARK_LIBS)" \
590                 gtk-wimp gtk-wimp/gtk-wimp-0.7.0-bin.zip
591 !ENDIF
592         @echo.
593         @echo Wireshark is ready to build.
594
595 # Cleanup files installed by the setup target. It will not remove the 
596 # downloaded zip files.
597 clean_setup:
598     rm -r -f $(WIRESHARK_LIBS)/glib
599     rm -r -f $(WIRESHARK_LIBS)/gtk+
600     rm -r -f $(WIRESHARK_LIBS)/libiconv-1.9.1.bin.woe32
601     rm -r -f $(WIRESHARK_LIBS)/gettext-runtime-0.13.1
602     rm -r -f $(WIRESHARK_LIBS)/zlib123-dll
603     rm -r -f $(WIRESHARK_LIBS)/gtk2
604     rm -r -f $(WIRESHARK_LIBS)/gtk-wimp
605
606 ################################################################################
607 # Prepare the source tree for running (t)wireshark directly from there.
608 ################################################################################
609
610 # "install-deps" will copy all dlls needed to run (t)wireshark
611 # to the source tree, so you can run (t)wireshark directly from there.
612 # Note that the gtk2 version of wireshark is called wireshark-gtk2.exe
613
614 install-deps: clean-deps install-gtk1-deps install-gtk2-deps
615         cd plugins
616         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake install-plugins
617         cd ..
618
619 install-gtk2-deps: install-required-deps
620 !IFDEF GTK2_DIR
621         set copycmd=/y
622         xcopy $(GTK2_DIR)\bin\libgdk-win32-2.0-0.dll . /d
623         xcopy $(GTK2_DIR)\bin\libgdk_pixbuf-2.0-0.dll . /d
624         xcopy $(GTK2_DIR)\bin\libgtk-win32-2.0-0.dll . /d
625         xcopy $(GTK2_DIR)\bin\libatk-1.0-0.dll . /d
626         xcopy $(GTK2_DIR)\bin\libpango-1.0-0.dll . /d
627         xcopy $(GTK2_DIR)\bin\libpangowin32-1.0-0.dll . /d
628         mkdir etc
629         mkdir etc\gtk-2.0
630         mkdir etc\pango
631         mkdir lib
632         mkdir lib\gtk-2.0
633         mkdir lib\gtk-2.0\$(GTK2_LIB_DIR)
634         mkdir lib\gtk-2.0\$(GTK2_LIB_DIR)\loaders
635         mkdir lib\gtk-2.0\$(GTK2_LIB_DIR)\immodules
636         mkdir lib\pango
637         mkdir lib\pango\$(PANGO_LIB_DIR)
638         mkdir lib\pango\$(PANGO_LIB_DIR)\modules
639         xcopy $(GTK2_DIR)\etc\gtk-2.0\*.* etc\gtk-2.0 /d
640         xcopy $(GTK2_DIR)\etc\pango\pango.* etc\pango /d
641         xcopy $(GTK2_DIR)\lib\gtk-2.0\$(GTK2_LIB_DIR)\loaders\libpixbufloader-*.dll lib\gtk-2.0\$(GTK2_LIB_DIR)\loaders /d
642         xcopy $(GTK2_DIR)\lib\gtk-2.0\$(GTK2_LIB_DIR)\immodules\im-*.dll lib\gtk-2.0\$(GTK2_LIB_DIR)\immodules /d
643         xcopy $(GTK2_DIR)\lib\pango\$(PANGO_LIB_DIR)\modules\pango-*.dll lib\pango\$(PANGO_LIB_DIR)\modules /d
644 !IFDEF NEED_LIBPNG_DLL
645         xcopy $(GTK2_DIR)\bin\libpng13.dll . /d
646 !ENDIF
647 !IFDEF NEED_CAIRO_DLL
648         xcopy $(GTK2_DIR)\bin\libcairo-2.dll . /d
649         xcopy $(GTK2_DIR)\bin\libpangocairo-1.0-0.dll . /d
650 !ENDIF
651 !ENDIF
652
653 install-gtk1-deps: install-required-deps
654 !IFDEF GTK1_DIR
655         set copycmd=/y
656         xcopy $(GTK1_DIR)\lib\libgtk-0.dll . /d
657         xcopy $(GTK1_DIR)\lib\libgdk-0.dll . /d
658 !ENDIF
659
660 install-required-deps:
661         set copycmd=/y
662         xcopy wiretap\wiretap-$(WTAP_VERSION).dll . /d
663 !IFDEF ENABLE_LIBWIRESHARK
664         xcopy epan\libwireshark.dll . /d
665 !ENDIF
666         xcopy $(GLIB_DIR)\bin\libglib-2.0-0.dll . /d
667         xcopy $(GLIB_DIR)\bin\libgmodule-2.0-0.dll . /d
668         xcopy $(GLIB_DIR)\bin\libgobject-2.0-0.dll . /d
669         xcopy $(ICONV_DIR)\bin\iconv.dll . /d
670         xcopy $(GETTEXT_DIR)\bin\intl.dll . /d
671 !IFDEF ZLIB_DIR
672         xcopy $(ZLIB_DIR)\zlib1.dll . /d
673 !ENDIF
674 !IFDEF ADNS_DIR
675         xcopy $(ADNS_DIR)\adns_win32\LIB\adns_dll.dll . /d
676 !ENDIF
677 !IFDEF PCRE_DIR
678         xcopy $(PCRE_DIR)\bin\pcre.dll . /d
679 !ENDIF
680
681 clean-deps:
682         rm -f *.dll
683         rm -rf etc
684         rm -rf lib
685         cd plugins
686         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean-deps
687         cd ..
688