1 ## Makefile for building ethereal.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
4 # $Id: Makefile.nmake,v 1.354 2003/10/30 02:06:11 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 \
212 packet-isis-hello.c \
249 packet-msn-messenger.c \
278 packet-osi-options.c \
298 packet-quakeworld.c \
317 packet-rtp-events.c \
334 packet-slowprotocols.c \
336 packet-smb-browse.c \
337 packet-smb-common.c \
339 packet-smb-mailslot.c \
341 packet-smb-sidsnooping.c \
355 packet-stat-notify.c \
386 packet-wfleet-hdlc.c \
406 DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
408 TETHEREAL_TAP_SRC = \
417 tap-protohierstat.c \
424 TETHEREAL_TAP_OBJECTS = $(TETHEREAL_TAP_SRC:.c=.obj)
426 ETHEREAL_COMMON_OBJECTS = \
430 capture_stop_conditions.obj \
440 disabled_protos.obj \
446 packet-dcerpc-nt.obj \
463 $(DISSECTOR_OBJECTS) \
464 $(ETHEREAL_COMMON_OBJECTS) \
468 proto_hier_stats.obj \
471 tethereal_OBJECTS = \
472 $(DISSECTOR_OBJECTS) \
473 $(ETHEREAL_COMMON_OBJECTS) \
474 $(TETHEREAL_TAP_OBJECTS) \
475 tethereal-tap-register.obj \
479 $(DISSECTOR_OBJECTS) \
480 $(ETHEREAL_COMMON_OBJECTS) \
492 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
493 gtk\libui.lib epan\ethereal.lib \
494 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
495 wsock32.lib user32.lib \
498 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
499 # $(PCAP_DIR)\lib\wpcap.lib
501 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
503 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
504 wsock32.lib user32.lib \
507 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
509 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
510 wsock32.lib user32.lib \
513 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
514 wsock32.lib user32.lib \
517 dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib epan\ethereal.lib \
518 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
519 wsock32.lib user32.lib \
520 wiretap\wiretap-$(WTAP_VERSION).lib \
523 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
526 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
528 EXECUTABLES=ethereal.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe
530 RESOURCES=image\ethereal.res image\tethereal.res image\editcap.res image\mergecap.res image\text2pcap.res
532 all: tools wiretap gtk epan image $(EXECUTABLES) $(RESOURCES)
536 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
538 ethereal.exe : config.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
541 /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
544 tethereal.exe : config.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
547 /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) image\tethereal.res
550 editcap.exe : config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
553 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS) image\editcap.res
556 mergecap.exe : config.h mergecap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
559 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
562 text2pcap.exe : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
565 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
568 dftest.exe : $(dftest_OBJECTS) $(EXTRA_OBJECTS)
570 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS) $(EXTRA_OBJECTS)
573 randpkt.exe : $(randpkt_OBJECTS) $(EXTRA_OBJECTS)
575 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
578 config.h : config.h.win32 config.nmake
579 sed -e s/@VERSION@/$(VERSION)/ \
580 -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
581 -e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
582 -e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
583 -e "s/@WPCAP_CONSTIFIED@/$(WPCAP_CONSTIFIED_CONFIG)/" \
584 < config.h.win32 > $@
586 ps.c : rdps.exe print.ps
590 # The header files listed here are built from x11-fields using Perl;
591 # we declare a dependency here so that they get built.
593 packet-x11.obj : packet-x11.c x11-declarations.h x11-register-info.h
596 # Build various header files for the X11 dissector.
598 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
599 $(PERL) process-x11-fields.pl <x11-fields
601 packet-ncp2222.c : ncp2222.py
603 @echo Making packet-ncp2222.c
604 $(PYTHON) ncp2222.py -o packet-ncp2222.c
606 @echo Faking packet-ncp2222.c...
607 @echo Python is required to build the NCP disector
608 @echo Hiding packet-ncp.c...
609 mv packet-ncp.c packet-ncp.c.save
610 touch packet-ncp.c $@
614 # Build "register.c", which contains a function "register_all_protocols()"
615 # that calls the register routines for all protocols.
617 # We do this by grepping through sources. If that turns out to be too slow,
618 # maybe we could just require every .o file to have an register routine
619 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
621 # Formatting conventions: The name of the proto_register_* routines must
622 # start in column zero, or must be preceded only by "void " starting in
623 # column zero, and must not be inside #if.
625 # We assume that all dissector routines are in "packet-XXX.c" files.
627 # For some unknown reason, having a big "for" loop in the Makefile
628 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
629 # they seem to pass only the first few names in the list to the shell,
632 # Therefore, we have a script to generate the "register.c" file.
634 # The first argument is the name of the file to write.
635 # The second argument is the directory in which the source files live.
636 # All subsequent arguments are the files to scan.
638 # On Windows, however, that script runs slowly, as multiple greps
639 # and seds are run for each input file, so, if Python is present
640 # (as indicated by PYTHON being defined), we run a faster Python
641 # script to do that work instead. That script doesn't take the name
642 # of the file to write as an argument; it always writes to
645 register.c: $(DISSECTOR_SRC)
647 @echo Making register.c (using python)
648 @$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
650 @echo Making register.c (using sh)
651 @$(SH) make-reg-dotc register.c . $(DISSECTOR_SRC)
655 # Build "tethereal-tap-register.c", which contains a function
656 # "register_all_tap_listeners()"
657 # that calls the register routines for all tehtereal tap listeners.
659 # We do this by grepping through sources.
661 # Formatting conventions: The name of the tap_listener_register_*
662 # routines must start in column zero, or must be preceded only by
663 # "void " starting in column zero, and must not be inside #if.
665 # The first argument is the name of the file to write.
666 # The second argument is the directory in which the source files live.
667 # All subsequent arguments are the files to scan.
669 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
670 @echo Making tethereal-tap-register.c
671 @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
673 text2pcap-scanner.c : text2pcap-scanner.l
674 $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
677 rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
678 $(EXECUTABLES) $(PDB_FILE) \
679 editcap.obj mergecap.obj text2pcap.obj \
680 text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
681 rdps.pdb config.h ps.c \
682 rdps.exe rdps.ilk dftest.obj dftest.exe randpkt.obj randpkt.ext \
685 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
687 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
689 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
691 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
693 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
695 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
697 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
699 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
702 # Call distclean only, if you would like to remove ALL generated files.
703 # Be sure to have python and perl installed to regenerate them.
705 rm -f x11-declarations.h x11-register-info.h packet-ncp2222.c \
706 register.c tethereal-tap-register.c
708 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
710 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
712 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
714 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
716 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
718 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
720 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
722 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
727 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
732 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
737 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
742 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
747 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
752 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake