1 ## Makefile for building ethereal.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
4 # $Id: Makefile.nmake,v 1.419 2004/05/14 16:23:38 ulfl Exp $
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_SRC = $(DISSECTOR_SRC:../=)
36 DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
38 DISSECTOR_SUPPORT_SRC = $(DISSECTOR_SUPPORT_SRC:../=)
39 DISSECTOR_SUPPORT_OBJECTS = $(DISSECTOR_SUPPORT_SRC:.c=.obj)
41 # remove register.obj from "DISSECTOR_SUPPORT_OBJECTS".
42 # creation and compilation of register.c has been moved to epan.
43 DISSECTOR_SUPPORT_OBJECTS = $(DISSECTOR_SUPPORT_OBJECTS:register.obj=)
45 ethereal_OBJECTS = $(ethereal_SOURCES:.c=.obj)
46 tethereal_OBJECTS = $(tethereal_SOURCES:.c=.obj)
47 dftest_OBJECTS = $(dftest_SOURCES:.c=.obj)
49 randpkt_OBJECTS = $(randpkt_SOURCES:.c=.obj)
57 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
58 wsock32.lib user32.lib \
59 $(NET_SNMP_DIR)\win32\lib\netsnmp.lib \
60 !IFDEF ENABLE_LIBETHEREAL
61 epan\libethereal.lib \
65 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
70 # $(PCAP_DIR)\lib\wpcap.lib
72 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
73 wsock32.lib user32.lib \
75 $(NET_SNMP_DIR)\win32\lib\netsnmp.lib \
76 !IFDEF ENABLE_LIBETHEREAL
77 epan\libethereal.lib \
81 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
87 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
88 wsock32.lib user32.lib \
91 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
92 wsock32.lib user32.lib \
95 dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
96 wsock32.lib user32.lib \
98 $(NET_SNMP_DIR)\win32\lib\netsnmp.lib \
99 !IFDEF ENABLE_LIBETHEREAL
100 epan\libethereal.lib \
104 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
110 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
113 $(NET_SNMP_DIR)\win32\lib\netsnmp.lib
115 EXECUTABLES=ethereal.exe ethereal-gtk2.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe
117 RESOURCES=image\ethereal.res image\tethereal.res image\editcap.res image\mergecap.res image\text2pcap.res
119 all: config.h tools wiretap epan image $(EXECUTABLES) $(RESOURCES) doc
124 nmake -f makefile.nmake
128 separate_packaging: all
132 nmake -f makefile.nmake GTK1_ONLY="USE"
135 nmake -f makefile.nmake GTK2_ONLY="USE"
142 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
147 ethereal.exe : config.h cvsversion.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib dissectors.lib plugins
150 /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(GTK1_LIBS) gtk\libui.lib $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
157 ethereal-gtk2.exe : config.h cvsversion.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk2 image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk2.tmp\libui.lib dissectors.lib plugins
160 /OUT:ethereal-gtk2.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(GTK2_LIBS) gtk2.tmp\libui.lib $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
164 tethereal.exe : config.h cvsversion.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib dissectors.lib plugins
167 /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) image\tethereal.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 $(editcap_LIBS) image\editcap.res
176 mergecap.exe : config.h cvsversion.h mergecap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
179 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj getopt.obj $(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 image\text2pcap.res
188 dftest.exe : $(dftest_OBJECTS) $(EXTRA_OBJECTS) dissectors.lib
190 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS) $(EXTRA_OBJECTS)
193 randpkt.exe : $(randpkt_OBJECTS) $(EXTRA_OBJECTS)
195 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
198 dissectors.lib: config.h $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS) $(EXTRA_OBJECTS)
199 lib /out:dissectors.lib $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS) $(EXTRA_OBJECTS)
201 config.h : config.h.win32 config.nmake
202 sed -e s/@VERSION@/$(VERSION)/ \
203 -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
204 -e "s/@HAVE_PCRE@/$(PCRE_CONFIG)/" \
205 -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
206 -e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
207 -e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
208 -e "s/@HAVE_LIBETHEREALDLL@/$(LIBETHEREAL_CONFIG)/" \
209 -e "s/@WPCAP_CONSTIFIED@/$(WPCAP_CONSTIFIED_CONFIG)/" \
210 -e "s/@HAVE_LIBETHEREALDLL@/$(LIBETHEREAL_CONFIG)/" \
211 < config.h.win32 > $@
213 ps.c : rdps.exe print.ps
218 # Build the version string
221 $(PERL) make-version.pl
224 # The header files listed here are built from x11-fields using Perl;
225 # we declare a dependency here so that they get built.
227 packet-x11.obj : packet-x11.c x11-declarations.h x11-register-info.h
230 # Build various header files for the X11 dissector.
232 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
233 $(PERL) process-x11-fields.pl <x11-fields
235 packet-ncp2222.c : ncp2222.py
237 @echo Making packet-ncp2222.c
238 $(PYTHON) ncp2222.py -o packet-ncp2222.c
240 @echo Faking packet-ncp2222.c...
241 @echo Python is required to build the NCP disector
242 @echo Hiding packet-ncp.c...
243 mv packet-ncp.c packet-ncp.c.save
244 touch packet-ncp.c $@
248 # Build "tethereal-tap-register.c", which contains a function
249 # "register_all_tap_listeners()"
250 # that calls the register routines for all tehtereal tap listeners.
252 # We do this by grepping through sources.
254 # Formatting conventions: The name of the tap_listener_register_*
255 # routines must start in column zero, or must be preceded only by
256 # "void " starting in column zero, and must not be inside #if.
258 # The first argument is the name of the file to write.
259 # The second argument is the directory in which the source files live.
260 # All subsequent arguments are the files to scan.
262 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
263 @echo Making tethereal-tap-register.c
264 @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
266 text2pcap-scanner.c : text2pcap-scanner.l
267 $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
271 if exist gtk2.tmp rmdir gtk2.tmp
273 clean: gtk2_distclean
274 rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
275 $(EXECUTABLES) $(PDB_FILE) \
276 $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS) dissectors.lib\
277 editcap.obj mergecap.obj text2pcap.obj getopt.obj\
278 text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
279 rdps.pdb config.h ps.c \
280 rdps.exe rdps.ilk dftest.obj dftest.exe randpkt.obj randpkt.ext \
283 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
285 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
287 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
289 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
291 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
293 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
295 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
297 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
299 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
302 # Call distclean only, if you would like to remove ALL generated files.
303 # Be sure to have python and perl installed to regenerate them.
304 distclean: clean gtk2_distclean
305 rm -f $(BUILT_SOURCES) \
306 packet-ncp2222.c tethereal-tap-register.c
308 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
310 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
312 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
314 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
316 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
318 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
320 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
322 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
324 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
329 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
334 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
339 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
342 gtk:: help config.h cvsversion.h
344 $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK1_CFLAGS)" GTK_LIBS="$(GTK1_LIBS)" libui.lib
347 # copy all required files to gtk2.tmp (but only when newer than existing) and compile in that dir
348 gtk2:: help config.h cvsversion.h
349 if not exist gtk2.tmp mkdir gtk2.tmp
351 cp --update --preserve Makefile.* *.c *.h ..\gtk2.tmp
353 $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK2_CFLAGS)" GTK_LIBS="$(GTK2_LIBS)" libui.lib
356 epan:: packet-ncp2222.c x11-declarations.h x11-register-info.h dissectors.lib
358 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
363 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
368 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
373 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
388 @$(SH) tools\win32-setup.sh --appverify $(REQUIRED_APPS)
391 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
392 glib glib-2.2.3-20040116.zip
393 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
394 glib glib-dev-2.2.3-20040116.zip
396 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
397 gtk+ gtk+-1.3.0-20030717.zip
398 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
399 gtk+ gtk+-dev-1.3.0-20030115.zip
401 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
402 libiconv-1.9.1.bin.woe32 libiconv-1.9.1.bin.woe32.zip
403 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
404 gettext-runtime-0.13.1 gettext-runtime-0.13.1.zip
406 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
410 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
414 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
415 . adns-1.0-win32-03.zip
418 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
422 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
423 zlib121-dll zlib121-dll.zip
426 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
427 gtk2 gtk2/gtk+-2.2.4-20040124.zip
428 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
429 gtk2 gtk2/gtk+-dev-2.2.4-20040124.zip
430 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
431 gtk2 gtk2/pango-1.2.5-20040124.zip
432 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
433 gtk2 gtk2/pango-dev-1.2.5-20040124.zip
434 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
435 gtk2 gtk2/atk-1.4.0.zip
436 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
437 gtk2 gtk2/atk-dev-1.4.0.zip
440 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
441 gtk-wimp gtk2/gtk-wimp-0.5.4-bin.zip
444 @echo Ethereal is ready to build.
446 update_plugin_api: config.h
448 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake xyzzy