removed some gcc warnings (hopefully)
[obnox/wireshark/wip.git] / epan / dissectors / Makefile.nmake
1 ## Makefile for building ethereal.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
3 #
4 # $Id$
5
6 include ..\..\config.nmake
7
8 ############### no need to modify below this line #########
9
10 include Makefile.common
11
12 CFLAGS=-DHAVE_CONFIG_H /I. /I.. /I../.. $(GLIB_CFLAGS) \
13         /I$(NET_SNMP_DIR)\include /I$(NET_SNMP_DIR)\win32 \
14         $(PCRE_CFLAGS) $(NETTLE_CFLAGS) \
15         /I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
16
17 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL 
18
19 .c.obj::
20    $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
21
22 #DISSECTOR_SRC = $(DISSECTOR_SRC:../=)
23 DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
24
25 DISSECTOR_SUPPORT_OBJECTS = $(DISSECTOR_SUPPORT_SRC:.c=.obj)
26
27 #dissectors.lib: ../../config.h $(DISSECTOR_OBJECTS) $(EXTRA_OBJECTS)
28 dissectors.lib: register.obj packet-ncp2222.c $(GENERATED_HEADER_FILES) ../../config.h $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
29         @echo Linking dissectors.lib
30         link /lib /out:dissectors.lib $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
31
32 #
33 # The header files listed here are built from x11-fields using Perl;
34 # we declare a dependency here so that they get built.
35 #
36 packet-x11.obj  : packet-x11.c x11-declarations.h x11-register-info.h
37
38 #
39 # Build various header files for the X11 dissector.
40 #
41 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
42         $(PERL) process-x11-fields.pl <x11-fields
43
44
45 #
46 # Build "register.c", which contains a function "register_all_protocols()"
47 # that calls the register routines for all protocols.
48 #
49 # We do this by grepping through sources.  If that turns out to be too slow,
50 # maybe we could just require every .o file to have an register routine
51 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
52 #
53 # Formatting conventions:  The name of the proto_register_* routines must
54 # start in column zero, or must be preceded only by "void " starting in
55 # column zero, and must not be inside #if.
56 #
57 # We assume that all dissector routines are in "packet-XXX.c" files.
58 #
59 # For some unknown reason, having a big "for" loop in the Makefile
60 # to scan all the "packet-XXX.c" files doesn't work with some "make"s;
61 # they seem to pass only the first few names in the list to the shell,
62 # for some reason.
63 #
64 # Therefore, we have a script to generate the "register.c" file.
65 #
66 # The first argument is the name of the file to write.
67 # The second argument is the directory in which the source files live.
68 # All subsequent arguments are the files to scan.
69 #
70 # On Windows, however, that script runs slowly, as multiple greps
71 # and seds are run for each input file, so, if Python is present
72 # (as indicated by PYTHON being defined), we run a faster Python
73 # script to do that work instead.  That script doesn't take the name
74 # of the file to write as an argument; it always writes to
75 # "register.c".
76 #
77 register.c: $(DISSECTOR_SRC)
78 !IFDEF PYTHON
79         @echo Making register.c (using python)
80         @$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
81 !ELSE
82         @echo Making register.c (using sh)
83         @$(SH) make-reg-dotc register.c . $(DISSECTOR_SRC)
84 !ENDIF
85
86 packet-ncp2222.c : ncp2222.py
87 !IFDEF PYTHON
88         @echo Making packet-ncp2222.c
89         $(PYTHON) ncp2222.py -o packet-ncp2222.c
90 !ELSE
91         @echo Faking packet-ncp2222.c...
92         @echo Python is required to build the NCP disector
93         @echo Hiding packet-ncp.c...
94         mv packet-ncp.c packet-ncp.c.save
95         touch packet-ncp.c $@
96 !ENDIF
97
98 clean:
99         rm -f dissectors.lib $(PDB_FILE) \
100                 $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
101
102 distclean: clean
103         rm -f $(BUILT_SOURCES) packet-ncp2222.c register.c