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) $(GNUTLS_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_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
24 DISSECTOR_SUPPORT_OBJECTS = $(DISSECTOR_SUPPORT_SRC:.c=.obj)
26 dissectors.lib: register.obj packet-ncp2222.c $(GENERATED_HEADER_FILES) ../../config.h $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
27 @echo Linking dissectors.lib
28 link /lib /out:dissectors.lib $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
31 # The header files listed here are built from x11-fields using Perl;
32 # we declare a dependency here so that they get built.
34 packet-x11.obj : packet-x11.c x11-declarations.h x11-register-info.h
37 # Build various header files for the X11 dissector.
39 x11-declarations.h x11-register-info.h: x11-fields process-x11-fields.pl
40 $(PERL) process-x11-fields.pl <x11-fields
43 # Build register.c, which contains a function register_all_protocols()
44 # that calls the register routines for all protocols and a function
45 # register_all_protocol_handoffs() that calls the handoff registration
46 # routines for all protocols.
48 # We do this by scanning through sources. If that turns out to be too slow,
49 # maybe we could just require every .o file to have an register routine
50 # of a given name (packet-aarp.o -> proto_register_aarp, etc.).
52 # Formatting conventions: The name of the proto_register_* routines an
53 # proto_reg_handoff_* routines must start in column zero, or must be
54 # preceded only by "void " starting in column zero, and must not be
57 # DISSECTOR_SRC is assumed to have all the files that need to be scanned.
59 # For some unknown reason, having a big "for" loop in the Makefile
60 # to scan all the files doesn't work with some "make"s; they seem to
61 # pass only the first few names in the list to the shell, for some
64 # Therefore, we have a script to generate the register.c file.
65 # The shell script runs slowly, as multiple greps and seds are run
66 # for each input file; this is especially slow on Windows. Therefore,
67 # if Python is present (as indicated by PYTHON being defined), we run
68 # a faster Python script to do that work instead.
70 # The first argument is the directory in which the source files live.
71 # The second argument is "dissectors", to indicate that we should build
72 # a register.c file for libethereal.
73 # All subsequent arguments are the files to scan.
75 register.c: $(DISSECTOR_SRC)
77 @echo Making register.c (using python)
78 @$(PYTHON) ../../tools/make-dissector-reg.py . dissectors $(DISSECTOR_SRC)
80 @echo Making register.c (using sh)
81 @$(SH) ../../tools/make-dissector-reg . dissectors $(DISSECTOR_SRC)
84 packet-ncp2222.c : ncp2222.py
86 @echo Making packet-ncp2222.c
87 $(PYTHON) 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
97 rm -f dissectors.lib $(PDB_FILE) \
98 $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
102 maintainer-clean: distclean
103 rm -f $(GENERATED_FILES)