The first item in the network load EIP appears to be the network
[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             -e "s/@HAVE_LUA_5_1@/$(LUA_VERSION)/" \
234             < config.h.win32 > $@
235
236 ps.c    : rdps.exe print.ps
237         rdps print.ps ps.c
238
239
240 #
241 # Build the version string
242 #
243 svnversion.h:
244         $(PERL) make-version.pl
245
246 #
247 # Build the short version of the authors file for the about dialog
248 #
249 AUTHORS-SHORT: AUTHORS make-authors-short.pl
250         $(PERL) perlnoutf.pl make-authors-short.pl < AUTHORS > AUTHORS-SHORT
251
252 #
253 # Build the short version of the authors file with formatting codes for
254 # the man page
255 #
256 AUTHORS-SHORT-FORMAT: AUTHORS-SHORT make-authors-format.pl
257     $(PERL) perlnoutf.pl make-authors-format.pl < AUTHORS-SHORT > AUTHORS-SHORT-FORMAT
258
259 #
260 # Build "tethereal-tap-register.c", which contains a function 
261 # "register_all_tap_listeners()"
262 # that calls the register routines for all tehtereal tap listeners.
263 #
264 # We do this by grepping through sources.
265 #
266 # Formatting conventions:  The name of the tap_listener_register_* 
267 # routines must start in column zero, or must be preceded only by 
268 # "void " starting in column zero, and must not be inside #if.
269 #
270 # The first argument is the name of the file to write.
271 # The second argument is the directory in which the source files live.
272 # All subsequent arguments are the files to scan.
273 #
274 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
275         @echo Making tethereal-tap-register.c
276         @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
277
278 text2pcap-scanner.c : text2pcap-scanner.l
279         $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
280
281 gtk2_distclean:
282         rm -f gtk2.tmp/*.*
283         if exist gtk2.tmp rmdir gtk2.tmp
284
285 clean: gtk2_distclean
286         rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
287                 $(EXECUTABLES) $(PDB_FILE) \
288                 capinfos.obj editcap.obj mergecap.obj text2pcap.obj getopt.obj\
289                 text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
290                 rdps.pdb rdps.exe rdps.ilk config.h ps.c AUTHORS-SHORT \
291                 AUTHORS-SHORT-FORMAT \
292                 dftest.obj dftest.exe randpkt.obj randpkt.ext dumpcap.obj \
293                 doxygen.cfg \
294                 $(RESOURCES) libethereal.dll wiretap-$(WTAP_VERSION).dll
295         cd asn1
296         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
297         cd ..
298         cd wiretap
299         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
300         cd ../gtk
301         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
302         cd ../epan
303         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
304         cd ../plugins
305         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
306         cd ../tools
307         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
308         cd ../image
309         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
310         cd ../doc
311         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
312         cd ../help
313         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
314         cd ../packaging/nsis
315         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
316         cd ../..
317
318 # "distclean" removes all files not part of the distribution.
319 # It does not remove generated files that are part of the distribution.
320 distclean: clean gtk2_distclean
321         rm -f config.h $(BUILT_SOURCES)
322         cd wiretap
323         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
324         cd ../gtk
325         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
326         cd ../epan
327         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
328         cd ../plugins
329         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
330         cd ../tools
331         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
332         cd ../image
333         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
334         cd ../doc
335         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
336         cd ../help
337         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
338         cd ../packaging/nsis
339         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
340         cd ../..
341
342 # Make "maintainer-clean" only if you would like to remove ALL generated
343 # files.
344 # Be sure to have python and perl installed to regenerate them.
345 maintainer-clean: distclean
346         rm -f $(GENERATED_FILES)
347         cd wiretap
348         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
349         cd ../gtk
350         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
351         cd ../epan
352         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
353         cd ../plugins
354         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
355         cd ../tools
356         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
357         cd ../image
358         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
359         cd ../doc
360         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
361         cd ../help
362         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
363         cd ../packaging/nsis
364         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
365         cd ../..
366
367 tools::
368         cd tools
369         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
370         cd ..
371
372 image::
373         cd image
374         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
375         cd ..
376
377 wiretap::
378         cd wiretap
379         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
380         cd ..
381
382 gtk:: help config.h svnversion.h AUTHORS-SHORT doxygen
383         cd gtk
384         $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK1_CFLAGS)" GTK_LIBS="$(GTK1_LIBS)" libui.lib
385         cd ..
386
387 # copy all required files to gtk2.tmp (but only when newer than existing) and compile in that dir
388 gtk2:: help config.h svnversion.h AUTHORS-SHORT
389         if not exist gtk2.tmp mkdir gtk2.tmp
390         cd gtk
391         set copycmd=/y
392         xcopy Makefile.* ..\gtk2.tmp /d
393         xcopy *.c        ..\gtk2.tmp /d
394         xcopy *.h        ..\gtk2.tmp /d
395         cd ..\gtk2.tmp
396         $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK2_CFLAGS)" GTK_LIBS="$(GTK2_LIBS)" libui.lib
397         cd ..
398
399 epan:: $(RESOURCES) $(BUILT_SOURCES) doxygen
400         cd epan
401         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
402         cd ..
403
404 plugins::
405         cd plugins
406         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
407         cd ..
408
409 doc::
410         cd doc
411         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
412         cd ..
413
414 help::
415         cd help
416         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
417         cd ..
418
419 doxygen.cfg: config.nmake doxygen.cfg.in
420         sed -e s/@VERSION@/$(VERSION)/ \
421             < doxygen.cfg.in > $@
422
423 doxygen-run:
424 !IFDEF DOXYGEN
425         $(DOXYGEN) doxygen.cfg
426 !ENDIF
427
428 doxygen: doxygen.cfg doxygen-run
429
430 ################################################################################
431 # Prepare build environment by downloading and installing required libraries
432 ################################################################################
433
434 # The required tools to build Ethereal.
435 #
436 # The 'find' tool is available both in \WINNT\System32 and in cygwin's /usr/bin.
437 # We only need the cygwin version (for some shell scripts).
438 # In the PATH, System32 is before cygwin's dir, so explicitly check for /usr/bin/find.
439 REQUIRED_TOOLS=\
440         $(CC) \
441         $(LINK) \
442         nmake \
443         $(SH)   \
444         $(YACC) \
445         $(LEX)  \
446         env     \
447         grep    \
448         /usr/bin/find   \
449         $(PERL) \
450         $(PYTHON)       \
451         sed     \
452         unzip   \
453         wget
454
455 verify_tools:
456         @$(SH) tools\win32-setup.sh --appverify $(REQUIRED_TOOLS)
457
458 # Download and install all the required libraries into ETHEREAL_LIBS.
459 # If you used this setup target before, consider doing a clean_setup.
460 setup: verify_tools
461 !IF "$(GTK2_INST_VERSION)" == "2.8"
462         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
463                 glib gtk2.8/glib-2.8.4-20051212.zip
464         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
465                 glib gtk2.8/glib-dev-2.8.4-20051212.zip
466 !ELSEIF "$(GTK2_INST_VERSION)" == "2.6"
467         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
468                 glib gtk2.6/glib-2.6.6.zip
469         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
470                 glib gtk2.6/glib-dev-2.6.6.zip
471 !ELSEIF "$(GTK2_INST_VERSION)" == "2.4"
472         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
473                 glib gtk2.4/glib-2.4.7.zip
474         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
475                 glib gtk2.4/glib-dev-2.4.7.zip
476 !ELSE
477         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
478                 glib glib-2.2.3-20040116.zip
479         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
480                 glib glib-dev-2.2.3-20040116.zip
481 !ENDIF
482 !IFDEF GTK1_DIR
483         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
484                 gtk+ gtk+-1.3.0-20030717.zip
485         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
486                 gtk+ gtk+-dev-1.3.0-20030115.zip
487 !ENDIF
488         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
489                 libiconv-1.9.1.bin.woe32 libiconv-1.9.1.bin.woe32.zip
490         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
491                 gettext-runtime-0.13.1 gettext-runtime-0.13.1.zip
492 !IFDEF NET_SNMP_DIR
493         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
494                 . net-snmp-5.2.2.zip
495 !ENDIF
496 !IFDEF PCAP_DIR
497         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
498                 . WpdPack_3_1.zip
499 !ENDIF
500 !IFDEF ADNS_DIR
501         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
502                 . adns-1.0-win32-05.zip
503 !ENDIF
504 !IFDEF PCRE_DIR
505         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
506                 pcre-6.4 pcre-6.4-bin.zip
507         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
508                 pcre-6.4 pcre-6.4-lib.zip
509 !ENDIF
510 !IFDEF ZLIB_DIR
511         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
512                 zlib123-dll zlib123-dll.zip
513 !ENDIF
514 !IFDEF LUA_DIR
515         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
516                 . lua5_1_vc6.zip
517 !ENDIF
518 !IFDEF GTK2_DIR
519 !IF "$(GTK2_INST_VERSION)" == "2.8"
520         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
521                 gtk2 gtk2.8/gtk+-2.8.9.zip
522         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
523                 gtk2 gtk2.8/gtk+-dev-2.8.9.zip
524         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
525                 gtk2 gtk2.8/cairo-1.0.2.zip
526         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
527                 gtk2 gtk2.8/cairo-dev-1.0.2.zip
528         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
529                 gtk2 gtk2.8/atk-1.10.3.zip
530         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
531                 gtk2 gtk2.8/atk-dev-1.10.3.zip
532         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
533                 gtk2 gtk2.8/libpng-1.2.8-bin.zip
534 !ELSEIF "$(GTK2_INST_VERSION)" == "2.6"
535         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
536                 gtk2 gtk2.6/gtk+-2.6.9.zip
537         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
538                 gtk2 gtk2.6/gtk+-dev-2.6.9.zip
539         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
540                 gtk2 gtk2.6/atk-1.9.0.zip
541         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
542                 gtk2 gtk2.6/atk-dev-1.9.0.zip
543 !ELSEIF "$(GTK2_INST_VERSION)" == "2.4"
544         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
545                 gtk2 gtk2.4/gtk+-2.4.14.zip
546         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
547                 gtk2 gtk2.4/gtk+-dev-2.4.14.zip
548         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
549                 gtk2 gtk2.4/atk-1.6.0.zip
550         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
551                 gtk2 gtk2.4/atk-dev-1.6.0.zip
552 !ELSE
553         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
554                 gtk2 gtk2/gtk+-2.2.4-20040124.zip
555         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
556                 gtk2 gtk2/gtk+-dev-2.2.4-20040124.zip
557         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
558                 gtk2 gtk2/atk-1.4.0.zip
559         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
560                 gtk2 gtk2/atk-dev-1.4.0.zip
561 !ENDIF
562 !IF "$(PANGO_INST_VERSION)" == "1.10"
563         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
564                 gtk2 gtk2.8/pango-1.10.1.zip
565         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
566                 gtk2 gtk2.8/pango-dev-1.10.1.zip
567 !ELSEIF "$(PANGO_INST_VERSION)" == "1.8"
568         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
569                 gtk2 gtk2.6/pango-1.8.2.zip
570         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
571                 gtk2 gtk2.6/pango-dev-1.8.2.zip
572 !ELSEIF "$(PANGO_INST_VERSION)" == "1.4"
573         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
574                 gtk2 gtk2.4/pango-1.4.1.zip
575         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
576                 gtk2 gtk2.4/pango-dev-1.4.1.zip
577 !ELSE
578         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
579                 gtk2 gtk2/pango-1.2.5-20040124.zip
580         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
581                 gtk2 gtk2/pango-dev-1.2.5-20040124.zip
582 !ENDIF
583 !ENDIF
584 !IFDEF GTK_WIMP_DIR
585         @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
586                 gtk-wimp gtk-wimp/gtk-wimp-0.6.2-bin.zip
587 !ENDIF
588         @echo.
589         @echo Ethereal is ready to build.
590
591 # Cleanup files installed by the setup target. It will not remove the 
592 # downloaded zip files.
593 clean_setup:
594     rm -r -f $(ETHEREAL_LIBS)/glib
595     rm -r -f $(ETHEREAL_LIBS)/gtk+
596     rm -r -f $(ETHEREAL_LIBS)/libiconv-1.9.1.bin.woe32
597     rm -r -f $(ETHEREAL_LIBS)/gettext-runtime-0.13.1
598     rm -r -f $(ETHEREAL_LIBS)/zlib123-dll
599     rm -r -f $(ETHEREAL_LIBS)/gtk2
600     rm -r -f $(ETHEREAL_LIBS)/gtk-wimp
601
602 ################################################################################
603 # Prepare the source tree for running (t)ethereal directly from there.
604 ################################################################################
605
606 # "install-deps" will copy all dlls needed to run (t)ethereal
607 # to the source tree, so you can run (t)ethereal directly from there.
608 # Note that the gtk2 version of ethereal is called ethereal-gtk2.exe
609
610 install-deps: clean-deps install-gtk1-deps install-gtk2-deps
611         cd plugins
612         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake install-plugins
613         cd ..
614
615 install-gtk2-deps: install-required-deps
616 !IFDEF GTK2_DIR
617         set copycmd=/y
618         xcopy $(GTK2_DIR)\bin\libgdk-win32-2.0-0.dll . /d
619         xcopy $(GTK2_DIR)\bin\libgdk_pixbuf-2.0-0.dll . /d
620         xcopy $(GTK2_DIR)\bin\libgtk-win32-2.0-0.dll . /d
621         xcopy $(GTK2_DIR)\bin\libatk-1.0-0.dll . /d
622         xcopy $(GTK2_DIR)\bin\libpango-1.0-0.dll . /d
623         xcopy $(GTK2_DIR)\bin\libpangowin32-1.0-0.dll . /d
624         mkdir etc
625         mkdir etc\gtk-2.0
626         mkdir etc\pango
627         mkdir lib
628         mkdir lib\gtk-2.0
629         mkdir lib\gtk-2.0\$(GTK2_LIB_DIR)
630         mkdir lib\gtk-2.0\$(GTK2_LIB_DIR)\loaders
631         mkdir lib\gtk-2.0\$(GTK2_LIB_DIR)\immodules
632         mkdir lib\pango
633         mkdir lib\pango\$(PANGO_LIB_DIR)
634         mkdir lib\pango\$(PANGO_LIB_DIR)\modules
635         xcopy $(GTK2_DIR)\etc\gtk-2.0\*.* etc\gtk-2.0 /d
636         xcopy $(GTK2_DIR)\etc\pango\pango.* etc\pango /d
637         xcopy $(GTK2_DIR)\lib\gtk-2.0\$(GTK2_LIB_DIR)\loaders\libpixbufloader-*.dll lib\gtk-2.0\$(GTK2_LIB_DIR)\loaders /d
638         xcopy $(GTK2_DIR)\lib\gtk-2.0\$(GTK2_LIB_DIR)\immodules\im-*.dll lib\gtk-2.0\$(GTK2_LIB_DIR)\immodules /d
639         xcopy $(GTK2_DIR)\lib\pango\$(PANGO_LIB_DIR)\modules\pango-*.dll lib\pango\$(PANGO_LIB_DIR)\modules /d
640 !IFDEF NEED_LIBPNG_DLL
641         xcopy $(GTK2_DIR)\bin\libpng13.dll . /d
642 !ENDIF
643 !IFDEF NEED_CAIRO_DLL
644         xcopy $(GTK2_DIR)\bin\libcairo-2.dll . /d
645         xcopy $(GTK2_DIR)\bin\libpangocairo-1.0-0.dll . /d
646 !ENDIF
647 !ENDIF
648
649 install-gtk1-deps: install-required-deps
650 !IFDEF GTK1_DIR
651         set copycmd=/y
652         xcopy $(GTK1_DIR)\lib\libgtk-0.dll . /d
653         xcopy $(GTK1_DIR)\lib\libgdk-0.dll . /d
654 !ENDIF
655
656 install-required-deps:
657         set copycmd=/y
658         xcopy wiretap\wiretap-$(WTAP_VERSION).dll . /d
659 !IFDEF ENABLE_LIBETHEREAL
660         xcopy epan\libethereal.dll . /d
661 !ENDIF
662         xcopy $(GLIB_DIR)\bin\libglib-2.0-0.dll . /d
663         xcopy $(GLIB_DIR)\bin\libgmodule-2.0-0.dll . /d
664         xcopy $(GLIB_DIR)\bin\libgobject-2.0-0.dll . /d
665         xcopy $(ICONV_DIR)\bin\iconv.dll . /d
666         xcopy $(GETTEXT_DIR)\bin\intl.dll . /d
667 !IFDEF ZLIB_DIR
668         xcopy $(ZLIB_DIR)\zlib1.dll . /d
669 !ENDIF
670 !IFDEF ADNS_DIR
671         xcopy $(ADNS_DIR)\adns_win32\LIB\adns_dll.dll . /d
672 !ENDIF
673 !IFDEF PCRE_DIR
674         xcopy $(PCRE_DIR)\bin\pcre.dll . /d
675 !ENDIF
676
677 clean-deps:
678         rm -f *.dll
679         rm -rf etc
680         rm -rf lib
681         cd plugins
682         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean-deps
683         cd ..
684