Move some checkapi targets into Makefile.common
[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=-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)
17
18 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
19
20 .c.obj::
21    $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
22
23 OBJECTS=$(NONGENERATED_C_FILES:.c=.obj) $(GENERATED_C_FILES:.c=.obj)
24
25 dfilter.lib     : $(OBJECTS)
26         link /lib /out:dfilter.lib $(OBJECTS)
27
28 $(OBJECTS): ..\..\config.h
29
30 ..\..\config.h: ..\..\config.h.win32 ..\..\config.nmake
31         cd ..\..
32         $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake config.h
33         cd epan\dfilter
34
35 clean:
36         rm -f $(OBJECTS) dfilter.lib *.pdb
37
38 #
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
45 # the same for now.
46 #
47 distclean: clean
48         rm -f $(GENERATED_C_FILES) $(GENERATED_HEADER_FILES) grammar.out
49
50 maintainer-clean: distclean
51
52 RUNLEX=..\..\tools\runlex.sh
53
54 scanner_lex.h : scanner.c
55 scanner.obj : scanner.c grammar.h
56         $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c scanner.c
57
58 grammar.h : grammar.c
59 grammar.c : $(LEMON)\lemon.exe $(LEMON)\lempar.c grammar.lemon
60         $(LEMON)\lemon.exe t=$(LEMON)\lempar.c grammar.lemon
61
62 $(LEMON)\lemon.exe:
63         cd ../../tools
64         $(MAKE) /$(MAKEFLAGS) -f makefile.nmake lemon
65         cd ../epan/dfilter