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