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