1 ## Makefile for building ethereal.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
4 # $Id: Makefile.nmake,v 1.345 2003/10/10 09:48:54 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 $<
72 packet-dcerpc-afs4int.c \
73 packet-dcerpc-atsvc.c \
74 packet-dcerpc-bossvr.c \
75 packet-dcerpc-browser.c \
76 packet-dcerpc-cds_clerkserver.c \
77 packet-dcerpc-cds_solicit.c \
78 packet-dcerpc-conv.c \
79 packet-dcerpc-cprpc_server.c \
80 packet-dcerpc-dce122.c \
82 packet-dcerpc-dnsserver.c \
83 packet-dcerpc-drsuapi.c \
84 packet-dcerpc-dtsprovider.c \
85 packet-dcerpc-dtsstime_req.c \
87 packet-dcerpc-fldb.c \
88 packet-dcerpc-ftserver.c \
89 packet-dcerpc-krb5rpc.c \
91 packet-dcerpc-lsa-ds.c \
92 packet-dcerpc-mapi.c \
93 packet-dcerpc-messenger.c \
94 packet-dcerpc-mgmt.c \
96 packet-dcerpc-netlogon.c \
97 packet-dcerpc-nspi.c \
98 packet-dcerpc-oxid.c \
100 packet-dcerpc-remact.c \
101 packet-dcerpc-rep_proc.c \
102 packet-dcerpc-roverride.c \
103 packet-dcerpc-rpriv.c \
104 packet-dcerpc-rs_acct.c \
105 packet-dcerpc-rs_attr.c \
106 packet-dcerpc-rs_misc.c \
107 packet-dcerpc-rs_pgo.c \
108 packet-dcerpc-rs_repadm.c \
109 packet-dcerpc-rs_replist.c \
110 packet-dcerpc-rs_unix.c \
111 packet-dcerpc-rsec_login.c \
112 packet-dcerpc-samr.c \
113 packet-dcerpc-secidmap.c \
114 packet-dcerpc-spoolss.c \
115 packet-dcerpc-srvsvc.c \
116 packet-dcerpc-svcctl.c \
117 packet-dcerpc-tapi.c \
118 packet-dcerpc-tkn4int.c \
119 packet-dcerpc-ubikdisk.c \
120 packet-dcerpc-ubikvote.c \
121 packet-dcerpc-update.c \
122 packet-dcerpc-wkssvc.c \
204 packet-isis-hello.c \
241 packet-msn-messenger.c \
269 packet-osi-options.c \
289 packet-quakeworld.c \
308 packet-rtp-events.c \
325 packet-slowprotocols.c \
327 packet-smb-browse.c \
328 packet-smb-common.c \
330 packet-smb-mailslot.c \
332 packet-smb-sidsnooping.c \
346 packet-stat-notify.c \
377 packet-wfleet-hdlc.c \
397 DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
399 TETHEREAL_TAP_SRC = \
407 tap-protohierstat.c \
414 TETHEREAL_TAP_OBJECTS = $(TETHEREAL_TAP_SRC:.c=.obj)
416 ETHEREAL_COMMON_OBJECTS = \
420 capture_stop_conditions.obj \
430 disabled_protos.obj \
436 packet-dcerpc-nt.obj \
453 $(DISSECTOR_OBJECTS) \
454 $(ETHEREAL_COMMON_OBJECTS) \
458 proto_hier_stats.obj \
461 tethereal_OBJECTS = \
462 $(DISSECTOR_OBJECTS) \
463 $(ETHEREAL_COMMON_OBJECTS) \
464 $(TETHEREAL_TAP_OBJECTS) \
465 tethereal-tap-register.obj \
469 $(DISSECTOR_OBJECTS) \
470 $(ETHEREAL_COMMON_OBJECTS) \
482 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
483 gtk\libui.lib epan\ethereal.lib \
484 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
485 wsock32.lib user32.lib \
488 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
489 # $(PCAP_DIR)\lib\wpcap.lib
491 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
493 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
494 wsock32.lib user32.lib \
497 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
499 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
500 wsock32.lib user32.lib \
503 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
504 wsock32.lib user32.lib \
507 dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib epan\ethereal.lib \
508 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
509 wsock32.lib user32.lib \
510 wiretap\wiretap-$(WTAP_VERSION).lib \
513 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
516 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
518 EXECUTABLES=ethereal.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe
520 RESOURCES=image\ethereal.res image\tethereal.res image\editcap.res image\mergecap.res image\text2pcap.res
522 all: tools wiretap gtk epan image $(EXECUTABLES) $(RESOURCES)
526 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
528 ethereal.exe : config.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
531 /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
534 tethereal.exe : config.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
537 /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) image\tethereal.res
540 editcap.exe : config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
543 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS) image\editcap.res
546 mergecap.exe : config.h mergecap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
549 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
552 text2pcap.exe : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
555 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
558 dftest.exe : $(dftest_OBJECTS) $(EXTRA_OBJECTS)
560 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS) $(EXTRA_OBJECTS)
563 randpkt.exe : $(randpkt_OBJECTS) $(EXTRA_OBJECTS)
565 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
568 config.h : config.h.win32 config.nmake
569 sed -e s/@VERSION@/$(VERSION)/ \
570 -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
571 -e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
572 -e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
573 -e "s/@WPCAP_CONSTIFIED@/$(WPCAP_CONSTIFIED_CONFIG)/" \
574 < config.h.win32 > $@
576 ps.c : rdps.exe print.ps
580 # The header files listed here are built from x11-fields using Perl;
581 # we declare a dependency here so that they get built.
583 packet-x11.obj : packet-x11.c x11-declarations.h x11-register-info.h
586 # Build various header files for the X11 dissector.
588 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
589 $(PERL) process-x11-fields.pl <x11-fields
591 packet-ncp2222.c : ncp2222.py
593 @echo Making packet-ncp2222.c
594 $(PYTHON) ncp2222.py -o packet-ncp2222.c
596 @echo Faking packet-ncp2222.c...
597 @echo Python is required to build the NCP disector
598 @echo Hiding packet-ncp.c...
599 mv packet-ncp.c packet-ncp.c.save
600 touch packet-ncp.c $@
604 # Build "register.c", which contains a function "register_all_protocols()"
605 # that calls the register routines for all protocols.
607 # We do this by grepping through sources. If that turns out to be too slow,
608 # maybe we could just require every .o file to have an register routine
609 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
611 # Formatting conventions: The name of the proto_register_* routines must
612 # start in column zero, or must be preceded only by "void " starting in
613 # column zero, and must not be inside #if.
615 # We assume that all dissector routines are in "packet-XXX.c" files.
617 # For some unknown reason, having a big "for" loop in the Makefile
618 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
619 # they seem to pass only the first few names in the list to the shell,
622 # Therefore, we have a script to generate the "register.c" file.
624 # The first argument is the name of the file to write.
625 # The second argument is the directory in which the source files live.
626 # All subsequent arguments are the files to scan.
628 # On Windows, however, that script runs slowly, as multiple greps
629 # and seds are run for each input file, so, if Python is present
630 # (as indicated by PYTHON being defined), we run a faster Python
631 # script to do that work instead. That script doesn't take the name
632 # of the file to write as an argument; it always writes to
635 register.c: $(DISSECTOR_SRC)
637 @echo Making register.c (using python)
638 @$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
640 @echo Making register.c (using sh)
641 @$(SH) make-reg-dotc register.c . $(DISSECTOR_SRC)
645 # Build "tethereal-tap-register.c", which contains a function
646 # "register_all_tap_listeners()"
647 # that calls the register routines for all tehtereal tap listeners.
649 # We do this by grepping through sources.
651 # Formatting conventions: The name of the tap_listener_register_*
652 # routines must start in column zero, or must be preceded only by
653 # "void " starting in column zero, and must not be inside #if.
655 # The first argument is the name of the file to write.
656 # The second argument is the directory in which the source files live.
657 # All subsequent arguments are the files to scan.
659 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
660 @echo Making tethereal-tap-register.c
661 @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
663 text2pcap-scanner.c : text2pcap-scanner.l
664 $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
667 rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
668 $(EXECUTABLES) $(PDB_FILE) \
669 editcap.obj mergecap.obj text2pcap.obj \
670 text2pcap-scanner.obj text2pcap-scanner.c register.c \
671 rdps.obj rdps.pdb config.h ps.c \
672 rdps.exe rdps.ilk dftest.obj dftest.exe randpkt.obj randpkt.ext \
675 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
677 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
679 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
681 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
683 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
685 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
687 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
689 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
692 # Call distclean only, if you would like to remove ALL generated files.
693 # Be sure to have python and perl installed to regenerate them.
695 rm -f x11-declarations.h x11-register-info.h packet-ncp2222.c
699 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
704 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
709 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
714 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
719 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
724 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake