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