summaryrefslogtreecommitdiff
path: root/plugins/tpg/Makefile.nmake
blob: 48e5958d52f72be1fedff4c1fe45e4a567abc36c (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
#

include ..\..\config.nmake

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

LEMON=..\..\tools\lemon

CFLAGS=$(WARNINGS_ARE_ERRORS) $(STANDARD_CFLAGS) \
	/I../.. $(GLIB_CFLAGS) /I$(LEMON) \
	/I$(PCAP_DIR)\include

.c.obj::
	$(CC) $(CFLAGS) -Fdmate.pdb -c $<

LDFLAGS = $(PLUGIN_LDFLAGS)

!IFDEF ENABLE_LIBWIRESHARK
LINK_PLUGIN_WITH=..\..\epan\libwireshark.lib
CFLAGS=$(CFLAGS)

OBJECTS=packet-mate.obj\
		mate_setup.obj\
		mate_runtime.obj\
		mate_util.obj\
		mate_plugin.obj\
		mate_grammar.obj\
		mate_parser.obj

mate.dll mate.exp mate.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
	link -dll /out:mate.dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \
	$(GLIB_LIBS)

!ENDIF

clean:
	rm -f $(OBJECTS) mate.dll mate.exp mate.lib *.nativecodeanalysis.xml *.pdb *.sbr

#
# We remove the generated files with "distclean" because one of them,
# "mate_parser.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 "mate_parser.c" from "mate_parser.l" with Flex.
# This might not be necessary for "mate_grammar.{c,h}", but we handle them
# the same for now.
#
distclean: clean
	rm -f mate_parser.c mate_grammar.c mate_grammar.h mate_grammar.out

maintainer-clean: distclean

mate_parser.c : mate_parser.l
	$(LEX) -Pdf_ -omate_parser.c mate_parser.l

mate_grammar.h : mate_grammar.c
mate_grammar.c : mate_grammar.lemon $(LEMON)\lemon.exe
	$(LEMON)\lemon.exe t=$(LEMON)\lempar.c mate_grammar.lemon

$(LEMON)\lemon.exe:
	cd ../../tools
	$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake lemon
	cd ../plugins/mate

checkapi:
	$(PERL) ../../tools/checkAPIs.pl -g abort -g termoutput -build $(DISSECTOR_SRC) $(DISSECTOR_INCLUDES)