summaryrefslogtreecommitdiff
path: root/Makefile
blob: 0cdbfcff7a4070a271a104eaa9dc0f100132d9cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
CC ?= gcc

GENDIR := $(shell pkg-config spice-protocol --variable=codegendir)

SRCS := plugin.c packet-spice.c packet-main.c
HDRS := packet-main.h packet-spice.h

spice2.so: $(SRCS) $(HDRS)
	$(CC) -O2 -Wall $$(pkg-config --cflags wireshark) -DSPICE_DISSECTOR -fPIC -DPIC -Wl,-soname -Wl,$@ -Wl,--as-needed -o $@ -fwrapv -shared -pthread $(SRCS)

packet-main.c: $(GENDIR)/spice.proto
	$(GENDIR)/spice_codegen.py --generate-dissector $< $@

packet-main.h: $(GENDIR)/spice.proto
	$(GENDIR)/spice_codegen.py --generate-dissector $< --header $@

packet-spice.h: $(GENDIR)/spice.proto
	$(GENDIR)/spice_codegen.py --generate-wireshark-dissector $< $@

clean::
	rm -f *.o spice2.so packet-main.c packet-spice.h packet-main.h