1 ## Makefile for building ethereal.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 #########
10 include Makefile.common
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)
17 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
20 $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
22 #DISSECTOR_SRC = $(DISSECTOR_SRC:../=)
23 DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
25 DISSECTOR_SUPPORT_OBJECTS = $(DISSECTOR_SUPPORT_SRC:.c=.obj)
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)
33 # The header files listed here are built from x11-fields using Perl;
34 # we declare a dependency here so that they get built.
36 packet-x11.obj : packet-x11.c x11-declarations.h x11-register-info.h
39 # Build various header files for the X11 dissector.
41 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
42 $(PERL) process-x11-fields.pl <x11-fields
46 # Build "register.c", which contains a function "register_all_protocols()"
47 # that calls the register routines for all protocols.
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.).
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.
57 # We assume that all dissector routines are in "packet-XXX.c" files.
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,
64 # Therefore, we have a script to generate the "register.c" file.
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.
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
77 register.c: $(DISSECTOR_SRC)
79 @echo Making register.c (using python)
80 @$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
82 @echo Making register.c (using sh)
83 @$(SH) make-reg-dotc register.c . $(DISSECTOR_SRC)
86 packet-ncp2222.c : ncp2222.py
88 @echo Making packet-ncp2222.c
89 $(PYTHON) ncp2222.py -o packet-ncp2222.c
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
99 rm -f dissectors.lib $(PDB_FILE) \
100 $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
103 rm -f $(BUILT_SOURCES) packet-ncp2222.c register.c