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_=""
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 include epan\Makefile.common
32 BUILT_SOURCES = $(BUILT_SOURCES) \
35 DISSECTOR_SUPPORT_SRC = $(DISSECTOR_SUPPORT_SRC:../=)
36 DISSECTOR_SUPPORT_OBJECTS = $(DISSECTOR_SUPPORT_SRC:.c=.obj)
37 #DISSECTOR_SUPPORT_OBJECTS = $(DISSECTOR_SUPPORT_OBJECTS:../=)
39 ethereal_OBJECTS = $(ethereal_SOURCES:.c=.obj)
40 tethereal_OBJECTS = $(tethereal_SOURCES:.c=.obj)
41 dftest_OBJECTS = $(dftest_SOURCES:.c=.obj)
43 randpkt_OBJECTS = $(randpkt_SOURCES:.c=.obj)
51 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
52 wsock32.lib user32.lib shell32.lib \
53 $(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib \
54 !IFDEF ENABLE_LIBETHEREAL
55 epan\libethereal.lib \
57 epan\dissectors\dissectors.lib \
59 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
64 # $(PCAP_DIR)\lib\wpcap.lib
66 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
67 wsock32.lib user32.lib \
69 $(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib \
70 !IFDEF ENABLE_LIBETHEREAL
71 epan\libethereal.lib \
73 epan\dissectors\dissectors.lib \
75 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
81 capinfo_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
82 wsock32.lib user32.lib \
85 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
86 wsock32.lib user32.lib \
89 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
90 wsock32.lib user32.lib \
93 dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
94 wsock32.lib user32.lib \
96 $(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib \
97 !IFDEF ENABLE_LIBETHEREAL
98 epan\libethereal.lib \
100 epan\dissectors\dissectors.lib \
102 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
108 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
111 $(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib
113 EXECUTABLES=ethereal.exe ethereal-gtk2.exe tethereal.exe \
114 capinfo.exe editcap.exe mergecap.exe text2pcap.exe
116 RESOURCES=image\ethereal.res image\libethereal.res image\tethereal.res \
117 image\capinfo.res image\editcap.res image\mergecap.res \
118 image\text2pcap.res image\wiretap.res
120 all: config.h tools image wiretap epan $(EXECUTABLES) $(RESOURCES) doc
125 nmake -f makefile.nmake
129 separate_packaging: all
133 nmake -f makefile.nmake GTK1_ONLY="USE"
136 nmake -f makefile.nmake GTK2_ONLY="USE"
143 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
148 ethereal.exe : config.h svnversion.h $(ethereal_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
151 /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(GTK1_LIBS) gtk\libui.lib $(ethereal_OBJECTS) image\ethereal.res
158 ethereal-gtk2.exe : config.h svnversion.h $(ethereal_OBJECTS) epan gtk2 image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk2.tmp\libui.lib plugins
161 /OUT:ethereal-gtk2.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(GTK2_LIBS) gtk2.tmp\libui.lib $(ethereal_OBJECTS) image\ethereal.res
165 tethereal.exe : config.h svnversion.h $(tethereal_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
168 /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) image\tethereal.res
171 capinfo.exe : config.h capinfo.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\capinfo.res
174 /OUT:capinfo.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console capinfo.obj getopt.obj $(capinfo_LIBS) image\capinfo.res
177 editcap.exe : config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
180 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS) image\editcap.res
183 mergecap.exe : config.h svnversion.h mergecap.obj merge.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
186 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj merge.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
189 text2pcap.exe : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
192 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
195 dftest.exe : $(dftest_OBJECTS) epan
197 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS)
200 randpkt.exe : $(randpkt_OBJECTS)
202 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
205 config.h : config.h.win32 config.nmake
206 sed -e s/@VERSION@/$(VERSION)/ \
207 -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
208 -e "s/@HAVE_PCRE@/$(PCRE_CONFIG)/" \
209 -e "s/@HAVE_NETTLE@/$(NETTLE_CONFIG)/" \
210 -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
211 -e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
212 -e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
213 -e "s/@HAVE_PCAP_DATALINK_NAME_TO_VAL@/$(PCAP_DATALINK_NAME_TO_VAL_CONFIG)/" \
214 -e "s/@HAVE_PCAP_DATALINK_VAL_TO_NAME@/$(PCAP_DATALINK_VAL_TO_NAME_CONFIG)/" \
215 -e "s/@HAVE_LIBETHEREALDLL@/$(LIBETHEREAL_CONFIG)/" \
216 -e "s/@WPCAP_CONSTIFIED@/$(WPCAP_CONSTIFIED_CONFIG)/" \
217 < config.h.win32 > $@
219 ps.c : rdps.exe print.ps
224 # Build the version string
227 $(PERL) make-version.pl
230 # Build the short version of the authors file for the about dialog
232 AUTHORS-SHORT: AUTHORS make-authors-short.pl make-authors-short2.pl
233 $(PERL) make-authors-short.pl < AUTHORS > AUTHORS-SHORT
237 # Build "tethereal-tap-register.c", which contains a function
238 # "register_all_tap_listeners()"
239 # that calls the register routines for all tehtereal tap listeners.
241 # We do this by grepping through sources.
243 # Formatting conventions: The name of the tap_listener_register_*
244 # routines must start in column zero, or must be preceded only by
245 # "void " starting in column zero, and must not be inside #if.
247 # The first argument is the name of the file to write.
248 # The second argument is the directory in which the source files live.
249 # All subsequent arguments are the files to scan.
251 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
252 @echo Making tethereal-tap-register.c
253 @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
255 text2pcap-scanner.c : text2pcap-scanner.l
256 $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
260 if exist gtk2.tmp rmdir gtk2.tmp
262 clean: gtk2_distclean
263 rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
264 $(EXECUTABLES) $(PDB_FILE) \
265 capinfo.obj editcap.obj mergecap.obj text2pcap.obj getopt.obj\
266 text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
267 rdps.pdb rdps.exe rdps.ilk config.h ps.c AUTHORS-SHORT \
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 # Call distclean only, if you would like to remove ALL generated files.
291 # Be sure to have python and perl installed to regenerate them.
292 distclean: clean gtk2_distclean
293 rm -f $(BUILT_SOURCES) \
294 tethereal-tap-register.c
296 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
298 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
300 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
302 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
304 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
306 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
308 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
310 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
312 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
317 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
322 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
327 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
330 gtk:: help config.h svnversion.h AUTHORS-SHORT doxygen
332 $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK1_CFLAGS)" GTK_LIBS="$(GTK1_LIBS)" libui.lib
335 # copy all required files to gtk2.tmp (but only when newer than existing) and compile in that dir
336 gtk2:: help config.h svnversion.h AUTHORS-SHORT
337 if not exist gtk2.tmp mkdir gtk2.tmp
339 cp --update --preserve Makefile.* *.c *.h ..\gtk2.tmp
341 $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK2_CFLAGS)" GTK_LIBS="$(GTK2_LIBS)" libui.lib
344 epan:: $(DISSECTOR_SUPPORT_OBJECTS) $(EXTRA_OBJECTS) $(RESOURCES) $(BUILT_SOURCES) doxygen
346 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
351 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
356 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
361 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
364 doxygen.cfg: config.nmake doxygen.cfg.in
365 sed -e s/@VERSION@/$(VERSION)/ \
366 < doxygen.cfg.in > $@
370 $(DOXYGEN) doxygen.cfg
373 doxygen: doxygen.cfg doxygen-run
387 @$(SH) tools\win32-setup.sh --appverify $(REQUIRED_TOOLS)
389 # Download and install all the required libraries into ETHEREAL_LIBS.
390 # If you used this setup target before, consider doing a clean_setup.
392 !IF "$(GTK2_INST_VERSION)" == "2.4"
393 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
394 glib gtk2.4/glib-2.4.7.zip
395 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
396 glib gtk2.4/glib-dev-2.4.7.zip
398 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
399 glib glib-2.2.3-20040116.zip
400 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
401 glib glib-dev-2.2.3-20040116.zip
404 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
405 gtk+ gtk+-1.3.0-20030717.zip
406 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
407 gtk+ gtk+-dev-1.3.0-20030115.zip
409 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
410 libiconv-1.9.1.bin.woe32 libiconv-1.9.1.bin.woe32.zip
411 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
412 gettext-runtime-0.13.1 gettext-runtime-0.13.1.zip
414 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
418 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
422 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
423 . adns-1.0-win32-04.zip
426 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
430 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
431 zlib121-dll zlib121-dll.zip
434 !IF "$(GTK2_INST_VERSION)" == "2.4"
435 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
436 gtk2 gtk2.4/gtk+-2.4.10-20041001.zip
437 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
438 gtk2 gtk2.4/gtk+-dev-2.4.10.zip
439 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
440 gtk2 gtk2.4/atk-1.6.0.zip
441 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
442 gtk2 gtk2.4/atk-dev-1.6.0.zip
444 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
445 gtk2 gtk2/gtk+-2.2.4-20040124.zip
446 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
447 gtk2 gtk2/gtk+-dev-2.2.4-20040124.zip
448 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
449 gtk2 gtk2/atk-1.4.0.zip
450 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
451 gtk2 gtk2/atk-dev-1.4.0.zip
453 !IF "$(PANGO_INST_VERSION)" == "1.4"
454 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
455 gtk2 gtk2.4/pango-1.4.1.zip
456 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
457 gtk2 gtk2.4/pango-dev-1.4.1.zip
459 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
460 gtk2 gtk2/pango-1.2.5-20040124.zip
461 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
462 gtk2 gtk2/pango-dev-1.2.5-20040124.zip
466 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
467 gtk-wimp gtk-wimp/gtk-wimp-0.6.2-bin.zip
470 @echo Ethereal is ready to build.
472 # Cleanup files installed by the setup target. It will not remove the
473 # downloaded zip files.
475 rm -r -f $(ETHEREAL_LIBS)/glib
476 rm -r -f $(ETHEREAL_LIBS)/gtk+
477 rm -r -f $(ETHEREAL_LIBS)/libiconv-1.9.1.bin.woe32
478 rm -r -f $(ETHEREAL_LIBS)/gettext-runtime-0.13.1
479 rm -r -f $(ETHEREAL_LIBS)/zlib121-dll
480 rm -r -f $(ETHEREAL_LIBS)/gtk2
481 rm -r -f $(ETHEREAL_LIBS)/gtk-wimp
483 update_plugin_api: config.h
485 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake xyzzy