1 ## Makefile for building ethereal.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
4 # $Id: Makefile.nmake,v 1.279 2003/02/06 01:23:32 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 $<
64 packet-dcerpc-afs4int.c \
65 packet-dcerpc-bossvr.c \
66 packet-dcerpc-browser.c \
67 packet-dcerpc-cds_clerkserver.c \
68 packet-dcerpc-cds_solicit.c \
69 packet-dcerpc-conv.c \
70 packet-dcerpc-cprpc_server.c \
71 packet-dcerpc-dce122.c \
73 packet-dcerpc-dnsserver.c \
74 packet-dcerpc-dtsprovider.c \
75 packet-dcerpc-dtsstime_req.c \
77 packet-dcerpc-fldb.c \
78 packet-dcerpc-ftserver.c \
79 packet-dcerpc-krb5rpc.c \
81 packet-dcerpc-lsa-ds.c \
82 packet-dcerpc-mapi.c \
83 packet-dcerpc-mgmt.c \
85 packet-dcerpc-netlogon.c \
86 packet-dcerpc-nspi.c \
87 packet-dcerpc-oxid.c \
89 packet-dcerpc-remact.c \
90 packet-dcerpc-rep_proc.c \
91 packet-dcerpc-roverride.c \
92 packet-dcerpc-rpriv.c \
93 packet-dcerpc-rs_acct.c \
94 packet-dcerpc-rs_attr.c \
95 packet-dcerpc-rs_misc.c \
96 packet-dcerpc-rs_pgo.c \
97 packet-dcerpc-rs_repadm.c \
98 packet-dcerpc-rs_replist.c \
99 packet-dcerpc-rs_unix.c \
100 packet-dcerpc-rsec_login.c \
101 packet-dcerpc-samr.c \
102 packet-dcerpc-secidmap.c \
103 packet-dcerpc-spoolss.c \
104 packet-dcerpc-srvsvc.c \
105 packet-dcerpc-tapi.c \
106 packet-dcerpc-tkn4int.c \
107 packet-dcerpc-ubikdisk.c \
108 packet-dcerpc-ubikvote.c \
109 packet-dcerpc-update.c \
110 packet-dcerpc-wkssvc.c \
177 packet-isis-hello.c \
209 packet-msn-messenger.c \
234 packet-osi-options.c \
252 packet-quakeworld.c \
283 packet-slowprotocols.c \
285 packet-smb-browse.c \
286 packet-smb-common.c \
288 packet-smb-mailslot.c \
303 packet-stat-notify.c \
330 packet-wfleet-hdlc.c \
349 DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
351 TETHEREAL_TAP_SRC = \
356 tap-protohierstat.c \
361 TETHEREAL_TAP_OBJECTS = $(TETHEREAL_TAP_SRC:.c=.obj)
363 ETHEREAL_COMMON_OBJECTS = \
366 capture_stop_conditions.obj \
379 packet-dcerpc-nt.obj \
394 $(DISSECTOR_OBJECTS) \
395 $(ETHEREAL_COMMON_OBJECTS) \
399 proto_hier_stats.obj \
402 tethereal_OBJECTS = \
403 $(DISSECTOR_OBJECTS) \
404 $(ETHEREAL_COMMON_OBJECTS) \
405 $(TETHEREAL_TAP_OBJECTS) \
406 tethereal-tap-register.obj \
410 $(DISSECTOR_OBJECTS) \
411 $(ETHEREAL_COMMON_OBJECTS) \
423 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
424 gtk\libui.lib epan\ethereal.lib \
425 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
426 wsock32.lib user32.lib \
427 $(GTK_DIR)\gtk\gtk-$(GTK_VERSION).lib \
428 $(GTK_DIR)\gdk\gdk-$(GTK_VERSION).lib \
429 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
430 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib \
431 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
432 # $(PCAP_DIR)\lib\wpcap.lib
434 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
436 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
437 wsock32.lib user32.lib \
438 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
439 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib \
440 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
442 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
443 wsock32.lib user32.lib \
444 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
445 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib
447 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
448 wsock32.lib user32.lib \
449 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
450 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib
452 dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib epan\ethereal.lib \
453 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
454 wsock32.lib user32.lib \
455 wiretap\wiretap-$(WTAP_VERSION).lib \
456 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
457 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib
459 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
461 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib \
462 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
464 EXECUTABLES=ethereal.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe
466 RESOURCES=image\ethereal.res image\tethereal.res image\editcap.res image\mergecap.res image\text2pcap.res
468 all: tools wiretap gtk epan image $(EXECUTABLES) $(RESOURCES)
472 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
474 ethereal.exe : config.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
477 /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
480 tethereal.exe : config.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
483 /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) image\tethereal.res
486 editcap.exe : config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
489 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS) image\editcap.res
492 mergecap.exe : config.h mergecap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
495 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
498 text2pcap.exe : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
501 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
504 dftest.exe : $(dftest_OBJECTS) $(EXTRA_OBJECTS)
506 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS) $(EXTRA_OBJECTS)
509 randpkt.exe : $(randpkt_OBJECTS) $(EXTRA_OBJECTS)
511 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
514 config.h : config.h.win32
515 sed -e s/@VERSION@/$(VERSION)/ < config.h.win32 > $@
517 ps.c : rdps.exe print.ps
521 # The header files listed here are built from x11-fields using Perl;
522 # we declare a dependency here so that they get built.
524 packet-x11.obj : packet-x11.c x11-declarations.h x11-register-info.h
527 # Build various header files for the X11 dissector.
529 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
530 $(PERL) process-x11-fields.pl <x11-fields
532 packet-ncp2222.c : ncp2222.py
534 @echo Making packet-ncp2222.c
535 $(PYTHON) ncp2222.py -o packet-ncp2222.c
537 @echo Faking packet-ncp2222.c...
538 @echo Python is required to build the NCP disector
539 @echo Hiding packet-ncp.c...
540 mv packet-ncp.c packet-ncp.c.save
541 touch packet-ncp.c $@
545 # Build "register.c", which contains a function "register_all_protocols()"
546 # that calls the register routines for all protocols.
548 # We do this by grepping through sources. If that turns out to be too slow,
549 # maybe we could just require every .o file to have an register routine
550 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
552 # Formatting conventions: The name of the proto_register_* routines must
553 # start in column zero, or must be preceded only by "void " starting in
554 # column zero, and must not be inside #if.
556 # We assume that all dissector routines are in "packet-XXX.c" files.
558 # For some unknown reason, having a big "for" loop in the Makefile
559 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
560 # they seem to pass only the first few names in the list to the shell,
563 # Therefore, we have a script to generate the "register.c" file.
565 # The first argument is the name of the file to write.
566 # The second argument is the directory in which the source files live.
567 # All subsequent arguments are the files to scan.
569 # On Windows, however, that script runs slowly, as multiple greps
570 # and seds are run for each input file, so, if Python is present
571 # (as indicated by PYTHON being defined), we run a faster Python
572 # script to do that work instead. That script doesn't take the name
573 # of the file to write as an argument; it always writes to
576 register.c: $(DISSECTOR_SRC)
578 @echo Making register.c (using python)
579 @$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
581 @echo Making register.c (using sh)
582 @$(SH) make-reg-dotc register.c . $(DISSECTOR_SRC)
586 # Build "tethereal-tap-register.c", which contains a function
587 # "register_all_tap_listeners()"
588 # that calls the register routines for all tehtereal tap listeners.
590 # We do this by grepping through sources.
592 # Formatting conventions: The name of the tap_listener_register_*
593 # routines must start in column zero, or must be preceded only by
594 # "void " starting in column zero, and must not be inside #if.
596 # The first argument is the name of the file to write.
597 # The second argument is the directory in which the source files live.
598 # All subsequent arguments are the files to scan.
600 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
601 @echo Making tethereal-tap-register.c
602 @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
604 text2pcap-scanner.c : text2pcap-scanner.l
605 $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
608 rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
609 $(EXECUTABLES) $(PDB_FILE) \
610 editcap.obj mergecap.obj text2pcap.obj \
611 text2pcap-scanner.obj text2pcap-scanner.c register.c \
612 rdps.obj rdps.pdb config.h ps.c \
613 rdps.exe rdps.ilk dftest.obj dftest.exe randpkt.obj randpkt.ext \
616 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
618 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
620 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
622 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
624 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
626 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
628 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
630 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
633 # Call distclean only, if you would like to remove ALL generated files.
634 # Be sure to have python and perl installed to regenerate them.
636 rm -f x11-declarations.h x11-register-info.h packet-ncp2222.c
640 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
645 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
650 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
655 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
660 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
665 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake