1 ## Makefile for building ethereal.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
4 # $Id: Makefile.nmake,v 1.252 2002/11/02 22:23:16 sahlberg 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) /I$(GLIB_DIR) /I$(GLIB_DIR)\gmodule \
17 /I$(GTK_DIR) /I. /Iwiretap /I$(GTK_DIR)\gdk /I$(GTK_DIR)\gdk\win32 \
18 /I$(ZLIB_DIR) /I$(PCAP_DIR)\include \
19 /I$(NET_SNMP_DIR)\include /I$(NET_SNMP_DIR)\win32 \
22 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
25 $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
62 packet-dcerpc-afs4int.c \
63 packet-dcerpc-bossvr.c \
64 packet-dcerpc-browser.c \
65 packet-dcerpc-cds_clerkserver.c \
66 packet-dcerpc-cds_solicit.c \
67 packet-dcerpc-conv.c \
68 packet-dcerpc-cprpc_server.c \
69 packet-dcerpc-dce122.c \
71 packet-dcerpc-dnsserver.c \
72 packet-dcerpc-dtsprovider.c \
73 packet-dcerpc-dtsstime_req.c \
75 packet-dcerpc-fldb.c \
76 packet-dcerpc-ftserver.c \
77 packet-dcerpc-krb5rpc.c \
79 packet-dcerpc-lsa-ds.c \
80 packet-dcerpc-mapi.c \
81 packet-dcerpc-mgmt.c \
83 packet-dcerpc-netlogon.c \
84 packet-dcerpc-nspi.c \
86 packet-dcerpc-oxid.c \
88 packet-dcerpc-remact.c \
89 packet-dcerpc-rep_proc.c \
90 packet-dcerpc-roverride.c \
91 packet-dcerpc-rpriv.c \
92 packet-dcerpc-rs_acct.c \
93 packet-dcerpc-rs_attr.c \
94 packet-dcerpc-rs_misc.c \
95 packet-dcerpc-rs_pgo.c \
96 packet-dcerpc-rs_repadm.c \
97 packet-dcerpc-rs_replist.c \
98 packet-dcerpc-rs_unix.c \
99 packet-dcerpc-rsec_login.c \
100 packet-dcerpc-samr.c \
101 packet-dcerpc-secidmap.c \
102 packet-dcerpc-spoolss.c \
103 packet-dcerpc-srvsvc.c \
104 packet-dcerpc-tapi.c \
105 packet-dcerpc-tkn4int.c \
106 packet-dcerpc-ubikdisk.c \
107 packet-dcerpc-ubikvote.c \
108 packet-dcerpc-update.c \
109 packet-dcerpc-wkssvc.c \
164 packet-isis-hello.c \
216 packet-osi-options.c \
234 packet-quakeworld.c \
264 packet-slowprotocols.c \
266 packet-smb-browse.c \
267 packet-smb-common.c \
269 packet-smb-mailslot.c \
283 packet-stat-notify.c \
324 DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
326 TETHEREAL_TAP_SRC = \
329 tap-protohierstat.c \
333 TETHEREAL_TAP_OBJECTS = $(TETHEREAL_TAP_SRC:.c=.obj)
335 ETHEREAL_COMMON_OBJECTS = \
338 capture_stop_conditions.obj \
361 $(DISSECTOR_OBJECTS) \
362 $(ETHEREAL_COMMON_OBJECTS) \
366 proto_hier_stats.obj \
369 tethereal_OBJECTS = \
370 $(DISSECTOR_OBJECTS) \
371 $(ETHEREAL_COMMON_OBJECTS) \
372 $(TETHEREAL_TAP_OBJECTS) \
373 tethereal-tap-register.obj \
377 $(DISSECTOR_OBJECTS) \
378 $(ETHEREAL_COMMON_OBJECTS) \
390 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
391 gtk\libui.lib epan\ethereal.lib \
392 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
393 wsock32.lib user32.lib \
394 $(GTK_DIR)\gtk\gtk-$(GTK_VERSION).lib \
395 $(GTK_DIR)\gdk\gdk-$(GTK_VERSION).lib \
396 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
397 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib \
398 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
399 # $(PCAP_DIR)\lib\wpcap.lib
401 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
403 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
404 wsock32.lib user32.lib \
405 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
406 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib \
407 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
409 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
410 wsock32.lib user32.lib \
411 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
412 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib
414 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
415 wsock32.lib user32.lib \
416 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
417 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib
419 dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib epan\ethereal.lib \
420 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
421 wsock32.lib user32.lib \
422 wiretap\wiretap-$(WTAP_VERSION).lib \
423 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
424 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib
426 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
428 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib \
429 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
431 EXECUTABLES=ethereal.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe
433 RESOURCES=image\ethereal.res image\tethereal.res image\editcap.res image\mergecap.res image\text2pcap.res
435 all: tools wiretap gtk epan image $(EXECUTABLES) $(RESOURCES)
439 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
441 ethereal.exe : config.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
444 /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
447 tethereal.exe : config.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
450 /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) image\tethereal.res
453 editcap.exe : config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
456 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS) image\editcap.res
459 mergecap.exe : config.h mergecap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
462 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
465 text2pcap.exe : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
468 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
471 dftest.exe : $(dftest_OBJECTS) $(EXTRA_OBJECTS)
473 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS) $(EXTRA_OBJECTS)
476 randpkt.exe : $(randpkt_OBJECTS) $(EXTRA_OBJECTS)
478 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
481 config.h : config.h.win32
482 sed -e s/@VERSION@/$(VERSION)/ < config.h.win32 > $@
484 ps.c : rdps.exe print.ps
488 # The header files listed here are built from x11-fields using Perl;
489 # we declare a dependency here so that they get built.
491 packet-x11.obj : packet-x11.c x11-declarations.h x11-register-info.h
494 # Build various header files for the X11 dissector.
496 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
497 $(PERL) process-x11-fields.pl <x11-fields
499 packet-ncp2222.c : ncp2222.py
501 @echo Making packet-ncp2222.c
502 $(PYTHON) ncp2222.py -o packet-ncp2222.c
504 @echo Faking packet-ncp2222.c...
505 @echo Python is required to build the NCP disector
506 @echo Hiding packet-ncp.c...
507 mv packet-ncp.c packet-ncp.c.save
508 touch packet-ncp.c $@
512 # Build "register.c", which contains a function "register_all_protocols()"
513 # that calls the register routines for all protocols.
515 # We do this by grepping through sources. If that turns out to be too slow,
516 # maybe we could just require every .o file to have an register routine
517 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
519 # Formatting conventions: The name of the proto_register_* routines must
520 # start in column zero, or must be preceded only by "void " starting in
521 # column zero, and must not be inside #if.
523 # We assume that all dissector routines are in "packet-XXX.c" files.
525 # For some unknown reason, having a big "for" loop in the Makefile
526 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
527 # they seem to pass only the first few names in the list to the shell,
530 # Therefore, we have a script to generate the "register.c" file.
532 # The first argument is the name of the file to write.
533 # The second argument is the directory in which the source files live.
534 # All subsequent arguments are the files to scan.
536 # On Windows, however, that script runs slowly, as multiple greps
537 # and seds are run for each input file, so, if Python is present
538 # (as indicated by PYTHON being defined), we run a faster Python
539 # script to do that work instead. That script doesn't take the name
540 # of the file to write as an argument; it always writes to
543 register.c: $(DISSECTOR_SRC)
545 @echo Making register.c (using python)
546 @$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
548 @echo Making register.c (using sh)
549 @$(SH) make-reg-dotc register.c . $(DISSECTOR_SRC)
553 # Build "tethereal-tap-register.c", which contains a function
554 # "register_all_tap_listeners()"
555 # that calls the register routines for all tehtereal tap listeners.
557 # We do this by grepping through sources.
559 # Formatting conventions: The name of the tap_listener_register_*
560 # routines must start in column zero, or must be preceded only by
561 # "void " starting in column zero, and must not be inside #if.
563 # The first argument is the name of the file to write.
564 # The second argument is the directory in which the source files live.
565 # All subsequent arguments are the files to scan.
567 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC)
568 @echo Making tethereal-tap-register.c
569 @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
571 text2pcap-scanner.c : text2pcap-scanner.l
572 $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
575 rm -f $(ethereal_OBJECTS) $(EXTRA_OBJECTS) $(EXECUTABLES) $(PDB_FILE) \
576 tethereal.obj editcap.obj mergecap.obj text2pcap.obj \
577 text2pcap-scanner.obj text2pcap-scanner.c register.c \
578 rdps.obj rdps.pdb config.h ps.c \
579 rdps.exe rdps.ilk dftest.obj dftest.exe randpkt.obj randpkt.ext \
582 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
584 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
586 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
588 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
590 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
592 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
594 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
596 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
599 # Call distclean only, if you would like to remove ALL generated files.
600 # Be sure to have python and perl installed to regenerate them.
602 rm -f x11-declarations.h x11-register-info.h packet-ncp2222.c
606 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
611 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
616 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
621 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
626 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
631 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake