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