1 ## Makefile for building wireshark.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
6 include ..\..\config.nmake
7 include ..\..\Makefile.nmake.inc
9 include Makefile.common
11 LEMON=..\..\tools\lemon
13 # We GENERATED_CFLAGS to get around flex's non-LLP64-compliant output
14 GENERATED_CFLAGS=-DHAVE_CONFIG_H /I. /I.. /I..\.. /I$(LEMON) \
15 $(GLIB_CFLAGS) $(PCRE_CFLAGS) /I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
16 CFLAGS=-WX $(GENERATED_CFLAGS)
18 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
21 $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
23 OBJECTS=$(NONGENERATED_C_FILES:.c=.obj) $(GENERATED_C_FILES:.c=.obj)
25 dfilter.lib : $(OBJECTS)
26 link /lib /out:dfilter.lib $(OBJECTS)
28 $(OBJECTS): ..\..\config.h
30 ..\..\config.h: ..\..\config.h.win32 ..\..\config.nmake
32 $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake config.h
36 rm -f $(OBJECTS) dfilter.lib *.pdb
39 # We remove the generated files with "distclean" because one of them,
40 # "scanner.c", needs different #includes for UN*X and Windows
41 # (UN*X versions of Flex make it include <unistd.h>, but that's a
42 # UN*X-only header), so if you're going to build from source, you need
43 # to build "scanner.c" from "scanner.l" with Flex.
44 # This might not be necessary for "grammar.{c,h}", but we handle them
48 rm -f $(GENERATED_C_FILES) $(GENERATED_HEADER_FILES) grammar.out
50 maintainer-clean: distclean
52 RUNLEX=..\..\tools\runlex.sh
54 scanner_lex.h : scanner.c
55 scanner.obj : scanner.c grammar.h
56 $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c scanner.c
59 grammar.c : $(LEMON)\lemon.exe $(LEMON)\lempar.c grammar.lemon
60 $(LEMON)\lemon.exe t=$(LEMON)\lempar.c grammar.lemon
64 $(MAKE) /$(MAKEFLAGS) -f makefile.nmake lemon