1 ## Makefile for building ethereal.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
4 # $Id: Makefile.nmake,v 1.280 2003/02/18 21:47:56 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 \
284 packet-slowprotocols.c \
286 packet-smb-browse.c \
287 packet-smb-common.c \
289 packet-smb-mailslot.c \
304 packet-stat-notify.c \
331 packet-wfleet-hdlc.c \
350 DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
352 TETHEREAL_TAP_SRC = \
357 tap-protohierstat.c \
362 TETHEREAL_TAP_OBJECTS = $(TETHEREAL_TAP_SRC:.c=.obj)
364 ETHEREAL_COMMON_OBJECTS = \
367 capture_stop_conditions.obj \
380 packet-dcerpc-nt.obj \
395 $(DISSECTOR_OBJECTS) \
396 $(ETHEREAL_COMMON_OBJECTS) \
400 proto_hier_stats.obj \
403 tethereal_OBJECTS = \
404 $(DISSECTOR_OBJECTS) \
405 $(ETHEREAL_COMMON_OBJECTS) \
406 $(TETHEREAL_TAP_OBJECTS) \
407 tethereal-tap-register.obj \
411 $(DISSECTOR_OBJECTS) \
412 $(ETHEREAL_COMMON_OBJECTS) \
424 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
425 gtk\libui.lib epan\ethereal.lib \
426 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
427 wsock32.lib user32.lib \
428 $(GTK_DIR)\gtk\gtk-$(GTK_VERSION).lib \
429 $(GTK_DIR)\gdk\gdk-$(GTK_VERSION).lib \
430 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
431 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib \
432 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
433 # $(PCAP_DIR)\lib\wpcap.lib
435 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
437 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
438 wsock32.lib user32.lib \
439 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
440 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib \
441 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
443 editcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
444 wsock32.lib user32.lib \
445 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
446 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib
448 mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
449 wsock32.lib user32.lib \
450 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
451 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib
453 dftest_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib epan\ethereal.lib \
454 epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
455 wsock32.lib user32.lib \
456 wiretap\wiretap-$(WTAP_VERSION).lib \
457 $(GLIB_DIR)\glib-$(GLIB_VERSION).lib \
458 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib
460 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
462 $(GLIB_DIR)\gmodule\gmodule-$(GLIB_VERSION).lib \
463 $(NET_SNMP_DIR)\win32\lib\libsnmp.lib
465 EXECUTABLES=ethereal.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe
467 RESOURCES=image\ethereal.res image\tethereal.res image\editcap.res image\mergecap.res image\text2pcap.res
469 all: tools wiretap gtk epan image $(EXECUTABLES) $(RESOURCES)
473 wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
475 ethereal.exe : config.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
478 /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
481 tethereal.exe : config.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
484 /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) image\tethereal.res
487 editcap.exe : config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
490 /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS) image\editcap.res
493 mergecap.exe : config.h mergecap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
496 /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
499 text2pcap.exe : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
502 /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
505 dftest.exe : $(dftest_OBJECTS) $(EXTRA_OBJECTS)
507 /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS) $(EXTRA_OBJECTS)
510 randpkt.exe : $(randpkt_OBJECTS) $(EXTRA_OBJECTS)
512 /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
515 config.h : config.h.win32
516 sed -e s/@VERSION@/$(VERSION)/ < config.h.win32 > $@
518 ps.c : rdps.exe print.ps
522 # The header files listed here are built from x11-fields using Perl;
523 # we declare a dependency here so that they get built.
525 packet-x11.obj : packet-x11.c x11-declarations.h x11-register-info.h
528 # Build various header files for the X11 dissector.
530 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
531 $(PERL) process-x11-fields.pl <x11-fields
533 packet-ncp2222.c : ncp2222.py
535 @echo Making packet-ncp2222.c
536 $(PYTHON) ncp2222.py -o packet-ncp2222.c
538 @echo Faking packet-ncp2222.c...
539 @echo Python is required to build the NCP disector
540 @echo Hiding packet-ncp.c...
541 mv packet-ncp.c packet-ncp.c.save
542 touch packet-ncp.c $@
546 # Build "register.c", which contains a function "register_all_protocols()"
547 # that calls the register routines for all protocols.
549 # We do this by grepping through sources. If that turns out to be too slow,
550 # maybe we could just require every .o file to have an register routine
551 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
553 # Formatting conventions: The name of the proto_register_* routines must
554 # start in column zero, or must be preceded only by "void " starting in
555 # column zero, and must not be inside #if.
557 # We assume that all dissector routines are in "packet-XXX.c" files.
559 # For some unknown reason, having a big "for" loop in the Makefile
560 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
561 # they seem to pass only the first few names in the list to the shell,
564 # Therefore, we have a script to generate the "register.c" file.
566 # The first argument is the name of the file to write.
567 # The second argument is the directory in which the source files live.
568 # All subsequent arguments are the files to scan.
570 # On Windows, however, that script runs slowly, as multiple greps
571 # and seds are run for each input file, so, if Python is present
572 # (as indicated by PYTHON being defined), we run a faster Python
573 # script to do that work instead. That script doesn't take the name
574 # of the file to write as an argument; it always writes to
577 register.c: $(DISSECTOR_SRC)
579 @echo Making register.c (using python)
580 @$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
582 @echo Making register.c (using sh)
583 @$(SH) make-reg-dotc register.c . $(DISSECTOR_SRC)
587 # Build "tethereal-tap-register.c", which contains a function
588 # "register_all_tap_listeners()"
589 # that calls the register routines for all tehtereal tap listeners.
591 # We do this by grepping through sources.
593 # Formatting conventions: The name of the tap_listener_register_*
594 # routines must start in column zero, or must be preceded only by
595 # "void " starting in column zero, and must not be inside #if.
597 # The first argument is the name of the file to write.
598 # The second argument is the directory in which the source files live.
599 # All subsequent arguments are the files to scan.
601 tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
602 @echo Making tethereal-tap-register.c
603 @$(SH) make-tapreg-dotc tethereal-tap-register.c . $(TETHEREAL_TAP_SRC)
605 text2pcap-scanner.c : text2pcap-scanner.l
606 $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
609 rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
610 $(EXECUTABLES) $(PDB_FILE) \
611 editcap.obj mergecap.obj text2pcap.obj \
612 text2pcap-scanner.obj text2pcap-scanner.c register.c \
613 rdps.obj rdps.pdb config.h ps.c \
614 rdps.exe rdps.ilk dftest.obj dftest.exe randpkt.obj randpkt.ext \
617 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
619 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
621 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
623 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
625 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
627 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
629 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
631 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
634 # Call distclean only, if you would like to remove ALL generated files.
635 # Be sure to have python and perl installed to regenerate them.
637 rm -f x11-declarations.h x11-register-info.h packet-ncp2222.c
641 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
646 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
651 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
656 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
661 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
666 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake