diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 22 |
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 + |