instead of putting the MSC_VER_REQUIRED test into the root Makefile (which would...
[metze/wireshark/wip.git] / wiretap / Makefile.nmake
1 #
2 # $Id$
3 #
4
5 include ..\config.nmake
6 include <win32.mak>
7
8 ############### no need to modify below this line #########
9
10 include Makefile.common
11
12 CFLAGS=-DHAVE_CONFIG_H $(GLIB_CFLAGS) $(ZLIB_CFLAGS) /I$(PCAP_DIR)/include \
13         -D_U_="" $(LOCAL_CFLAGS) -DMSC_VER_REQUIRED=$(MSC_VER_REQUIRED)
14
15 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
16
17 .c.obj::
18         $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
19
20 OBJECTS=$(NONGENERATED_C_FILES:.c=.obj) $(GENERATED_C_FILES:.c=.obj) file_util.obj
21
22 wiretap_LIBS = \
23         $(GLIB_LIBS)    \
24         $(ZLIB_LIBS)
25
26 all: wiretap-$(WTAP_VERSION).dll
27
28 wiretap-$(WTAP_VERSION).lib: wiretap-$(WTAP_VERSION).dll
29 wiretap-$(WTAP_VERSION).exp: wiretap-$(WTAP_VERSION).dll
30
31 wiretap-$(WTAP_VERSION).dll : $(OBJECTS) wtap.def ..\image\wiretap.res
32         $(link) $(dlllflags) $(conlibsdll) \
33                 $(LOCAL_LDFLAGS) \
34                 /DEF:wtap.def /OUT:wiretap-$(WTAP_VERSION).dll \
35                 /IMPLIB:wiretap-$(WTAP_VERSION).lib \
36                 ..\image\wiretap.res \
37                 $(OBJECTS) $(wiretap_LIBS)
38
39 $(OBJECTS): config.h
40
41 ascend-grammar.c ascend-grammar.h : ascend-grammar.y
42         $(YACC) $(YACC_OPTS) -d -p ascend ascend-grammar.y -o ascend-grammar.c
43
44 ascend-scanner.obj : ascend-scanner.c ascend-grammar.h
45
46 ascend-scanner.c : ascend-scanner.l
47         $(LEX) -Pascend -oascend-scanner.c ascend-scanner.l
48
49
50 config.h        : config.h.win32 ..\config.nmake
51         sed -e s/@VERSION@/$(WTAP_VERSION)/ \
52             -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
53             < config.h.win32 > $@
54
55 clean :
56         rm -f $(OBJECTS) \
57                 wiretap-*.lib \
58                 wiretap-*.exp \
59                 wiretap-*.dll \
60                 wiretap-*.dll.manifest \
61                 wiretap-*.pdb
62
63 #
64 # We remove the generated files with "distclean" because one of them,
65 # "ascend-scanner.c", needs different #includes for UN*X and Windows
66 # (UN*X versions of Flex make it include <unistd.h>, but that's a
67 # UN*X-only header), so if you're going to build from source, you need
68 # to build "ascend-scanner.c" from "ascend-scanner.l" with Flex.
69 # This might not be necessary for "ascend-grammar.{c,h}", but as
70 # long as you need Flex, you might as well get Bison....
71 #
72 distclean: clean
73         rm -f config.h $(GENERATED_FILES)
74
75 maintainer-clean: distclean