From Harald Welte:
[obnox/wireshark/wip.git] / wiretap / Makefile.nmake
1 #
2 # $Id$
3 #
4
5 include ..\config.nmake
6 include <win32.mak>
7 include ..\Makefile.nmake.inc
8
9 include Makefile.common
10
11 # We use GENERATED_CFLAGS to get around flex's non-LLP64-compliant output
12 GENERATED_CFLAGS=\
13         $(STANDARD_CFLAGS) \
14         -DYYMALLOC=malloc -DYYFREE=free \
15         /I. /I.. $(GLIB_CFLAGS) \
16         $(ZLIB_CFLAGS) /I$(PCAP_DIR)/include
17
18 CFLAGS=$(WARNINGS_ARE_ERRORS) $(GENERATED_CFLAGS)
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 wiretap_LIBS = \
26         $(GLIB_LIBS)    \
27         ..\wsutil\libwsutil.lib \
28         $(ZLIB_LIBS)
29
30 all: wiretap-$(WTAP_VERSION).dll
31
32 wiretap-$(WTAP_VERSION).lib: wiretap-$(WTAP_VERSION).dll
33 wiretap-$(WTAP_VERSION).exp: wiretap-$(WTAP_VERSION).dll
34
35 wiretap-$(WTAP_VERSION).dll : $(OBJECTS) wtap.def ..\image\wiretap.res
36         $(link) $(dlllflags) $(conlibsdll) \
37                 $(LOCAL_LDFLAGS) $(DLL_LDFLAGS) \
38                 /DEF:wtap.def /OUT:wiretap-$(WTAP_VERSION).dll \
39                 /IMPLIB:wiretap-$(WTAP_VERSION).lib \
40                 ..\image\wiretap.res \
41                 $(OBJECTS) $(wiretap_LIBS)
42
43 RUNLEX = ..\tools\runlex.sh
44
45 ascend_scanner_lex.h : ascend_scanner.c
46 ascend_scanner.obj : ascend_scanner.c ascend.h
47         $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c ascend_scanner.c
48
49 k12text_lex.h : k12text.c
50 k12text.obj : k12text.c
51         $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $?
52
53 ascend.c ascend.h : ascend.y
54         $(YACC) $(YACC_OPTS) -d -p ascend ascend.y -o ascend.c
55
56 clean :
57         rm -f $(OBJECTS) \
58                 wiretap-*.lib \
59                 wiretap-*.exp \
60                 wiretap-*.dll \
61                 wiretap-*.dll.manifest \
62                 *.pdb *.sbr
63
64 #
65 # We remove the generated files with "distclean" because one of them,
66 # "ascend_scanner.c", needs different #includes for UN*X and Windows
67 # (UN*X versions of Flex make it include <unistd.h>, but that's a
68 # UN*X-only header), so if you're going to build from source, you need
69 # to build "ascend_scanner.c" from "ascend_scanner.l" with Flex.
70 # This might not be necessary for "ascend.{c,h}", but as
71 # long as you need Flex, you might as well get Bison....
72 #
73 distclean: clean
74         rm -f $(GENERATED_FILES)
75
76 maintainer-clean: distclean
77
78 checkapi:
79 ## 'abort' checking disabled for now pending resolution of existing use of g_assert & g_error
80 ##      $(PERL) ../tools/checkAPIs.pl -g abort -g termoutput $(NONGENERATED_C_FILES) $(GENERATOR_FILES)
81         $(PERL) ../tools/checkAPIs.pl -g termoutput $(NONGENERATED_C_FILES) $(GENERATOR_FILES)