1 ## Makefile for building ethereal.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
4 # $Id: Makefile.nmake,v 1.320 2003/07/24 20:22:50 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 $<
66 packet-dcerpc-afs4int.c \
67 packet-dcerpc-atsvc.c \
68 packet-dcerpc-bossvr.c \
69 packet-dcerpc-browser.c \
70 packet-dcerpc-cds_clerkserver.c \
71 packet-dcerpc-cds_solicit.c \
72 packet-dcerpc-conv.c \
73 packet-dcerpc-cprpc_server.c \
74 packet-dcerpc-dce122.c \
76 packet-dcerpc-dnsserver.c \
77 packet-dcerpc-dtsprovider.c \
78 packet-dcerpc-dtsstime_req.c \
80 packet-dcerpc-fldb.c \
81 packet-dcerpc-ftserver.c \
82 packet-dcerpc-krb5rpc.c \
84 packet-dcerpc-lsa-ds.c \
85 packet-dcerpc-mapi.c \
86 packet-dcerpc-messenger.c \
87 packet-dcerpc-mgmt.c \
89 packet-dcerpc-netlogon.c \
90 packet-dcerpc-nspi.c \
91 packet-dcerpc-oxid.c \
93 packet-dcerpc-remact.c \
94 packet-dcerpc-rep_proc.c \
95 packet-dcerpc-roverride.c \
96 packet-dcerpc-rpriv.c \
97 packet-dcerpc-rs_acct.c \
98 packet-dcerpc-rs_attr.c \
99 packet-dcerpc-rs_misc.c \
100 packet-dcerpc-rs_pgo.c \
101 packet-dcerpc-rs_repadm.c \
102 packet-dcerpc-rs_replist.c \
103 packet-dcerpc-rs_unix.c \
104 packet-dcerpc-rsec_login.c \
105 packet-dcerpc-samr.c \
106 packet-dcerpc-secidmap.c \
107 packet-dcerpc-spoolss.c \
108 packet-dcerpc-srvsvc.c \
109 packet-dcerpc-svcctl.c \
110 packet-dcerpc-tapi.c \
111 packet-dcerpc-tkn4int.c \
112 packet-dcerpc-ubikdisk.c \
113 packet-dcerpc-ubikvote.c \
114 packet-dcerpc-update.c \
115 packet-dcerpc-wkssvc.c \
193 packet-isis-hello.c \
229 packet-msn-messenger.c \
255 packet-osi-options.c \
274 packet-quakeworld.c \
309 packet-slowprotocols.c \
311 packet-smb-browse.c \
312 packet-smb-common.c \
314 packet-smb-mailslot.c \
316 packet-smb-sidsnooping.c \
330 packet-stat-notify.c \
357 packet-wfleet-hdlc.c \
377 DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
379 TETHEREAL_TAP_SRC = \
385 tap-protohierstat.c \
391 TETHEREAL_TAP_OBJECTS = $(TETHEREAL_TAP_SRC:.c=.obj)
393 ETHEREAL_COMMON_OBJECTS = \
396 capture_stop_conditions.obj \
410 packet-dcerpc-nt.obj \
426 $(DISSECTOR_OBJECTS) \
427 $(ETHEREAL_COMMON_OBJECTS) \
431 proto_hier_stats.obj \
434 tethereal_OBJECTS = \
435 $(DISSECTOR_OBJECTS) \
436 $(ETHEREAL_COMMON_OBJECTS) \
437 $(TETHEREAL_TAP_OBJECTS) \
438 tethereal-tap-register.obj \
442 $(DISSECTOR_OBJECTS) \
443 $(ETHEREAL_COMMON_OBJECTS) \
455 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
456 gtk\libui.lib epan\ethereal.lib \
457 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
458 wsock32.lib user32.lib \
461 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
462 # $(PCAP_DIR)\lib\wpcap.lib
464 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
466 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
467 wsock32.lib user32.lib \
470 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
472 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
473 wsock32.lib user32.lib \
476 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
477 wsock32.lib user32.lib \
480 dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib epan\ethereal.lib \
481 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
482 wsock32.lib user32.lib \
483 wiretap\wiretap-$(WTAP_VERSION).lib \
486 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
489 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
491 EXECUTABLES=ethereal.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe
493 RESOURCES=image\ethereal.res image\tethereal.res image\editcap.res image\mergecap.res image\text2pcap.res
495 all: tools wiretap gtk epan image $(EXECUTABLES) $(RESOURCES)
499 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
501 ethereal.exe : config.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
504 /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
507 tethereal.exe : config.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
510 /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) image\tethereal.res
513 editcap.exe : config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
516 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS) image\editcap.res
519 mergecap.exe : config.h mergecap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
522 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
525 text2pcap.exe : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
528 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
531 dftest.exe : $(dftest_OBJECTS) $(EXTRA_OBJECTS)
533 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS) $(EXTRA_OBJECTS)
536 randpkt.exe : $(randpkt_OBJECTS) $(EXTRA_OBJECTS)
538 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
541 config.h : config.h.win32 config.nmake
542 sed -e s/@VERSION@/$(VERSION)/ -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" < config.h.win32 > $@
544 ps.c : rdps.exe print.ps
548 # The header files listed here are built from x11-fields using Perl;
549 # we declare a dependency here so that they get built.
551 packet-x11.obj : packet-x11.c x11-declarations.h x11-register-info.h
554 # Build various header files for the X11 dissector.
556 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
557 $(PERL) process-x11-fields.pl <x11-fields
559 packet-ncp2222.c : ncp2222.py
561 @echo Making packet-ncp2222.c
562 $(PYTHON) ncp2222.py -o packet-ncp2222.c
564 @echo Faking packet-ncp2222.c...
565 @echo Python is required to build the NCP disector
566 @echo Hiding packet-ncp.c...
567 mv packet-ncp.c packet-ncp.c.save
568 touch packet-ncp.c $@
572 # Build "register.c", which contains a function "register_all_protocols()"
573 # that calls the register routines for all protocols.
575 # We do this by grepping through sources. If that turns out to be too slow,
576 # maybe we could just require every .o file to have an register routine
577 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
579 # Formatting conventions: The name of the proto_register_* routines must
580 # start in column zero, or must be preceded only by "void " starting in
581 # column zero, and must not be inside #if.
583 # We assume that all dissector routines are in "packet-XXX.c" files.
585 # For some unknown reason, having a big "for" loop in the Makefile
586 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
587 # they seem to pass only the first few names in the list to the shell,
590 # Therefore, we have a script to generate the "register.c" file.
592 # The first argument is the name of the file to write.
593 # The second argument is the directory in which the source files live.
594 # All subsequent arguments are the files to scan.
596 # On Windows, however, that script runs slowly, as multiple greps
597 # and seds are run for each input file, so, if Python is present
598 # (as indicated by PYTHON being defined), we run a faster Python
599 # script to do that work instead. That script doesn't take the name
600 # of the file to write as an argument; it always writes to
603 register.c: $(DISSECTOR_SRC)
605 @echo Making register.c (using python)
606 @$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
608 @echo Making register.c (using sh)
609 @$(SH) make-reg-dotc register.c . $(DISSECTOR_SRC)
613 # Build "tethereal-tap-register.c", which contains a function
614 # "register_all_tap_listeners()"
615 # that calls the register routines for all tehtereal tap listeners.
617 # We do this by grepping through sources.
619 # Formatting conventions: The name of the tap_listener_register_*
620 # routines must start in column zero, or must be preceded only by
621 # "void " starting in column zero, and must not be inside #if.
623 # The first argument is the name of the file to write.
624 # The second argument is the directory in which the source files live.
625 # All subsequent arguments are the files to scan.
627 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
628 @echo Making tethereal-tap-register.c
629 @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
631 text2pcap-scanner.c : text2pcap-scanner.l
632 $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
635 rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
636 $(EXECUTABLES) $(PDB_FILE) \
637 editcap.obj mergecap.obj text2pcap.obj \
638 text2pcap-scanner.obj text2pcap-scanner.c register.c \
639 rdps.obj rdps.pdb config.h ps.c \
640 rdps.exe rdps.ilk dftest.obj dftest.exe randpkt.obj randpkt.ext \
643 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
645 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
647 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
649 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
651 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
653 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
655 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
657 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
660 # Call distclean only, if you would like to remove ALL generated files.
661 # Be sure to have python and perl installed to regenerate them.
663 rm -f x11-declarations.h x11-register-info.h packet-ncp2222.c
667 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
672 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
677 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
682 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
687 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
692 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake