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