vhost: switch to use IOTLB v2 format
[qemu.git] / contrib / plugins / Makefile
1 # -*- Mode: makefile -*-
2 #
3 # This Makefile example is fairly independent from the main makefile
4 # so users can take and adapt it for their build. We only really
5 # include config-host.mak so we don't have to repeat probing for
6 # cflags that the main configure has already done for us.
7 #
8
9 BUILD_DIR := $(CURDIR)/../..
10
11 include $(BUILD_DIR)/config-host.mak
12
13 VPATH += $(SRC_PATH)/contrib/plugins
14
15 NAMES :=
16 NAMES += hotblocks
17 NAMES += hotpages
18 NAMES += howvec
19 NAMES += lockstep
20
21 SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
22
23 # The main QEMU uses Glib extensively so it's perfectly fine to use it
24 # in plugins (which many example do).
25 CFLAGS = $(GLIB_CFLAGS)
26 CFLAGS += -fPIC
27 CFLAGS += $(if $(findstring no-psabi,$(QEMU_CFLAGS)),-Wpsabi)
28 CFLAGS += -I$(SRC_PATH)/include/qemu
29
30 all: $(SONAMES)
31
32 %.o: %.c
33 $(CC) $(CFLAGS) -c -o $@ $<
34
35 lib%.so: %.o
36 $(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDLIBS)
37
38 clean:
39 rm -f *.o *.so *.d
40 rm -Rf .libs
41
42 .PHONY: all clean