1 ## Makefile for building ethereal.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
4 # $Id: Makefile.nmake,v 1.294 2003/04/23 00:24:36 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) /I$(GLIB_DIR) /I$(GLIB_DIR)\gmodule \
17 /I$(GTK_DIR) /I. /Iwiretap /I$(GTK_DIR)\gdk /I$(GTK_DIR)\gdk\win32 \
18 /I$(ZLIB_DIR) /I$(PCAP_DIR)\include \
19 /I$(NET_SNMP_DIR)\include /I$(NET_SNMP_DIR)\win32 \
22 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
25 $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
68 packet-dcerpc-afs4int.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-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-tapi.c \
110 packet-dcerpc-tkn4int.c \
111 packet-dcerpc-ubikdisk.c \
112 packet-dcerpc-ubikvote.c \
113 packet-dcerpc-update.c \
114 packet-dcerpc-wkssvc.c \
186 packet-isis-hello.c \
218 packet-msn-messenger.c \
244 packet-osi-options.c \
262 packet-quakeworld.c \
296 packet-slowprotocols.c \
298 packet-smb-browse.c \
299 packet-smb-common.c \
301 packet-smb-mailslot.c \
303 packet-smb-sidsnooping.c \
317 packet-stat-notify.c \
344 packet-wfleet-hdlc.c \
364 DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
366 TETHEREAL_TAP_SRC = \
372 tap-protohierstat.c \
377 TETHEREAL_TAP_OBJECTS = $(TETHEREAL_TAP_SRC:.c=.obj)
379 ETHEREAL_COMMON_OBJECTS = \
382 capture_stop_conditions.obj \
396 packet-dcerpc-nt.obj \
412 $(DISSECTOR_OBJECTS) \
413 $(ETHEREAL_COMMON_OBJECTS) \
417 proto_hier_stats.obj \
420 tethereal_OBJECTS = \
421 $(DISSECTOR_OBJECTS) \
422 $(ETHEREAL_COMMON_OBJECTS) \
423 $(TETHEREAL_TAP_OBJECTS) \
424 tethereal-tap-register.obj \
428 $(DISSECTOR_OBJECTS) \
429 $(ETHEREAL_COMMON_OBJECTS) \
441 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
442 gtk\libui.lib epan\ethereal.lib \
443 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
444 wsock32.lib user32.lib \
445 $(GTK_DIR)\gtk\gtk-$(GTK_VERSION).lib \
446 $(GTK_DIR)\gdk\gdk-$(GTK_VERSION).lib \
447 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
448 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib \
449 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
450 # $(PCAP_DIR)\lib\wpcap.lib
452 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
454 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
455 wsock32.lib user32.lib \
456 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
457 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib \
458 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
460 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
461 wsock32.lib user32.lib \
462 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
463 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib
465 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
466 wsock32.lib user32.lib \
467 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
468 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib
470 dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib epan\ethereal.lib \
471 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
472 wsock32.lib user32.lib \
473 wiretap\wiretap-$(WTAP_VERSION).lib \
474 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
475 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib
477 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
479 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib \
480 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
482 EXECUTABLES=ethereal.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe
484 RESOURCES=image\ethereal.res image\tethereal.res image\editcap.res image\mergecap.res image\text2pcap.res
486 all: tools wiretap gtk epan image $(EXECUTABLES) $(RESOURCES)
490 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
492 ethereal.exe : config.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
495 /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
498 tethereal.exe : config.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
501 /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) image\tethereal.res
504 editcap.exe : config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
507 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS) image\editcap.res
510 mergecap.exe : config.h mergecap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
513 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
516 text2pcap.exe : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
519 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
522 dftest.exe : $(dftest_OBJECTS) $(EXTRA_OBJECTS)
524 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS) $(EXTRA_OBJECTS)
527 randpkt.exe : $(randpkt_OBJECTS) $(EXTRA_OBJECTS)
529 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
532 config.h : config.h.win32
533 sed -e s/@VERSION@/$(VERSION)/ < config.h.win32 > $@
535 ps.c : rdps.exe print.ps
539 # The header files listed here are built from x11-fields using Perl;
540 # we declare a dependency here so that they get built.
542 packet-x11.obj : packet-x11.c x11-declarations.h x11-register-info.h
545 # Build various header files for the X11 dissector.
547 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
548 $(PERL) process-x11-fields.pl <x11-fields
550 packet-ncp2222.c : ncp2222.py
552 @echo Making packet-ncp2222.c
553 $(PYTHON) ncp2222.py -o packet-ncp2222.c
555 @echo Faking packet-ncp2222.c...
556 @echo Python is required to build the NCP disector
557 @echo Hiding packet-ncp.c...
558 mv packet-ncp.c packet-ncp.c.save
559 touch packet-ncp.c $@
563 # Build "register.c", which contains a function "register_all_protocols()"
564 # that calls the register routines for all protocols.
566 # We do this by grepping through sources. If that turns out to be too slow,
567 # maybe we could just require every .o file to have an register routine
568 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
570 # Formatting conventions: The name of the proto_register_* routines must
571 # start in column zero, or must be preceded only by "void " starting in
572 # column zero, and must not be inside #if.
574 # We assume that all dissector routines are in "packet-XXX.c" files.
576 # For some unknown reason, having a big "for" loop in the Makefile
577 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
578 # they seem to pass only the first few names in the list to the shell,
581 # Therefore, we have a script to generate the "register.c" file.
583 # The first argument is the name of the file to write.
584 # The second argument is the directory in which the source files live.
585 # All subsequent arguments are the files to scan.
587 # On Windows, however, that script runs slowly, as multiple greps
588 # and seds are run for each input file, so, if Python is present
589 # (as indicated by PYTHON being defined), we run a faster Python
590 # script to do that work instead. That script doesn't take the name
591 # of the file to write as an argument; it always writes to
594 register.c: $(DISSECTOR_SRC)
596 @echo Making register.c (using python)
597 @$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
599 @echo Making register.c (using sh)
600 @$(SH) make-reg-dotc register.c . $(DISSECTOR_SRC)
604 # Build "tethereal-tap-register.c", which contains a function
605 # "register_all_tap_listeners()"
606 # that calls the register routines for all tehtereal tap listeners.
608 # We do this by grepping through sources.
610 # Formatting conventions: The name of the tap_listener_register_*
611 # routines must start in column zero, or must be preceded only by
612 # "void " starting in column zero, and must not be inside #if.
614 # The first argument is the name of the file to write.
615 # The second argument is the directory in which the source files live.
616 # All subsequent arguments are the files to scan.
618 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
619 @echo Making tethereal-tap-register.c
620 @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
622 text2pcap-scanner.c : text2pcap-scanner.l
623 $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
626 rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
627 $(EXECUTABLES) $(PDB_FILE) \
628 editcap.obj mergecap.obj text2pcap.obj \
629 text2pcap-scanner.obj text2pcap-scanner.c register.c \
630 rdps.obj rdps.pdb config.h ps.c \
631 rdps.exe rdps.ilk dftest.obj dftest.exe randpkt.obj randpkt.ext \
634 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
636 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
638 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
640 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
642 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
644 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
646 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
648 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
651 # Call distclean only, if you would like to remove ALL generated files.
652 # Be sure to have python and perl installed to regenerate them.
654 rm -f x11-declarations.h x11-register-info.h packet-ncp2222.c
658 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
663 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
668 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
673 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
678 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
683 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake