1 ## Makefile for building wireshark.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
6 include ..\..\config.nmake
8 ############### no need to modify below this line #########
12 include Makefile.common
14 CFLAGS= $(WARNINGS_ARE_ERRORS) $(STANDARD_CFLAGS) \
15 /I. /I.. /I../.. $(GLIB_CFLAGS) \
17 $(PCRE_CFLAGS) $(GNUTLS_CFLAGS) $(NETTLE_CFLAGS) \
18 $(KFW_CFLAGS) $(AIRPCAP_CFLAGS) $(GEOIP_CFLAGS) \
22 $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
25 $(ALL_DISSECTORS_SRC:.c=.obj)
27 DISSECTOR_SUPPORT_OBJECTS = \
28 $(DISSECTOR_SUPPORT_SRC:.c=.obj)
30 dissectors.lib: register.obj packet-ncp2222.c $(GENERATED_HEADER_FILES) ../../config.h $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
31 @echo Linking dissectors.lib $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
32 link /lib /out:dissectors.lib $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
34 !IF "$(MSVC_VARIANT)" != "MSVC2005" && \
35 "$(MSVC_VARIANT)" != "MSVC2005EE" && \
36 "$(MSVC_VARIANT)" != "MSVC2008" && \
37 "$(MSVC_VARIANT)" != "MSVC2008EE" && \
38 "$(MSVC_VARIANT)" != "MSVC2010" && \
39 "$(MSVC_VARIANT)" != "MSVC2010EE"
40 # Disable debug for large dissectors
41 packet-rrc.obj : packet-rrc.c
42 $(CC) $(CVARSDLL) $(CFLAGS) /Zd /Fd.\ -c $?
46 # Build register.c, which contains a function register_all_protocols()
47 # that calls the register routines for all protocols and a function
48 # register_all_protocol_handoffs() that calls the handoff registration
49 # routines for all protocols.
51 # We do this by scanning through sources. If that turns out to be too slow,
52 # maybe we could just require every .o file to have an register routine
53 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
55 # Formatting conventions: The name of the proto_register_* routines and
56 # proto_reg_handoff_* routines must start in column zero, or must be
57 # preceded only by "void " starting in column zero, and must not be
60 # DISSECTOR_SRC is assumed to have all the files that need to be scanned.
62 # For some unknown reason, having a big "for" loop in the Makefile
63 # to scan all the files doesn't work with some "make"s; they seem to
64 # pass only the first few names in the list to the shell, for some
67 # Therefore, we have a script to generate the register.c file.
68 # The shell script runs slowly, as multiple greps and seds are run
69 # for each input file; this is especially slow on Windows. Therefore,
70 # if Python is present (as indicated by PYTHON being defined), we run
71 # a faster Python script to do that work instead.
73 # The first argument is the directory in which the source files live.
74 # The second argument is "dissectors", to indicate that we should build
75 # a register.c file for libwireshark.
76 # All subsequent arguments are the files to scan.
79 register.c: $(ALL_DISSECTORS_SRC) Makefile.common ..\..\tools\make-dissector-reg.py ..\..\tools\make-dissector-reg
81 @echo Making register.c (using python)
82 @$(PYTHON) "../../tools/make-dissector-reg.py" . dissectors $(ALL_DISSECTORS_SRC)
84 @echo Making register.c (using sh)
85 @$(SH) ../../tools/make-dissector-reg . dissectors $(ALL_DISSECTORS_SRC)
88 packet-ncp2222.c: ..\..\tools/ncp2222.py
90 @echo Making packet-ncp2222.c
91 $(PYTHON) "../../tools/ncp2222.py" -o packet-ncp2222.c
93 @echo Faking packet-ncp2222.c...
94 @echo Python is required to build the NCP disector
95 @echo Hiding packet-ncp.c...
96 mv packet-ncp.c packet-ncp.c.save
100 packet-ncp2222.obj: packet-ncp2222.inc
102 # Target to rebuild the X11 dissector header files.
103 # See README.X11 before using this--it requires the xcb and mesa source.
104 x11-dissector: ..\..\tools/process-x11-fields.pl x11-fields ..\..\tools/process-x11-xcb.pl
105 $(PERL) ../../tools/process-x11-fields.pl < x11-fields
106 $(PERL) ../../tools/process-x11-xcb.pl
109 rm -f dissectors.lib *.pdb register.c-tmp register-cache.pkl \
110 $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
114 maintainer-clean: distclean
115 rm -f $(GENERATED_FILES)
118 $(PERL) ../../tools/checkAPIs.pl -g abort -g termoutput \
119 $(ALL_DISSECTORS_SRC) $(DISSECTOR_INCLUDES) \