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=-WX -DHAVE_CONFIG_H /I. /I.. /I../.. $(GLIB_CFLAGS) \
16 $(PCRE_CFLAGS) $(GNUTLS_CFLAGS) $(NETTLE_CFLAGS) \
17 $(KFW_CFLAGS) $(AIRPCAP_CFLAGS) $(GEOIP_CFLAGS) \
18 /I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
20 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
23 $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
26 $(ALL_DISSECTORS_SRC:.c=.obj)
28 DISSECTOR_SUPPORT_OBJECTS = \
29 $(DISSECTOR_SUPPORT_SRC:.c=.obj)
31 dissectors.lib: register.obj packet-ncp2222.c $(GENERATED_HEADER_FILES) ../../config.h $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
32 @echo Linking dissectors.lib $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
33 link /lib /out:dissectors.lib $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
35 !IF "$(MSVC_VARIANT)" != "MSVC2005EE" && "$(MSVC_VARIANT)" != "MSVC2005" && "$(MSVC_VARIANT)" != "MSVC2008EE" && "$(MSVC_VARIANT)" != "MSVC2008"
36 # Disable debug for large dissectors
37 packet-rrc.obj : packet-rrc.c
38 $(CC) $(CVARSDLL) $(CFLAGS) /Zd /Fd.\ -c $?
42 # Build register.c, which contains a function register_all_protocols()
43 # that calls the register routines for all protocols and a function
44 # register_all_protocol_handoffs() that calls the handoff registration
45 # routines for all protocols.
47 # We do this by scanning through sources. If that turns out to be too slow,
48 # maybe we could just require every .o file to have an register routine
49 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
51 # Formatting conventions: The name of the proto_register_* routines and
52 # proto_reg_handoff_* routines must start in column zero, or must be
53 # preceded only by "void " starting in column zero, and must not be
56 # DISSECTOR_SRC is assumed to have all the files that need to be scanned.
58 # For some unknown reason, having a big "for" loop in the Makefile
59 # to scan all the files doesn't work with some "make"s; they seem to
60 # pass only the first few names in the list to the shell, for some
63 # Therefore, we have a script to generate the register.c file.
64 # The shell script runs slowly, as multiple greps and seds are run
65 # for each input file; this is especially slow on Windows. Therefore,
66 # if Python is present (as indicated by PYTHON being defined), we run
67 # a faster Python script to do that work instead.
69 # The first argument is the directory in which the source files live.
70 # The second argument is "dissectors", to indicate that we should build
71 # a register.c file for libwireshark.
72 # All subsequent arguments are the files to scan.
75 register.c: $(ALL_DISSECTORS_SRC)
77 @echo Making register.c (using python)
78 @$(PYTHON) "../../tools/make-dissector-reg.py" . dissectors $(ALL_DISSECTORS_SRC)
80 @echo Making register.c (using sh)
81 @$(SH) ../../tools/make-dissector-reg . dissectors $(ALL_DISSECTORS_SRC) \
84 packet-ncp2222.c : ..\..\tools/ncp2222.py
86 @echo Making packet-ncp2222.c
87 $(PYTHON) "../../tools/ncp2222.py" -o packet-ncp2222.c
89 @echo Faking packet-ncp2222.c...
90 @echo Python is required to build the NCP disector
91 @echo Hiding packet-ncp.c...
92 mv packet-ncp.c packet-ncp.c.save
96 packet-ncp2222.obj: packet-ncp2222.inc
98 # Target to rebuild the X11 dissector header files.
99 # See README.X11 before using this--it requires the xcb and mesa source.
100 x11-dissector: ..\..\tools/process-x11-fields.pl x11-fields ..\..\tools/process-x11-xcb.pl
101 $(PERL) ../../tools/process-x11-fields.pl < x11-fields
102 $(PERL) ../../tools/process-x11-xcb.pl
105 rm -f dissectors.lib *.pdb register.c-tmp register-cache.pkl \
106 $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
110 maintainer-clean: distclean
111 rm -f $(GENERATED_FILES)
114 $(PERL) ../../tools/checkAPIs.pl -g abort -g termoutput \
115 $(ALL_DISSECTORS_SRC) \