1 ## Makefile for building ethereal.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
4 # $Id: Makefile.nmake,v 1.375 2003/12/15 04:22:30 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-ubikdisk.c \
133 packet-dcerpc-ubikvote.c \
134 packet-dcerpc-update.c \
135 packet-dcerpc-wkssvc.c \
140 packet-diffserv-mpls-common.c \
224 packet-isis-hello.c \
262 packet-msn-messenger.c \
291 packet-osi-options.c \
311 packet-quakeworld.c \
330 packet-rtp-events.c \
349 packet-slowprotocols.c \
351 packet-smb-browse.c \
352 packet-smb-common.c \
354 packet-smb-mailslot.c \
356 packet-smb-sidsnooping.c \
370 packet-stat-notify.c \
401 packet-wfleet-hdlc.c \
421 DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
423 TETHEREAL_TAP_SRC = \
435 tap-protohierstat.c \
442 TETHEREAL_TAP_OBJECTS = $(TETHEREAL_TAP_SRC:.c=.obj)
444 ETHEREAL_COMMON_OBJECTS = \
448 capture_stop_conditions.obj \
458 disabled_protos.obj \
462 h225-persistentdata.obj \
465 packet-dcerpc-nt.obj \
482 $(DISSECTOR_OBJECTS) \
483 $(ETHEREAL_COMMON_OBJECTS) \
487 proto_hier_stats.obj \
490 tethereal_OBJECTS = \
491 $(DISSECTOR_OBJECTS) \
492 $(ETHEREAL_COMMON_OBJECTS) \
493 $(TETHEREAL_TAP_OBJECTS) \
494 tethereal-tap-register.obj \
498 $(DISSECTOR_OBJECTS) \
499 $(ETHEREAL_COMMON_OBJECTS) \
511 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
512 gtk\libui.lib epan\ethereal.lib \
513 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
514 wsock32.lib user32.lib \
518 $(NET_SNMP_DIR)\win32\lib\netsnmp.lib
519 # $(PCAP_DIR)\lib\wpcap.lib
521 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
523 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
524 wsock32.lib user32.lib \
528 $(NET_SNMP_DIR)\win32\lib\netsnmp.lib
530 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
531 wsock32.lib user32.lib \
534 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
535 wsock32.lib user32.lib \
538 dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib epan\ethereal.lib \
539 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
540 wsock32.lib user32.lib \
541 wiretap\wiretap-$(WTAP_VERSION).lib \
544 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
547 $(NET_SNMP_DIR)\win32\lib\netsnmp.lib
549 EXECUTABLES=ethereal.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe
551 RESOURCES=image\ethereal.res image\tethereal.res image\editcap.res image\mergecap.res image\text2pcap.res
553 all: tools wiretap gtk epan image $(EXECUTABLES) $(RESOURCES) doc
557 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
559 ethereal.exe : config.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
562 /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
565 tethereal.exe : config.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
568 /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) image\tethereal.res
571 editcap.exe : config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
574 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS) image\editcap.res
577 mergecap.exe : config.h mergecap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
580 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
583 text2pcap.exe : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
586 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
589 dftest.exe : $(dftest_OBJECTS) $(EXTRA_OBJECTS)
591 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS) $(EXTRA_OBJECTS)
594 randpkt.exe : $(randpkt_OBJECTS) $(EXTRA_OBJECTS)
596 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
599 config.h : config.h.win32 config.nmake
600 sed -e s/@VERSION@/$(VERSION)/ \
601 -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
602 -e "s/@HAVE_PCRE@/$(PCRE_CONFIG)/" \
603 -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
604 -e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
605 -e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
606 -e "s/@WPCAP_CONSTIFIED@/$(WPCAP_CONSTIFIED_CONFIG)/" \
607 < config.h.win32 > $@
609 ps.c : rdps.exe print.ps
613 # The header files listed here are built from x11-fields using Perl;
614 # we declare a dependency here so that they get built.
616 packet-x11.obj : packet-x11.c x11-declarations.h x11-register-info.h
619 # Build various header files for the X11 dissector.
621 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
622 $(PERL) process-x11-fields.pl <x11-fields
624 packet-ncp2222.c : ncp2222.py
626 @echo Making packet-ncp2222.c
627 $(PYTHON) ncp2222.py -o packet-ncp2222.c
629 @echo Faking packet-ncp2222.c...
630 @echo Python is required to build the NCP disector
631 @echo Hiding packet-ncp.c...
632 mv packet-ncp.c packet-ncp.c.save
633 touch packet-ncp.c $@
637 # Build "register.c", which contains a function "register_all_protocols()"
638 # that calls the register routines for all protocols.
640 # We do this by grepping through sources. If that turns out to be too slow,
641 # maybe we could just require every .o file to have an register routine
642 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
644 # Formatting conventions: The name of the proto_register_* routines must
645 # start in column zero, or must be preceded only by "void " starting in
646 # column zero, and must not be inside #if.
648 # We assume that all dissector routines are in "packet-XXX.c" files.
650 # For some unknown reason, having a big "for" loop in the Makefile
651 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
652 # they seem to pass only the first few names in the list to the shell,
655 # Therefore, we have a script to generate the "register.c" file.
657 # The first argument is the name of the file to write.
658 # The second argument is the directory in which the source files live.
659 # All subsequent arguments are the files to scan.
661 # On Windows, however, that script runs slowly, as multiple greps
662 # and seds are run for each input file, so, if Python is present
663 # (as indicated by PYTHON being defined), we run a faster Python
664 # script to do that work instead. That script doesn't take the name
665 # of the file to write as an argument; it always writes to
668 register.c: $(DISSECTOR_SRC)
670 @echo Making register.c (using python)
671 @$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
673 @echo Making register.c (using sh)
674 @$(SH) make-reg-dotc register.c . $(DISSECTOR_SRC)
678 # Build "tethereal-tap-register.c", which contains a function
679 # "register_all_tap_listeners()"
680 # that calls the register routines for all tehtereal tap listeners.
682 # We do this by grepping through sources.
684 # Formatting conventions: The name of the tap_listener_register_*
685 # routines must start in column zero, or must be preceded only by
686 # "void " starting in column zero, and must not be inside #if.
688 # The first argument is the name of the file to write.
689 # The second argument is the directory in which the source files live.
690 # All subsequent arguments are the files to scan.
692 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
693 @echo Making tethereal-tap-register.c
694 @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
696 text2pcap-scanner.c : text2pcap-scanner.l
697 $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
700 rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
701 $(EXECUTABLES) $(PDB_FILE) \
702 editcap.obj mergecap.obj text2pcap.obj \
703 text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
704 rdps.pdb config.h ps.c \
705 rdps.exe rdps.ilk dftest.obj dftest.exe randpkt.obj randpkt.ext \
708 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
710 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
712 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
714 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
716 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
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
727 # Call distclean only, if you would like to remove ALL generated files.
728 # Be sure to have python and perl installed to regenerate them.
730 rm -f x11-declarations.h x11-register-info.h packet-ncp2222.c \
731 register.c tethereal-tap-register.c
733 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
735 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
737 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
739 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
741 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
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
754 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
759 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
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