36bd3938a422ca973d03203d1ec596fba7a05e2c
[obnox/wireshark/wip.git] / epan / dfilter / Makefile.nmake
1 ## Makefile for building wireshark.exe with Microsoft C and nmake
2 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
3 #
4 # $Id$
5
6 include ..\..\config.nmake
7 include ..\..\Makefile.nmake.inc
8
9 include Makefile.common
10
11 LEMON=..\..\tools\lemon
12
13 # We GENERATED_CFLAGS to get around flex's non-LLP64-compliant output
14 GENERATED_CFLAGS=\
15         $(STANDARD_CFLAGS) \
16         /I. /I.. /I..\.. $(GLIB_CFLAGS) \
17         /I$(LEMON) \
18         /I$(PCAP_DIR)\include
19
20 CFLAGS=$(WARNINGS_ARE_ERRORS) $(GENERATED_CFLAGS)
21
22 .c.obj::
23    $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
24
25 OBJECTS=$(NONGENERATED_C_FILES:.c=.obj) $(GENERATED_C_FILES:.c=.obj)
26
27 dfilter.lib     : $(OBJECTS)
28         link /lib /out:dfilter.lib $(OBJECTS)
29
30 $(OBJECTS): ..\..\config.h
31
32 ..\..\config.h: ..\..\config.h.win32 ..\..\config.nmake
33         cd ..\..
34         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake config.h
35         cd epan\dfilter
36
37 clean:
38         rm -f $(OBJECTS) dfilter.lib *.pdb *.sbr
39
40 #
41 # We remove the generated files with "distclean" because one of them,
42 # "scanner.c", needs different #includes for UN*X and Windows
43 # (UN*X versions of Flex make it include <unistd.h>, but that's a
44 # UN*X-only header), so if you're going to build from source, you need
45 # to build "scanner.c" from "scanner.l" with Flex.
46 # This might not be necessary for "grammar.{c,h}", but we handle them
47 # the same for now.
48 #
49 distclean: clean
50         rm -f $(GENERATED_C_FILES) $(GENERATED_HEADER_FILES) grammar.out
51
52 maintainer-clean: distclean
53
54 RUNLEX=..\..\tools\runlex.sh
55
56 scanner_lex.h : scanner.c
57 scanner.obj : scanner.c grammar.h
58         $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c scanner.c
59
60 grammar.h : grammar.c
61 grammar.c : $(LEMON)\lemon.exe $(LEMON)\lempar.c grammar.lemon
62         $(LEMON)\lemon.exe t=$(LEMON)\lempar.c grammar.lemon 
63
64 $(LEMON)\lemon.exe:
65         cd ../../tools
66         $(MAKE) /$(MAKEFLAGS) -f makefile.nmake lemon
67         cd ../epan/dfilter
68
69 checkapi:
70         $(PERL) ../../tools/checkAPIs.pl -g termoutput \
71                 $(GENERATOR_FILES)      \
72                 $(NONGENERATED_C_FILES)