1 ## Makefile for building ethereal.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
4 # $Id: Makefile.nmake,v 1.385 2004/01/10 04:09:14 guy 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) $(GTK_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 $<
77 packet-dcerpc-afs4int.c \
78 packet-dcerpc-atsvc.c \
79 packet-dcerpc-bossvr.c \
80 packet-dcerpc-browser.c \
81 packet-dcerpc-budb.c \
82 packet-dcerpc-butc.c \
83 packet-dcerpc-cds_clerkserver.c \
84 packet-dcerpc-cds_solicit.c \
85 packet-dcerpc-conv.c \
86 packet-dcerpc-cprpc_server.c \
87 packet-dcerpc-dce122.c \
89 packet-dcerpc-dnsserver.c \
90 packet-dcerpc-drsuapi.c \
91 packet-dcerpc-dtsprovider.c \
92 packet-dcerpc-dtsstime_req.c \
94 packet-dcerpc-epm4.c \
95 packet-dcerpc-fldb.c \
96 packet-dcerpc-ftserver.c \
97 packet-dcerpc-icl_rpc.c \
98 packet-dcerpc-initshutdown.c \
99 packet-dcerpc-krb5rpc.c \
100 packet-dcerpc-lsa.c \
101 packet-dcerpc-lsa-ds.c \
102 packet-dcerpc-mapi.c \
103 packet-dcerpc-messenger.c \
104 packet-dcerpc-mgmt.c \
105 packet-dcerpc-ndr.c \
106 packet-dcerpc-netlogon.c \
107 packet-dcerpc-nspi.c \
108 packet-dcerpc-oxid.c \
109 packet-dcerpc-reg.c \
110 packet-dcerpc-remact.c \
111 packet-dcerpc-rep_proc.c \
112 packet-dcerpc-roverride.c \
113 packet-dcerpc-rpriv.c \
114 packet-dcerpc-rs_acct.c \
115 packet-dcerpc-rs_attr.c \
116 packet-dcerpc-rs_bind.c \
117 packet-dcerpc-rs_misc.c \
118 packet-dcerpc-rs_plcy.c \
119 packet-dcerpc-rs_pgo.c \
120 packet-dcerpc-rs_prop_acct.c \
121 packet-dcerpc-rs_repadm.c \
122 packet-dcerpc-rs_replist.c \
123 packet-dcerpc-rs_unix.c \
124 packet-dcerpc-rsec_login.c \
125 packet-dcerpc-samr.c \
126 packet-dcerpc-secidmap.c \
127 packet-dcerpc-spoolss.c \
128 packet-dcerpc-srvsvc.c \
129 packet-dcerpc-svcctl.c \
130 packet-dcerpc-tapi.c \
131 packet-dcerpc-tkn4int.c \
132 packet-dcerpc-trksvr.c \
133 packet-dcerpc-ubikdisk.c \
134 packet-dcerpc-ubikvote.c \
135 packet-dcerpc-update.c \
136 packet-dcerpc-wkssvc.c \
141 packet-diffserv-mpls-common.c \
210 packet-image-jfif.c \
227 packet-isis-hello.c \
266 packet-msn-messenger.c \
295 packet-osi-options.c \
315 packet-quakeworld.c \
334 packet-rtp-events.c \
353 packet-slowprotocols.c \
355 packet-smb-browse.c \
356 packet-smb-common.c \
358 packet-smb-mailslot.c \
360 packet-smb-sidsnooping.c \
374 packet-stat-notify.c \
385 packet-text-media.c \
406 packet-wfleet-hdlc.c \
426 DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
428 TETHEREAL_TAP_SRC = \
440 tap-protohierstat.c \
447 TETHEREAL_TAP_OBJECTS = $(TETHEREAL_TAP_SRC:.c=.obj)
449 DISSECTOR_HELPER_OBJECTS = \
459 h225-persistentdata.obj \
462 packet-dcerpc-nt.obj \
469 ETHEREAL_COMMON_OBJECTS = \
470 $(DISSECTOR_HELPER_OBJECTS) \
471 capture_stop_conditions.obj \
476 disabled_protos.obj \
492 $(DISSECTOR_OBJECTS) \
493 $(ETHEREAL_COMMON_OBJECTS) \
497 proto_hier_stats.obj \
500 tethereal_OBJECTS = \
501 $(DISSECTOR_OBJECTS) \
502 $(ETHEREAL_COMMON_OBJECTS) \
503 $(TETHEREAL_TAP_OBJECTS) \
504 tethereal-tap-register.obj \
508 $(DISSECTOR_OBJECTS) \
509 $(ETHEREAL_COMMON_OBJECTS) \
521 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
522 gtk\libui.lib epan\ethereal.lib \
523 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
524 wsock32.lib user32.lib \
528 $(NET_SNMP_DIR)\win32\lib\netsnmp.lib
529 # $(PCAP_DIR)\lib\wpcap.lib
531 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
533 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
534 wsock32.lib user32.lib \
538 $(NET_SNMP_DIR)\win32\lib\netsnmp.lib
540 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
541 wsock32.lib user32.lib \
544 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
545 wsock32.lib user32.lib \
548 dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib epan\ethereal.lib \
549 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
550 wsock32.lib user32.lib \
551 wiretap\wiretap-$(WTAP_VERSION).lib \
554 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
557 $(NET_SNMP_DIR)\win32\lib\netsnmp.lib
559 EXECUTABLES=ethereal.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe
561 RESOURCES=image\ethereal.res image\tethereal.res image\editcap.res image\mergecap.res image\text2pcap.res
563 all: tools wiretap gtk epan image $(EXECUTABLES) $(RESOURCES) doc
567 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
569 ethereal.exe : config.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
572 /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
575 tethereal.exe : config.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
578 /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) image\tethereal.res
581 editcap.exe : config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
584 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS) image\editcap.res
587 mergecap.exe : config.h mergecap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
590 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
593 text2pcap.exe : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
596 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
599 dftest.exe : $(dftest_OBJECTS) $(EXTRA_OBJECTS)
601 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS) $(EXTRA_OBJECTS)
604 randpkt.exe : $(randpkt_OBJECTS) $(EXTRA_OBJECTS)
606 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
609 config.h : config.h.win32 config.nmake
610 sed -e s/@VERSION@/$(VERSION)/ \
611 -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
612 -e "s/@HAVE_PCRE@/$(PCRE_CONFIG)/" \
613 -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
614 -e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
615 -e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
616 -e "s/@WPCAP_CONSTIFIED@/$(WPCAP_CONSTIFIED_CONFIG)/" \
617 < config.h.win32 > $@
619 ps.c : rdps.exe print.ps
623 # The header files listed here are built from x11-fields using Perl;
624 # we declare a dependency here so that they get built.
626 packet-x11.obj : packet-x11.c x11-declarations.h x11-register-info.h
629 # Build various header files for the X11 dissector.
631 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
632 $(PERL) process-x11-fields.pl <x11-fields
634 packet-ncp2222.c : ncp2222.py
636 @echo Making packet-ncp2222.c
637 $(PYTHON) ncp2222.py -o packet-ncp2222.c
639 @echo Faking packet-ncp2222.c...
640 @echo Python is required to build the NCP disector
641 @echo Hiding packet-ncp.c...
642 mv packet-ncp.c packet-ncp.c.save
643 touch packet-ncp.c $@
647 # Build "register.c", which contains a function "register_all_protocols()"
648 # that calls the register routines for all protocols.
650 # We do this by grepping through sources. If that turns out to be too slow,
651 # maybe we could just require every .o file to have an register routine
652 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
654 # Formatting conventions: The name of the proto_register_* routines must
655 # start in column zero, or must be preceded only by "void " starting in
656 # column zero, and must not be inside #if.
658 # We assume that all dissector routines are in "packet-XXX.c" files.
660 # For some unknown reason, having a big "for" loop in the Makefile
661 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
662 # they seem to pass only the first few names in the list to the shell,
665 # Therefore, we have a script to generate the "register.c" file.
667 # The first argument is the name of the file to write.
668 # The second argument is the directory in which the source files live.
669 # All subsequent arguments are the files to scan.
671 # On Windows, however, that script runs slowly, as multiple greps
672 # and seds are run for each input file, so, if Python is present
673 # (as indicated by PYTHON being defined), we run a faster Python
674 # script to do that work instead. That script doesn't take the name
675 # of the file to write as an argument; it always writes to
678 register.c: $(DISSECTOR_SRC)
680 @echo Making register.c (using python)
681 @$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
683 @echo Making register.c (using sh)
684 @$(SH) make-reg-dotc register.c . $(DISSECTOR_SRC)
688 # Build "tethereal-tap-register.c", which contains a function
689 # "register_all_tap_listeners()"
690 # that calls the register routines for all tehtereal tap listeners.
692 # We do this by grepping through sources.
694 # Formatting conventions: The name of the tap_listener_register_*
695 # routines must start in column zero, or must be preceded only by
696 # "void " starting in column zero, and must not be inside #if.
698 # The first argument is the name of the file to write.
699 # The second argument is the directory in which the source files live.
700 # All subsequent arguments are the files to scan.
702 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
703 @echo Making tethereal-tap-register.c
704 @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
706 text2pcap-scanner.c : text2pcap-scanner.l
707 $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
710 rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
711 $(EXECUTABLES) $(PDB_FILE) \
712 editcap.obj mergecap.obj text2pcap.obj \
713 text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
714 rdps.pdb config.h ps.c \
715 rdps.exe rdps.ilk dftest.obj dftest.exe randpkt.obj randpkt.ext \
718 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
720 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
722 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
724 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
726 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
728 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
730 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
732 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
734 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
737 # Call distclean only, if you would like to remove ALL generated files.
738 # Be sure to have python and perl installed to regenerate them.
740 rm -f x11-declarations.h x11-register-info.h packet-ncp2222.c \
741 register.c tethereal-tap-register.c
743 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
745 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
747 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
749 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
751 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
753 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
755 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
757 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
759 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
764 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
769 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
774 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
779 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
784 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
789 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
794 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
799 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake