1 ## Makefile for building ethereal.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
4 # $Id: Makefile.nmake,v 1.332 2003/09/03 06:27:03 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 $<
67 packet-dcerpc-afs4int.c \
68 packet-dcerpc-atsvc.c \
69 packet-dcerpc-bossvr.c \
70 packet-dcerpc-browser.c \
71 packet-dcerpc-cds_clerkserver.c \
72 packet-dcerpc-cds_solicit.c \
73 packet-dcerpc-conv.c \
74 packet-dcerpc-cprpc_server.c \
75 packet-dcerpc-dce122.c \
77 packet-dcerpc-dnsserver.c \
78 packet-dcerpc-dtsprovider.c \
79 packet-dcerpc-dtsstime_req.c \
81 packet-dcerpc-fldb.c \
82 packet-dcerpc-ftserver.c \
83 packet-dcerpc-krb5rpc.c \
85 packet-dcerpc-lsa-ds.c \
86 packet-dcerpc-mapi.c \
87 packet-dcerpc-messenger.c \
88 packet-dcerpc-mgmt.c \
90 packet-dcerpc-netlogon.c \
91 packet-dcerpc-nspi.c \
92 packet-dcerpc-oxid.c \
94 packet-dcerpc-remact.c \
95 packet-dcerpc-rep_proc.c \
96 packet-dcerpc-roverride.c \
97 packet-dcerpc-rpriv.c \
98 packet-dcerpc-rs_acct.c \
99 packet-dcerpc-rs_attr.c \
100 packet-dcerpc-rs_misc.c \
101 packet-dcerpc-rs_pgo.c \
102 packet-dcerpc-rs_repadm.c \
103 packet-dcerpc-rs_replist.c \
104 packet-dcerpc-rs_unix.c \
105 packet-dcerpc-rsec_login.c \
106 packet-dcerpc-samr.c \
107 packet-dcerpc-secidmap.c \
108 packet-dcerpc-spoolss.c \
109 packet-dcerpc-srvsvc.c \
110 packet-dcerpc-svcctl.c \
111 packet-dcerpc-tapi.c \
112 packet-dcerpc-tkn4int.c \
113 packet-dcerpc-ubikdisk.c \
114 packet-dcerpc-ubikvote.c \
115 packet-dcerpc-update.c \
116 packet-dcerpc-wkssvc.c \
196 packet-isis-hello.c \
233 packet-msn-messenger.c \
260 packet-osi-options.c \
280 packet-quakeworld.c \
315 packet-slowprotocols.c \
317 packet-smb-browse.c \
318 packet-smb-common.c \
320 packet-smb-mailslot.c \
322 packet-smb-sidsnooping.c \
336 packet-stat-notify.c \
365 packet-wfleet-hdlc.c \
385 DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
387 TETHEREAL_TAP_SRC = \
395 tap-protohierstat.c \
402 TETHEREAL_TAP_OBJECTS = $(TETHEREAL_TAP_SRC:.c=.obj)
404 ETHEREAL_COMMON_OBJECTS = \
408 capture_stop_conditions.obj \
418 disabled_protos.obj \
424 packet-dcerpc-nt.obj \
440 $(DISSECTOR_OBJECTS) \
441 $(ETHEREAL_COMMON_OBJECTS) \
445 proto_hier_stats.obj \
448 tethereal_OBJECTS = \
449 $(DISSECTOR_OBJECTS) \
450 $(ETHEREAL_COMMON_OBJECTS) \
451 $(TETHEREAL_TAP_OBJECTS) \
452 tethereal-tap-register.obj \
456 $(DISSECTOR_OBJECTS) \
457 $(ETHEREAL_COMMON_OBJECTS) \
469 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
470 gtk\libui.lib epan\ethereal.lib \
471 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
472 wsock32.lib user32.lib \
475 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
476 # $(PCAP_DIR)\lib\wpcap.lib
478 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
480 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
481 wsock32.lib user32.lib \
484 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
486 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
487 wsock32.lib user32.lib \
490 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
491 wsock32.lib user32.lib \
494 dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib epan\ethereal.lib \
495 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
496 wsock32.lib user32.lib \
497 wiretap\wiretap-$(WTAP_VERSION).lib \
500 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
503 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
505 EXECUTABLES=ethereal.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe
507 RESOURCES=image\ethereal.res image\tethereal.res image\editcap.res image\mergecap.res image\text2pcap.res
509 all: tools wiretap gtk epan image $(EXECUTABLES) $(RESOURCES)
513 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
515 ethereal.exe : config.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
518 /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
521 tethereal.exe : config.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
524 /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) image\tethereal.res
527 editcap.exe : config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
530 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS) image\editcap.res
533 mergecap.exe : config.h mergecap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
536 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
539 text2pcap.exe : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
542 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
545 dftest.exe : $(dftest_OBJECTS) $(EXTRA_OBJECTS)
547 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS) $(EXTRA_OBJECTS)
550 randpkt.exe : $(randpkt_OBJECTS) $(EXTRA_OBJECTS)
552 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
555 config.h : config.h.win32 config.nmake
556 sed -e s/@VERSION@/$(VERSION)/ -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" < config.h.win32 > $@
558 ps.c : rdps.exe print.ps
562 # The header files listed here are built from x11-fields using Perl;
563 # we declare a dependency here so that they get built.
565 packet-x11.obj : packet-x11.c x11-declarations.h x11-register-info.h
568 # Build various header files for the X11 dissector.
570 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
571 $(PERL) process-x11-fields.pl <x11-fields
573 packet-ncp2222.c : ncp2222.py
575 @echo Making packet-ncp2222.c
576 $(PYTHON) ncp2222.py -o packet-ncp2222.c
578 @echo Faking packet-ncp2222.c...
579 @echo Python is required to build the NCP disector
580 @echo Hiding packet-ncp.c...
581 mv packet-ncp.c packet-ncp.c.save
582 touch packet-ncp.c $@
586 # Build "register.c", which contains a function "register_all_protocols()"
587 # that calls the register routines for all protocols.
589 # We do this by grepping through sources. If that turns out to be too slow,
590 # maybe we could just require every .o file to have an register routine
591 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
593 # Formatting conventions: The name of the proto_register_* routines must
594 # start in column zero, or must be preceded only by "void " starting in
595 # column zero, and must not be inside #if.
597 # We assume that all dissector routines are in "packet-XXX.c" files.
599 # For some unknown reason, having a big "for" loop in the Makefile
600 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
601 # they seem to pass only the first few names in the list to the shell,
604 # Therefore, we have a script to generate the "register.c" file.
606 # The first argument is the name of the file to write.
607 # The second argument is the directory in which the source files live.
608 # All subsequent arguments are the files to scan.
610 # On Windows, however, that script runs slowly, as multiple greps
611 # and seds are run for each input file, so, if Python is present
612 # (as indicated by PYTHON being defined), we run a faster Python
613 # script to do that work instead. That script doesn't take the name
614 # of the file to write as an argument; it always writes to
617 register.c: $(DISSECTOR_SRC)
619 @echo Making register.c (using python)
620 @$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
622 @echo Making register.c (using sh)
623 @$(SH) make-reg-dotc register.c . $(DISSECTOR_SRC)
627 # Build "tethereal-tap-register.c", which contains a function
628 # "register_all_tap_listeners()"
629 # that calls the register routines for all tehtereal tap listeners.
631 # We do this by grepping through sources.
633 # Formatting conventions: The name of the tap_listener_register_*
634 # routines must start in column zero, or must be preceded only by
635 # "void " starting in column zero, and must not be inside #if.
637 # The first argument is the name of the file to write.
638 # The second argument is the directory in which the source files live.
639 # All subsequent arguments are the files to scan.
641 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
642 @echo Making tethereal-tap-register.c
643 @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
645 text2pcap-scanner.c : text2pcap-scanner.l
646 $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
649 rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
650 $(EXECUTABLES) $(PDB_FILE) \
651 editcap.obj mergecap.obj text2pcap.obj \
652 text2pcap-scanner.obj text2pcap-scanner.c register.c \
653 rdps.obj rdps.pdb config.h ps.c \
654 rdps.exe rdps.ilk dftest.obj dftest.exe randpkt.obj randpkt.ext \
657 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
659 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
661 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
663 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
665 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
667 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
669 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
671 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
674 # Call distclean only, if you would like to remove ALL generated files.
675 # Be sure to have python and perl installed to regenerate them.
677 rm -f x11-declarations.h x11-register-info.h packet-ncp2222.c
681 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
686 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
691 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
696 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
701 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
706 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake