1 ## Makefile for building ethereal.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
4 # $Id: Makefile.nmake,v 1.352 2003/10/28 00:31:15 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 /I$(ZLIB_DIR) /I$(PCAP_DIR)\include \
18 /I$(NET_SNMP_DIR)\include /I$(NET_SNMP_DIR)\win32 \
19 $(ADNS_CFLAGS) -D_U_=""
21 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
24 $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
74 packet-dcerpc-afs4int.c \
75 packet-dcerpc-atsvc.c \
76 packet-dcerpc-bossvr.c \
77 packet-dcerpc-browser.c \
78 packet-dcerpc-butc.c \
79 packet-dcerpc-cds_clerkserver.c \
80 packet-dcerpc-cds_solicit.c \
81 packet-dcerpc-conv.c \
82 packet-dcerpc-cprpc_server.c \
83 packet-dcerpc-dce122.c \
85 packet-dcerpc-dnsserver.c \
86 packet-dcerpc-drsuapi.c \
87 packet-dcerpc-dtsprovider.c \
88 packet-dcerpc-dtsstime_req.c \
90 packet-dcerpc-fldb.c \
91 packet-dcerpc-ftserver.c \
92 packet-dcerpc-initshutdown.c \
93 packet-dcerpc-krb5rpc.c \
95 packet-dcerpc-lsa-ds.c \
96 packet-dcerpc-mapi.c \
97 packet-dcerpc-messenger.c \
98 packet-dcerpc-mgmt.c \
100 packet-dcerpc-netlogon.c \
101 packet-dcerpc-nspi.c \
102 packet-dcerpc-oxid.c \
103 packet-dcerpc-reg.c \
104 packet-dcerpc-remact.c \
105 packet-dcerpc-rep_proc.c \
106 packet-dcerpc-roverride.c \
107 packet-dcerpc-rpriv.c \
108 packet-dcerpc-rs_acct.c \
109 packet-dcerpc-rs_attr.c \
110 packet-dcerpc-rs_bind.c \
111 packet-dcerpc-rs_misc.c \
112 packet-dcerpc-rs_pgo.c \
113 packet-dcerpc-rs_repadm.c \
114 packet-dcerpc-rs_replist.c \
115 packet-dcerpc-rs_unix.c \
116 packet-dcerpc-rsec_login.c \
117 packet-dcerpc-samr.c \
118 packet-dcerpc-secidmap.c \
119 packet-dcerpc-spoolss.c \
120 packet-dcerpc-srvsvc.c \
121 packet-dcerpc-svcctl.c \
122 packet-dcerpc-tapi.c \
123 packet-dcerpc-tkn4int.c \
124 packet-dcerpc-ubikdisk.c \
125 packet-dcerpc-ubikvote.c \
126 packet-dcerpc-update.c \
127 packet-dcerpc-wkssvc.c \
132 packet-diffserv-mpls-common.c \
210 packet-isis-hello.c \
247 packet-msn-messenger.c \
275 packet-osi-options.c \
295 packet-quakeworld.c \
314 packet-rtp-events.c \
331 packet-slowprotocols.c \
333 packet-smb-browse.c \
334 packet-smb-common.c \
336 packet-smb-mailslot.c \
338 packet-smb-sidsnooping.c \
352 packet-stat-notify.c \
383 packet-wfleet-hdlc.c \
403 DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
405 TETHEREAL_TAP_SRC = \
414 tap-protohierstat.c \
421 TETHEREAL_TAP_OBJECTS = $(TETHEREAL_TAP_SRC:.c=.obj)
423 ETHEREAL_COMMON_OBJECTS = \
427 capture_stop_conditions.obj \
437 disabled_protos.obj \
443 packet-dcerpc-nt.obj \
460 $(DISSECTOR_OBJECTS) \
461 $(ETHEREAL_COMMON_OBJECTS) \
465 proto_hier_stats.obj \
468 tethereal_OBJECTS = \
469 $(DISSECTOR_OBJECTS) \
470 $(ETHEREAL_COMMON_OBJECTS) \
471 $(TETHEREAL_TAP_OBJECTS) \
472 tethereal-tap-register.obj \
476 $(DISSECTOR_OBJECTS) \
477 $(ETHEREAL_COMMON_OBJECTS) \
489 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
490 gtk\libui.lib epan\ethereal.lib \
491 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
492 wsock32.lib user32.lib \
495 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
496 # $(PCAP_DIR)\lib\wpcap.lib
498 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
500 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
501 wsock32.lib user32.lib \
504 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
506 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
507 wsock32.lib user32.lib \
510 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
511 wsock32.lib user32.lib \
514 dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib epan\ethereal.lib \
515 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
516 wsock32.lib user32.lib \
517 wiretap\wiretap-$(WTAP_VERSION).lib \
520 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
523 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
525 EXECUTABLES=ethereal.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe
527 RESOURCES=image\ethereal.res image\tethereal.res image\editcap.res image\mergecap.res image\text2pcap.res
529 all: tools wiretap gtk epan image $(EXECUTABLES) $(RESOURCES)
533 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
535 ethereal.exe : config.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
538 /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
541 tethereal.exe : config.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
544 /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) image\tethereal.res
547 editcap.exe : config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
550 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS) image\editcap.res
553 mergecap.exe : config.h mergecap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
556 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
559 text2pcap.exe : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
562 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
565 dftest.exe : $(dftest_OBJECTS) $(EXTRA_OBJECTS)
567 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS) $(EXTRA_OBJECTS)
570 randpkt.exe : $(randpkt_OBJECTS) $(EXTRA_OBJECTS)
572 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
575 config.h : config.h.win32 config.nmake
576 sed -e s/@VERSION@/$(VERSION)/ \
577 -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
578 -e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
579 -e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
580 -e "s/@WPCAP_CONSTIFIED@/$(WPCAP_CONSTIFIED_CONFIG)/" \
581 < config.h.win32 > $@
583 ps.c : rdps.exe print.ps
587 # The header files listed here are built from x11-fields using Perl;
588 # we declare a dependency here so that they get built.
590 packet-x11.obj : packet-x11.c x11-declarations.h x11-register-info.h
593 # Build various header files for the X11 dissector.
595 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
596 $(PERL) process-x11-fields.pl <x11-fields
598 packet-ncp2222.c : ncp2222.py
600 @echo Making packet-ncp2222.c
601 $(PYTHON) ncp2222.py -o packet-ncp2222.c
603 @echo Faking packet-ncp2222.c...
604 @echo Python is required to build the NCP disector
605 @echo Hiding packet-ncp.c...
606 mv packet-ncp.c packet-ncp.c.save
607 touch packet-ncp.c $@
611 # Build "register.c", which contains a function "register_all_protocols()"
612 # that calls the register routines for all protocols.
614 # We do this by grepping through sources. If that turns out to be too slow,
615 # maybe we could just require every .o file to have an register routine
616 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
618 # Formatting conventions: The name of the proto_register_* routines must
619 # start in column zero, or must be preceded only by "void " starting in
620 # column zero, and must not be inside #if.
622 # We assume that all dissector routines are in "packet-XXX.c" files.
624 # For some unknown reason, having a big "for" loop in the Makefile
625 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
626 # they seem to pass only the first few names in the list to the shell,
629 # Therefore, we have a script to generate the "register.c" file.
631 # The first argument is the name of the file to write.
632 # The second argument is the directory in which the source files live.
633 # All subsequent arguments are the files to scan.
635 # On Windows, however, that script runs slowly, as multiple greps
636 # and seds are run for each input file, so, if Python is present
637 # (as indicated by PYTHON being defined), we run a faster Python
638 # script to do that work instead. That script doesn't take the name
639 # of the file to write as an argument; it always writes to
642 register.c: $(DISSECTOR_SRC)
644 @echo Making register.c (using python)
645 @$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
647 @echo Making register.c (using sh)
648 @$(SH) make-reg-dotc register.c . $(DISSECTOR_SRC)
652 # Build "tethereal-tap-register.c", which contains a function
653 # "register_all_tap_listeners()"
654 # that calls the register routines for all tehtereal tap listeners.
656 # We do this by grepping through sources.
658 # Formatting conventions: The name of the tap_listener_register_*
659 # routines must start in column zero, or must be preceded only by
660 # "void " starting in column zero, and must not be inside #if.
662 # The first argument is the name of the file to write.
663 # The second argument is the directory in which the source files live.
664 # All subsequent arguments are the files to scan.
666 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
667 @echo Making tethereal-tap-register.c
668 @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
670 text2pcap-scanner.c : text2pcap-scanner.l
671 $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
674 rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
675 $(EXECUTABLES) $(PDB_FILE) \
676 editcap.obj mergecap.obj text2pcap.obj \
677 text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
678 rdps.pdb config.h ps.c \
679 rdps.exe rdps.ilk dftest.obj dftest.exe randpkt.obj randpkt.ext \
682 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
684 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
686 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
688 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
690 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
692 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
694 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
696 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
699 # Call distclean only, if you would like to remove ALL generated files.
700 # Be sure to have python and perl installed to regenerate them.
702 rm -f x11-declarations.h x11-register-info.h packet-ncp2222.c \
703 register.c tethereal-tap-register.c
705 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
707 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
709 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
711 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
713 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
715 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
717 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
719 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
724 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
729 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
734 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
739 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
744 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
749 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake