1 ## Makefile for building ethereal.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
9 ############### no need to modify below this line #########
14 LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)
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_
21 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
24 $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
26 PLATFORM_SRC = capture-wpcap.c
28 include Makefile.common
30 ethereal_OBJECTS = $(ethereal_SOURCES:.c=.obj)
31 tethereal_OBJECTS = $(tethereal_SOURCES:.c=.obj)
32 dftest_OBJECTS = $(dftest_SOURCES:.c=.obj)
34 randpkt_OBJECTS = $(randpkt_SOURCES:.c=.obj)
36 command_line_OBJECTS = setargv.obj
44 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
45 wsock32.lib user32.lib shell32.lib \
46 $(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib \
47 !IFDEF ENABLE_LIBETHEREAL
48 epan\libethereal.lib \
50 epan\dissectors\dissectors.lib \
52 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
57 # $(PCAP_DIR)\lib\wpcap.lib
59 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
60 wsock32.lib user32.lib \
62 $(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib \
63 !IFDEF ENABLE_LIBETHEREAL
64 epan\libethereal.lib \
66 epan\dissectors\dissectors.lib \
68 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
74 capinfos_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
75 wsock32.lib user32.lib \
78 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
79 wsock32.lib user32.lib \
82 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
83 wsock32.lib user32.lib \
86 dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
87 wsock32.lib user32.lib \
89 $(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib \
90 !IFDEF ENABLE_LIBETHEREAL
91 epan\libethereal.lib \
93 epan\dissectors\dissectors.lib \
95 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
101 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
104 $(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib
106 EXECUTABLES=ethereal.exe ethereal-gtk2.exe tethereal.exe \
107 capinfos.exe editcap.exe mergecap.exe text2pcap.exe
109 RESOURCES=image\ethereal.res image\libethereal.res image\tethereal.res \
110 image\capinfos.res image\editcap.res image\mergecap.res \
111 image\text2pcap.res image\wiretap.res
113 all: config.h tools image wiretap epan $(EXECUTABLES) $(RESOURCES) doc
118 nmake -f makefile.nmake
122 separate_packaging: all
126 nmake -f makefile.nmake GTK1_ONLY="USE"
129 nmake -f makefile.nmake GTK2_ONLY="USE"
136 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
141 ethereal.exe : config.h svnversion.h $(ethereal_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
144 /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(GTK1_LIBS) gtk\libui.lib $(ethereal_OBJECTS) image\ethereal.res
151 ethereal-gtk2.exe : config.h svnversion.h $(ethereal_OBJECTS) epan gtk2 image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk2.tmp\libui.lib plugins
154 /OUT:ethereal-gtk2.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(GTK2_LIBS) gtk2.tmp\libui.lib $(ethereal_OBJECTS) image\ethereal.res
158 tethereal.exe : config.h svnversion.h $(tethereal_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
161 /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(command_line_OBJECTS) image\tethereal.res
164 capinfos.exe : config.h capinfos.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\capinfos.res
167 /OUT:capinfos.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console capinfos.obj getopt.obj $(command_line_OBJECTS) $(capinfos_LIBS) image\capinfos.res
170 editcap.exe : config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
173 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(command_line_OBJECTS) $(editcap_LIBS) image\editcap.res
176 mergecap.exe : config.h svnversion.h mergecap.obj merge.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
179 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj merge.obj getopt.obj $(command_line_OBJECTS) $(mergecap_LIBS) image\mergecap.res
182 text2pcap.exe : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
185 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj $(command_line_OBJECTS) image\text2pcap.res
188 dftest.exe : $(dftest_OBJECTS) epan
190 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS)
193 randpkt.exe : $(randpkt_OBJECTS)
195 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS) $(command_line_OBJECTS)
198 config.h : config.h.win32 config.nmake
199 sed -e s/@VERSION@/$(VERSION)/ \
200 -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
201 -e "s/@HAVE_PCRE@/$(PCRE_CONFIG)/" \
202 -e "s/@HAVE_NETTLE@/$(NETTLE_CONFIG)/" \
203 -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
204 -e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
205 -e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
206 -e "s/@HAVE_PCAP_DATALINK_NAME_TO_VAL@/$(PCAP_DATALINK_NAME_TO_VAL_CONFIG)/" \
207 -e "s/@HAVE_PCAP_DATALINK_VAL_TO_NAME@/$(PCAP_DATALINK_VAL_TO_NAME_CONFIG)/" \
208 -e "s/@HAVE_LIBETHEREALDLL@/$(LIBETHEREAL_CONFIG)/" \
209 -e "s/@WPCAP_CONSTIFIED@/$(WPCAP_CONSTIFIED_CONFIG)/" \
210 < config.h.win32 > $@
212 ps.c : rdps.exe print.ps
217 # Build the version string
220 $(PERL) make-version.pl
223 # Build the short version of the authors file for the about dialog
225 AUTHORS-SHORT: AUTHORS make-authors-short.pl
226 $(PERL) perlnoutf.pl make-authors-short.pl < AUTHORS > AUTHORS-SHORT
229 # Build the short version of the authors file with formatting codes for
232 AUTHORS-SHORT-FORMAT: AUTHORS-SHORT make-authors-format.pl
233 $(PERL) perlnoutf.pl make-authors-format.pl < AUTHORS-SHORT > AUTHORS-SHORT-FORMAT
236 # Build "tethereal-tap-register.c", which contains a function
237 # "register_all_tap_listeners()"
238 # that calls the register routines for all tehtereal tap listeners.
240 # We do this by grepping through sources.
242 # Formatting conventions: The name of the tap_listener_register_*
243 # routines must start in column zero, or must be preceded only by
244 # "void " starting in column zero, and must not be inside #if.
246 # The first argument is the name of the file to write.
247 # The second argument is the directory in which the source files live.
248 # All subsequent arguments are the files to scan.
250 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
251 @echo Making tethereal-tap-register.c
252 @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
254 text2pcap-scanner.c : text2pcap-scanner.l
255 $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
259 if exist gtk2.tmp rmdir gtk2.tmp
261 clean: gtk2_distclean
262 rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
263 $(EXECUTABLES) $(PDB_FILE) \
264 capinfos.obj editcap.obj mergecap.obj text2pcap.obj getopt.obj\
265 text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
266 rdps.pdb rdps.exe rdps.ilk config.h ps.c AUTHORS-SHORT \
267 AUTHORS-SHORT-FORMAT \
268 dftest.obj dftest.exe randpkt.obj randpkt.ext doxygen.cfg \
271 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
273 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
275 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
277 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
279 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
281 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
283 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
285 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
287 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
290 # "distclean" removes all files not part of the distribution.
291 # It does not remove generated files that are part of the distribution.
292 distclean: clean gtk2_distclean
293 rm -f config.h $(BUILT_SOURCES)
295 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
297 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
299 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
301 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
303 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
305 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
307 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
309 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
311 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
314 # Make "maintainer-clean" only if you would like to remove ALL generated
316 # Be sure to have python and perl installed to regenerate them.
317 maintainer-clean: distclean
318 rm -f $(GENERATED_FILES)
320 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
322 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
324 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
326 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
328 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
330 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
332 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
334 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
336 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
341 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
346 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
351 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
354 gtk:: help config.h svnversion.h AUTHORS-SHORT doxygen
356 $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK1_CFLAGS)" GTK_LIBS="$(GTK1_LIBS)" libui.lib
359 # copy all required files to gtk2.tmp (but only when newer than existing) and compile in that dir
360 gtk2:: help config.h svnversion.h AUTHORS-SHORT
361 if not exist gtk2.tmp mkdir gtk2.tmp
363 xcopy Makefile.* ..\gtk2.tmp /d /y
364 xcopy *.c ..\gtk2.tmp /d /y
365 xcopy *.h ..\gtk2.tmp /d /y
367 $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK2_CFLAGS)" GTK_LIBS="$(GTK2_LIBS)" libui.lib
370 epan:: $(RESOURCES) $(BUILT_SOURCES) doxygen
372 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
377 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
382 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
387 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
390 doxygen.cfg: config.nmake doxygen.cfg.in
391 sed -e s/@VERSION@/$(VERSION)/ \
392 < doxygen.cfg.in > $@
396 $(DOXYGEN) doxygen.cfg
399 doxygen: doxygen.cfg doxygen-run
414 @$(SH) tools\win32-setup.sh --appverify $(REQUIRED_TOOLS)
416 # Download and install all the required libraries into ETHEREAL_LIBS.
417 # If you used this setup target before, consider doing a clean_setup.
419 !IF "$(GTK2_INST_VERSION)" == "2.4"
420 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
421 glib gtk2.4/glib-2.4.7.zip
422 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
423 glib gtk2.4/glib-dev-2.4.7.zip
425 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
426 glib glib-2.2.3-20040116.zip
427 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
428 glib glib-dev-2.2.3-20040116.zip
431 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
432 gtk+ gtk+-1.3.0-20030717.zip
433 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
434 gtk+ gtk+-dev-1.3.0-20030115.zip
436 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
437 libiconv-1.9.1.bin.woe32 libiconv-1.9.1.bin.woe32.zip
438 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
439 gettext-runtime-0.13.1 gettext-runtime-0.13.1.zip
441 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
445 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
449 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
450 . adns-1.0-win32-04.zip
453 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
457 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
458 zlib122-dll zlib122-dll.zip
461 !IF "$(GTK2_INST_VERSION)" == "2.4"
462 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
463 gtk2 gtk2.4/gtk+-2.4.14.zip
464 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
465 gtk2 gtk2.4/gtk+-dev-2.4.14.zip
466 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
467 gtk2 gtk2.4/atk-1.6.0.zip
468 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
469 gtk2 gtk2.4/atk-dev-1.6.0.zip
471 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
472 gtk2 gtk2/gtk+-2.2.4-20040124.zip
473 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
474 gtk2 gtk2/gtk+-dev-2.2.4-20040124.zip
475 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
476 gtk2 gtk2/atk-1.4.0.zip
477 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
478 gtk2 gtk2/atk-dev-1.4.0.zip
480 !IF "$(PANGO_INST_VERSION)" == "1.4"
481 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
482 gtk2 gtk2.4/pango-1.4.1.zip
483 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
484 gtk2 gtk2.4/pango-dev-1.4.1.zip
486 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
487 gtk2 gtk2/pango-1.2.5-20040124.zip
488 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
489 gtk2 gtk2/pango-dev-1.2.5-20040124.zip
493 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
494 gtk-wimp gtk-wimp/gtk-wimp-0.6.2-bin.zip
497 @echo Ethereal is ready to build.
499 # Cleanup files installed by the setup target. It will not remove the
500 # downloaded zip files.
502 rm -r -f $(ETHEREAL_LIBS)/glib
503 rm -r -f $(ETHEREAL_LIBS)/gtk+
504 rm -r -f $(ETHEREAL_LIBS)/libiconv-1.9.1.bin.woe32
505 rm -r -f $(ETHEREAL_LIBS)/gettext-runtime-0.13.1
506 rm -r -f $(ETHEREAL_LIBS)/zlib122-dll
507 rm -r -f $(ETHEREAL_LIBS)/gtk2
508 rm -r -f $(ETHEREAL_LIBS)/gtk-wimp