summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2015-08-17 14:40:21 +0100
committerFrediano Ziglio <fziglio@redhat.com>2015-08-17 14:40:21 +0100
commitd5a95fb705c6d450cc5731dc886d1a2f3cb0266b (patch)
tree5f34124b42ead31c039e2b002879a6304ff16df5 /Makefile
parentfe2d21957e3d58edf0fc695ed787ab75ff07e125 (diff)
Add missing pieces to build the full dissectorHEADmaster
Write a simple Makefile that generate all missing files using spice-protocol code generator and add some minor files. Currently Windows is not supported. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0cdbfcf
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,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
+