aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/Makefile.nmake
blob: a5191794e8c20559a1142a60b0f480c9e4eba23f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
# $Id$
#

include ..\config.nmake
include <win32.mak>

############### no need to modify below this line #########

include Makefile.common

CFLAGS=-DHAVE_CONFIG_H $(GLIB_CFLAGS) $(ZLIB_CFLAGS) /I$(PCAP_DIR)/include \
	-D_U_="" $(LOCAL_CFLAGS)

CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL

.c.obj::
	$(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<

OBJECTS=$(NONGENERATED_C_FILES:.c=.obj) $(GENERATED_C_FILES:.c=.obj)

wiretap_LIBS = \
	$(GLIB_LIBS)	\
	$(ZLIB_LIBS)

all: wiretap-$(WTAP_VERSION).dll

wiretap-$(WTAP_VERSION).lib: wiretap-$(WTAP_VERSION).dll
wiretap-$(WTAP_VERSION).exp: wiretap-$(WTAP_VERSION).dll

wiretap-$(WTAP_VERSION).dll : $(OBJECTS) wtap.def ..\image\wiretap.res
	$(link) $(dlllflags) $(conlibsdll) \
		$(LOCAL_LDFLAGS) \
		/DEF:wtap.def /OUT:wiretap-$(WTAP_VERSION).dll \
		/IMPLIB:wiretap-$(WTAP_VERSION).lib \
		..\image\wiretap.res \
		$(OBJECTS) $(wiretap_LIBS)

$(OBJECTS): config.h

ascend-grammar.c ascend-grammar.h : ascend-grammar.y
	$(YACC) $(YACC_OPTS) -d -p ascend ascend-grammar.y -o ascend-grammar.c

ascend-scanner.obj : ascend-scanner.c ascend-grammar.h

ascend-scanner.c : ascend-scanner.l
	$(LEX) -Pascend -oascend-scanner.c ascend-scanner.l


config.h	: config.h.win32 ..\config.nmake
	sed -e s/@VERSION@/$(WTAP_VERSION)/ \
	    -e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
	    < config.h.win32 > $@

clean :
	rm -f $(OBJECTS) \
		wiretap-$(WTAP_VERSION).lib \
		wiretap-$(WTAP_VERSION).exp \
		wiretap-$(WTAP_VERSION).dll \
		$(PDB_FILE)

#
# We remove the generated files with "distclean" because one of them,
# "ascend-scanner.c", needs different #includes for UN*X and Windows
# (UN*X versions of Flex make it include <unistd.h>, but that's a
# UN*X-only header), so if you're going to build from source, you need
# to build "ascend-scanner.c" from "ascend-scanner.l" with Flex.
# This might not be necessary for "ascend-grammar.{c,h}", but as
# long as you need Flex, you might as well get Bison....
#
distclean: clean
	rm -f config.h $(GENERATED_FILES)

maintainer-clean: distclean