1 ## Makefile for building ethereal.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
4 # $Id: Makefile.nmake,v 1.416 2004/05/06 20:48:35 obiot 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 = $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS) $(ethereal_SOURCES:.c=.obj)
47 tethereal_OBJECTS = $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS) $(tethereal_SOURCES:.c=.obj)
49 dftest_OBJECTS = $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS) $(dftest_SOURCES:.c=.obj)
51 randpkt_OBJECTS = $(randpkt_SOURCES:.c=.obj)
59 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
61 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
62 wsock32.lib user32.lib \
66 $(NET_SNMP_DIR)\win32\lib\netsnmp.lib
67 # $(PCAP_DIR)\lib\wpcap.lib
69 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
71 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
72 wsock32.lib user32.lib \
77 $(NET_SNMP_DIR)\win32\lib\netsnmp.lib
79 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
80 wsock32.lib user32.lib \
83 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
84 wsock32.lib user32.lib \
87 dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib epan\ethereal.lib \
88 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
89 wsock32.lib user32.lib \
90 wiretap\wiretap-$(WTAP_VERSION).lib \
95 $(NET_SNMP_DIR)\win32\lib\netsnmp.lib
97 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
100 $(NET_SNMP_DIR)\win32\lib\netsnmp.lib
102 EXECUTABLES=ethereal.exe ethereal-gtk2.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe
104 RESOURCES=image\ethereal.res image\tethereal.res image\editcap.res image\mergecap.res image\text2pcap.res
106 all: config.h tools wiretap epan image $(EXECUTABLES) $(RESOURCES) doc
111 nmake -f makefile.nmake
115 seperate_packaging: all
119 nmake -f makefile.nmake GTK1_ONLY="USE"
122 nmake -f makefile.nmake GTK2_ONLY="USE"
129 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
134 ethereal.exe : config.h cvsversion.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
137 /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(GTK1_LIBS) gtk\libui.lib $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
144 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 plugins
147 /OUT:ethereal-gtk2.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(GTK2_LIBS) gtk2.tmp\libui.lib $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
151 tethereal.exe : config.h cvsversion.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
154 /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) image\tethereal.res
157 editcap.exe : config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
160 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS) image\editcap.res
163 mergecap.exe : config.h cvsversion.h mergecap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
166 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
169 text2pcap.exe : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
172 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
175 dftest.exe : $(dftest_OBJECTS) $(EXTRA_OBJECTS)
177 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS) $(EXTRA_OBJECTS)
180 randpkt.exe : $(randpkt_OBJECTS) $(EXTRA_OBJECTS)
182 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
185 config.h : config.h.win32 config.nmake
186 sed -e s/@VERSION@/$(VERSION)/ \
187 -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
188 -e "s/@HAVE_PCRE@/$(PCRE_CONFIG)/" \
189 -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
190 -e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
191 -e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
192 -e "s/@WPCAP_CONSTIFIED@/$(WPCAP_CONSTIFIED_CONFIG)/" \
193 < config.h.win32 > $@
195 ps.c : rdps.exe print.ps
200 # Build the version string
203 $(PERL) make-version.pl
206 # The header files listed here are built from x11-fields using Perl;
207 # we declare a dependency here so that they get built.
209 packet-x11.obj : packet-x11.c x11-declarations.h x11-register-info.h
212 # Build various header files for the X11 dissector.
214 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
215 $(PERL) process-x11-fields.pl <x11-fields
217 packet-ncp2222.c : ncp2222.py
219 @echo Making packet-ncp2222.c
220 $(PYTHON) ncp2222.py -o packet-ncp2222.c
222 @echo Faking packet-ncp2222.c...
223 @echo Python is required to build the NCP disector
224 @echo Hiding packet-ncp.c...
225 mv packet-ncp.c packet-ncp.c.save
226 touch packet-ncp.c $@
230 # Build "tethereal-tap-register.c", which contains a function
231 # "register_all_tap_listeners()"
232 # that calls the register routines for all tehtereal tap listeners.
234 # We do this by grepping through sources.
236 # Formatting conventions: The name of the tap_listener_register_*
237 # routines must start in column zero, or must be preceded only by
238 # "void " starting in column zero, and must not be inside #if.
240 # The first argument is the name of the file to write.
241 # The second argument is the directory in which the source files live.
242 # All subsequent arguments are the files to scan.
244 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
245 @echo Making tethereal-tap-register.c
246 @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
248 text2pcap-scanner.c : text2pcap-scanner.l
249 $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
253 if exist gtk2.tmp rmdir gtk2.tmp
255 clean: gtk2_distclean
256 rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
257 $(EXECUTABLES) $(PDB_FILE) \
258 editcap.obj mergecap.obj text2pcap.obj getopt.obj\
259 text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
260 rdps.pdb config.h ps.c \
261 rdps.exe rdps.ilk dftest.obj dftest.exe randpkt.obj randpkt.ext \
264 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
266 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
268 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
270 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
272 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
274 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
276 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
278 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
280 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
283 # Call distclean only, if you would like to remove ALL generated files.
284 # Be sure to have python and perl installed to regenerate them.
285 distclean: clean gtk2_distclean
286 rm -f $(BUILT_SOURCES) \
287 packet-ncp2222.c tethereal-tap-register.c
289 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
291 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
293 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
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
310 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
315 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
320 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
323 gtk:: help config.h cvsversion.h
325 $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK1_CFLAGS)" GTK_LIBS="$(GTK1_LIBS)" libui.lib
328 # copy all required files to gtk2.tmp (but only when newer than existing) and compile in that dir
329 gtk2:: help config.h cvsversion.h
330 if not exist gtk2.tmp mkdir gtk2.tmp
332 cp --update --preserve Makefile.* *.c *.h ..\gtk2.tmp
334 $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK2_CFLAGS)" GTK_LIBS="$(GTK2_LIBS)" libui.lib
337 epan:: packet-ncp2222.c x11-declarations.h x11-register-info.h
339 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
344 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
349 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
354 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
369 @$(SH) tools\win32-setup.sh --appverify $(REQUIRED_APPS)
372 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
373 glib glib-2.2.3-20040116.zip
374 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
375 glib glib-dev-2.2.3-20040116.zip
377 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
378 gtk+ gtk+-1.3.0-20030717.zip
379 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
380 gtk+ gtk+-dev-1.3.0-20030115.zip
382 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
383 libiconv-1.9.1.bin.woe32 libiconv-1.9.1.bin.woe32.zip
384 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
385 gettext-runtime-0.13.1 gettext-runtime-0.13.1.zip
387 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
391 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
395 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
396 . adns-1.0-win32-03.zip
399 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
403 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
404 zlib121-dll zlib121-dll.zip
407 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
408 gtk2 gtk2/gtk+-2.2.4-20040124.zip
409 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
410 gtk2 gtk2/gtk+-dev-2.2.4-20040124.zip
411 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
412 gtk2 gtk2/pango-1.2.5-20040124.zip
413 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
414 gtk2 gtk2/pango-dev-1.2.5-20040124.zip
415 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
416 gtk2 gtk2/atk-1.4.0.zip
417 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
418 gtk2 gtk2/atk-dev-1.4.0.zip
419 @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
420 gtk-wimp gtk2/gtk-wimp-0.5.3-bin.zip
423 @echo Ethereal is ready to build.
425 update_plugin_api: config.h
427 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake xyzzy