Use a common .l.c rule for running Flex on .l files, just as is done on
[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=-WX -DYYMALLOC=malloc -DYYFREE=free -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 .SUFFIXES: .l
18
19 .c.obj::
20         $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
21
22 .l.c:
23         $(LEX) -o$@ $<
24         
25 OBJECTS=$(NONGENERATED_C_FILES:.c=.obj) $(GENERATED_C_FILES:.c=.obj) file_util.obj
26
27 wiretap_LIBS = \
28         $(GLIB_LIBS)    \
29         $(ZLIB_LIBS)
30
31 all: wiretap-$(WTAP_VERSION).dll
32
33 wiretap-$(WTAP_VERSION).lib: wiretap-$(WTAP_VERSION).dll
34 wiretap-$(WTAP_VERSION).exp: wiretap-$(WTAP_VERSION).dll
35
36 wiretap-$(WTAP_VERSION).dll : $(OBJECTS) wtap.def ..\image\wiretap.res
37         $(link) $(dlllflags) $(conlibsdll) \
38                 $(LOCAL_LDFLAGS) \
39                 /DEF:wtap.def /OUT:wiretap-$(WTAP_VERSION).dll \
40                 /IMPLIB:wiretap-$(WTAP_VERSION).lib \
41                 ..\image\wiretap.res \
42                 $(OBJECTS) $(wiretap_LIBS)
43 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20" 
44         mt.exe -nologo -manifest "wiretap-$(WTAP_VERSION).dll.manifest" -outputresource:wiretap-$(WTAP_VERSION).dll;2
45 !ENDIF
46
47 $(OBJECTS): config.h
48
49 ascend-grammar.c ascend-grammar.h : ascend-grammar.y
50         $(YACC) $(YACC_OPTS) -d -p ascend ascend-grammar.y -o ascend-grammar.c
51
52 ascend-scanner.obj : ascend-scanner.c ascend-grammar.h
53
54 k12text.obj : k12text.c
55
56 config.h        : config.h.win32 ..\config.nmake
57         sed -e s/@VERSION@/$(WTAP_VERSION)/ \
58             -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
59             < config.h.win32 > $@
60
61 clean :
62         rm -f $(OBJECTS) \
63                 wiretap-*.lib \
64                 wiretap-*.exp \
65                 wiretap-*.dll \
66                 wiretap-*.dll.manifest \
67                 *.pdb
68
69 #
70 # We remove the generated files with "distclean" because one of them,
71 # "ascend-scanner.c", needs different #includes for UN*X and Windows
72 # (UN*X versions of Flex make it include <unistd.h>, but that's a
73 # UN*X-only header), so if you're going to build from source, you need
74 # to build "ascend-scanner.c" from "ascend-scanner.l" with Flex.
75 # This might not be necessary for "ascend-grammar.{c,h}", but as
76 # long as you need Flex, you might as well get Bison....
77 #
78 distclean: clean
79         rm -f config.h $(GENERATED_FILES)
80
81 maintainer-clean: distclean