1 ## Makefile for building ethereal.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
4 # $Id: Makefile.nmake,v 1.341 2003/10/02 06:13:27 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 $<
68 packet-dcerpc-afs4int.c \
69 packet-dcerpc-atsvc.c \
70 packet-dcerpc-bossvr.c \
71 packet-dcerpc-browser.c \
72 packet-dcerpc-cds_clerkserver.c \
73 packet-dcerpc-cds_solicit.c \
74 packet-dcerpc-conv.c \
75 packet-dcerpc-cprpc_server.c \
76 packet-dcerpc-dce122.c \
78 packet-dcerpc-dnsserver.c \
79 packet-dcerpc-drsuapi.c \
80 packet-dcerpc-dtsprovider.c \
81 packet-dcerpc-dtsstime_req.c \
83 packet-dcerpc-fldb.c \
84 packet-dcerpc-ftserver.c \
85 packet-dcerpc-krb5rpc.c \
87 packet-dcerpc-lsa-ds.c \
88 packet-dcerpc-mapi.c \
89 packet-dcerpc-messenger.c \
90 packet-dcerpc-mgmt.c \
92 packet-dcerpc-netlogon.c \
93 packet-dcerpc-nspi.c \
94 packet-dcerpc-oxid.c \
96 packet-dcerpc-remact.c \
97 packet-dcerpc-rep_proc.c \
98 packet-dcerpc-roverride.c \
99 packet-dcerpc-rpriv.c \
100 packet-dcerpc-rs_acct.c \
101 packet-dcerpc-rs_attr.c \
102 packet-dcerpc-rs_misc.c \
103 packet-dcerpc-rs_pgo.c \
104 packet-dcerpc-rs_repadm.c \
105 packet-dcerpc-rs_replist.c \
106 packet-dcerpc-rs_unix.c \
107 packet-dcerpc-rsec_login.c \
108 packet-dcerpc-samr.c \
109 packet-dcerpc-secidmap.c \
110 packet-dcerpc-spoolss.c \
111 packet-dcerpc-srvsvc.c \
112 packet-dcerpc-svcctl.c \
113 packet-dcerpc-tapi.c \
114 packet-dcerpc-tkn4int.c \
115 packet-dcerpc-ubikdisk.c \
116 packet-dcerpc-ubikvote.c \
117 packet-dcerpc-update.c \
118 packet-dcerpc-wkssvc.c \
200 packet-isis-hello.c \
237 packet-msn-messenger.c \
265 packet-osi-options.c \
285 packet-quakeworld.c \
304 packet-rtp-events.c \
321 packet-slowprotocols.c \
323 packet-smb-browse.c \
324 packet-smb-common.c \
326 packet-smb-mailslot.c \
328 packet-smb-sidsnooping.c \
342 packet-stat-notify.c \
373 packet-wfleet-hdlc.c \
393 DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
395 TETHEREAL_TAP_SRC = \
403 tap-protohierstat.c \
410 TETHEREAL_TAP_OBJECTS = $(TETHEREAL_TAP_SRC:.c=.obj)
412 ETHEREAL_COMMON_OBJECTS = \
416 capture_stop_conditions.obj \
426 disabled_protos.obj \
432 packet-dcerpc-nt.obj \
449 $(DISSECTOR_OBJECTS) \
450 $(ETHEREAL_COMMON_OBJECTS) \
454 proto_hier_stats.obj \
457 tethereal_OBJECTS = \
458 $(DISSECTOR_OBJECTS) \
459 $(ETHEREAL_COMMON_OBJECTS) \
460 $(TETHEREAL_TAP_OBJECTS) \
461 tethereal-tap-register.obj \
465 $(DISSECTOR_OBJECTS) \
466 $(ETHEREAL_COMMON_OBJECTS) \
478 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
479 gtk\libui.lib epan\ethereal.lib \
480 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
481 wsock32.lib user32.lib \
484 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
485 # $(PCAP_DIR)\lib\wpcap.lib
487 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
489 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
490 wsock32.lib user32.lib \
493 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
495 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
496 wsock32.lib user32.lib \
499 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
500 wsock32.lib user32.lib \
503 dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib epan\ethereal.lib \
504 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
505 wsock32.lib user32.lib \
506 wiretap\wiretap-$(WTAP_VERSION).lib \
509 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
512 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
514 EXECUTABLES=ethereal.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe
516 RESOURCES=image\ethereal.res image\tethereal.res image\editcap.res image\mergecap.res image\text2pcap.res
518 all: tools wiretap gtk epan image $(EXECUTABLES) $(RESOURCES)
522 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
524 ethereal.exe : config.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
527 /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
530 tethereal.exe : config.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
533 /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) image\tethereal.res
536 editcap.exe : config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
539 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS) image\editcap.res
542 mergecap.exe : config.h mergecap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
545 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
548 text2pcap.exe : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
551 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
554 dftest.exe : $(dftest_OBJECTS) $(EXTRA_OBJECTS)
556 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS) $(EXTRA_OBJECTS)
559 randpkt.exe : $(randpkt_OBJECTS) $(EXTRA_OBJECTS)
561 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
564 config.h : config.h.win32 config.nmake
565 sed -e s/@VERSION@/$(VERSION)/ -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" < config.h.win32 > $@
567 ps.c : rdps.exe print.ps
571 # The header files listed here are built from x11-fields using Perl;
572 # we declare a dependency here so that they get built.
574 packet-x11.obj : packet-x11.c x11-declarations.h x11-register-info.h
577 # Build various header files for the X11 dissector.
579 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
580 $(PERL) process-x11-fields.pl <x11-fields
582 packet-ncp2222.c : ncp2222.py
584 @echo Making packet-ncp2222.c
585 $(PYTHON) ncp2222.py -o packet-ncp2222.c
587 @echo Faking packet-ncp2222.c...
588 @echo Python is required to build the NCP disector
589 @echo Hiding packet-ncp.c...
590 mv packet-ncp.c packet-ncp.c.save
591 touch packet-ncp.c $@
595 # Build "register.c", which contains a function "register_all_protocols()"
596 # that calls the register routines for all protocols.
598 # We do this by grepping through sources. If that turns out to be too slow,
599 # maybe we could just require every .o file to have an register routine
600 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
602 # Formatting conventions: The name of the proto_register_* routines must
603 # start in column zero, or must be preceded only by "void " starting in
604 # column zero, and must not be inside #if.
606 # We assume that all dissector routines are in "packet-XXX.c" files.
608 # For some unknown reason, having a big "for" loop in the Makefile
609 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
610 # they seem to pass only the first few names in the list to the shell,
613 # Therefore, we have a script to generate the "register.c" file.
615 # The first argument is the name of the file to write.
616 # The second argument is the directory in which the source files live.
617 # All subsequent arguments are the files to scan.
619 # On Windows, however, that script runs slowly, as multiple greps
620 # and seds are run for each input file, so, if Python is present
621 # (as indicated by PYTHON being defined), we run a faster Python
622 # script to do that work instead. That script doesn't take the name
623 # of the file to write as an argument; it always writes to
626 register.c: $(DISSECTOR_SRC)
628 @echo Making register.c (using python)
629 @$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
631 @echo Making register.c (using sh)
632 @$(SH) make-reg-dotc register.c . $(DISSECTOR_SRC)
636 # Build "tethereal-tap-register.c", which contains a function
637 # "register_all_tap_listeners()"
638 # that calls the register routines for all tehtereal tap listeners.
640 # We do this by grepping through sources.
642 # Formatting conventions: The name of the tap_listener_register_*
643 # routines must start in column zero, or must be preceded only by
644 # "void " starting in column zero, and must not be inside #if.
646 # The first argument is the name of the file to write.
647 # The second argument is the directory in which the source files live.
648 # All subsequent arguments are the files to scan.
650 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
651 @echo Making tethereal-tap-register.c
652 @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
654 text2pcap-scanner.c : text2pcap-scanner.l
655 $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
658 rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
659 $(EXECUTABLES) $(PDB_FILE) \
660 editcap.obj mergecap.obj text2pcap.obj \
661 text2pcap-scanner.obj text2pcap-scanner.c register.c \
662 rdps.obj rdps.pdb config.h ps.c \
663 rdps.exe rdps.ilk dftest.obj dftest.exe randpkt.obj randpkt.ext \
666 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
668 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
670 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
672 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
674 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
676 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
678 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
680 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
683 # Call distclean only, if you would like to remove ALL generated files.
684 # Be sure to have python and perl installed to regenerate them.
686 rm -f x11-declarations.h x11-register-info.h packet-ncp2222.c
690 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
695 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
700 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
705 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
710 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
715 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake